tree: inline legacy_id() into its sole caller

This commit is contained in:
Martin von Zweigbergk 2023-08-28 09:27:17 -07:00 committed by Martin von Zweigbergk
parent d9ce70c176
commit 64b47bae56
2 changed files with 3 additions and 7 deletions

View File

@ -282,7 +282,7 @@ impl MergedTree {
/// The tree's id
pub fn id(&self) -> MergedTreeId {
match self {
MergedTree::Legacy(tree) => tree.legacy_id(),
MergedTree::Legacy(tree) => MergedTreeId::Legacy(tree.id().clone()),
MergedTree::Merge(merge) => MergedTreeId::Merge(merge.map(|tree| tree.id().clone())),
}
}

View File

@ -24,8 +24,8 @@ use thiserror::Error;
use tracing::instrument;
use crate::backend::{
BackendError, ConflictId, FileId, MergedTreeId, ObjectId, TreeEntriesNonRecursiveIterator,
TreeEntry, TreeId, TreeValue,
BackendError, ConflictId, FileId, ObjectId, TreeEntriesNonRecursiveIterator, TreeEntry, TreeId,
TreeValue,
};
use crate::files::MergeResult;
use crate::matchers::{EverythingMatcher, Matcher};
@ -108,10 +108,6 @@ impl Tree {
&self.id
}
pub fn legacy_id(&self) -> MergedTreeId {
MergedTreeId::Legacy(self.id.clone())
}
pub fn data(&self) -> &backend::Tree {
&self.data
}