Skip to content

Commit

Permalink
move Not into _not.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
mkatychev authored and pchampin committed Jul 30, 2024
1 parent 05ff337 commit b4b827a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
4 changes: 3 additions & 1 deletion api/src/term/matcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ mod _datatype_matcher;
mod _graph_name_matcher;
mod _language_tag_matcher;
mod _matcher_ref;
mod _not;
mod _term_matcher_gn;
mod _trait;

pub use _any::*;
pub use _any::Any;
pub use _datatype_matcher::*;
pub use _graph_name_matcher::*;
pub use _language_tag_matcher::*;
pub use _matcher_ref::*;
pub use _not::Not;
pub use _term_matcher_gn::*;
pub use _trait::*;

Expand Down
11 changes: 0 additions & 11 deletions api/src/term/matcher/_any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,3 @@ impl TermMatcher for Any {
true
}
}

/// Matches on the inverse of the inner [`Term`] or [`GraphName`]
pub struct Not<M>(pub M);

impl<M: TermMatcher> TermMatcher for Not<M> {
type Term = SimpleTerm<'static>; // not actually used

fn matches<T2: Term + ?Sized>(&self, term: &T2) -> bool {
!self.0.matches(term)
}
}
12 changes: 12 additions & 0 deletions api/src/term/matcher/_not.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use super::*;

/// Matches on the inverse of the inner [`Term`] or [`GraphName`]
pub struct Not<M>(pub M);

impl<M: TermMatcher> TermMatcher for Not<M> {
type Term = SimpleTerm<'static>; // not actually used

fn matches<T2: Term + ?Sized>(&self, term: &T2) -> bool {
!self.0.matches(term)
}
}

0 comments on commit b4b827a

Please sign in to comment.