mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-18 10:07:28 +00:00
revset: remove is_empty() implementation from trait
Now that there's a single implementation of `Revset`, I think it makes more sense for `is_empty()` to be defined there. Maybe different revset engines have different ways of implementing it. Even if they don't, this is trivial to re-implement in each revset engine.
This commit is contained in:
parent
2d1b13b338
commit
6a57456067
1 changed files with 5 additions and 3 deletions
|
@ -1525,9 +1525,7 @@ pub trait Revset<'index> {
|
|||
// All revsets currently iterate in order of descending index position
|
||||
fn iter(&self) -> Box<dyn Iterator<Item = IndexEntry<'index>> + '_>;
|
||||
|
||||
fn is_empty(&self) -> bool {
|
||||
self.iter().next().is_none()
|
||||
}
|
||||
fn is_empty(&self) -> bool;
|
||||
}
|
||||
|
||||
trait ToPredicateFn<'index> {
|
||||
|
@ -1645,6 +1643,10 @@ impl<'index> Revset<'index> for RevsetImpl<'index> {
|
|||
fn iter(&self) -> Box<dyn Iterator<Item = IndexEntry<'index>> + '_> {
|
||||
self.inner.iter()
|
||||
}
|
||||
|
||||
fn is_empty(&self) -> bool {
|
||||
self.iter().next().is_none()
|
||||
}
|
||||
}
|
||||
|
||||
struct EagerRevset<'index> {
|
||||
|
|
Loading…
Reference in a new issue