copies: define CopiesTreeDiffEntry struct before stream type

I'm going to add some methods, and I don't want to insert them in between
the stream type and impls.
This commit is contained in:
Yuya Nishihara 2024-08-22 18:56:45 +09:00
parent e67aac6d5c
commit 10cbb513fa

View file

@ -90,6 +90,16 @@ impl CopyRecords {
}
}
/// A `TreeDiffEntry` with copy information.
pub struct CopiesTreeDiffEntry {
/// The source path.
pub source: RepoPathBuf,
/// The target path.
pub target: RepoPathBuf,
/// The resolved tree values if available.
pub value: BackendResult<(MergedTreeValue, MergedTreeValue)>,
}
/// Wraps a `TreeDiffStream`, adding support for copies and renames.
pub struct CopiesTreeDiffStream<'a> {
inner: TreeDiffStream<'a>,
@ -112,16 +122,6 @@ impl<'a> CopiesTreeDiffStream<'a> {
}
}
/// A `TreeDiffEntry` with copy information.
pub struct CopiesTreeDiffEntry {
/// The source path.
pub source: RepoPathBuf,
/// The target path.
pub target: RepoPathBuf,
/// The resolved tree values if available.
pub value: BackendResult<(MergedTreeValue, MergedTreeValue)>,
}
impl Stream for CopiesTreeDiffStream<'_> {
type Item = CopiesTreeDiffEntry;