mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-18 10:07:28 +00:00
revset: implement Debug for RevsetImpl and add trait bound accordingly
This commit is contained in:
parent
2aab6c7825
commit
429562ca2f
2 changed files with 9 additions and 1 deletions
|
@ -71,6 +71,14 @@ impl<'index> RevsetImpl<'index> {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for RevsetImpl<'_> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("RevsetImpl")
|
||||
.field("inner", &self.inner)
|
||||
.finish_non_exhaustive()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'index> Revset<'index> for RevsetImpl<'index> {
|
||||
fn iter(&self) -> Box<dyn Iterator<Item = CommitId> + '_> {
|
||||
Box::new(self.inner.iter().map(|index_entry| index_entry.commit_id()))
|
||||
|
|
|
@ -1654,7 +1654,7 @@ pub fn resolve_symbols(
|
|||
)
|
||||
}
|
||||
|
||||
pub trait Revset<'index> {
|
||||
pub trait Revset<'index>: fmt::Debug {
|
||||
/// Iterate in topological order with children before parents.
|
||||
fn iter(&self) -> Box<dyn Iterator<Item = CommitId> + '_>;
|
||||
|
||||
|
|
Loading…
Reference in a new issue