Skip to content

Commit

Permalink
refactor: completely align hdt_graph.rs triples_matching return signa…
Browse files Browse the repository at this point in the history
…ture to Sophia 0.9
  • Loading branch information
KonradHoeffner committed Nov 28, 2024
1 parent 63723ba commit 244401f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/hdt_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,18 +156,17 @@ impl Graph for HdtGraph {
/// let persons = dbpedia.triples_matching(Any, Some(birth_place), Some(leipzig));
/// }
/// ```
#[allow(refining_impl_trait)]
fn triples_matching<'s, S, P, O>(
&'s self, sm: S, pm: P, om: O,
) -> Box<dyn Iterator<Item = Result<Self::Triple<'s>, Self::Error>> + 's>
) -> impl Iterator<Item = Result<Self::Triple<'s>, Self::Error>> + 's
where
S: TermMatcher + 's,
P: TermMatcher + 's,
O: TermMatcher + 's,
{
use HdtMatcher::{Constant, Other};
let xso = match self.unpack_matcher(&sm, &IdKind::Subject) {
None => return Box::new(iter::empty()),
None => return Box::new(iter::empty()) as Box<dyn Iterator<Item = _>>,
Some(x) => x,
};
let xpo = match self.unpack_matcher(&pm, &IdKind::Predicate) {
Expand Down

0 comments on commit 244401f

Please sign in to comment.