From 10cbb513fa9eef542003f65907b88e9e2c3708d9 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Thu, 22 Aug 2024 18:56:45 +0900 Subject: [PATCH] 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. --- lib/src/copies.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/src/copies.rs b/lib/src/copies.rs index 10ab46b3c..db51edf1f 100644 --- a/lib/src/copies.rs +++ b/lib/src/copies.rs @@ -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;