Fixes some Clippy warnings

pull/10/head
Tpt 6 years ago
parent 232d52901d
commit 5ba4b99f1a
  1. 4
      src/rio/turtle/turtle_grammar.rustpeg
  2. 3
      src/sparql/parser.rs
  3. 6
      src/sparql/sparql_grammar.rustpeg

@ -19,7 +19,7 @@ directive -> () = prefixID / base / sparqlPrefix / sparqlBase
//[4]
prefixID -> () = "@prefix" _ ns:PNAME_NS _ i:IRIREF _ "." {
state.namespaces.insert(ns.into(), i.into());
state.namespaces.insert(ns.into(), i);
}
//[5]
@ -144,7 +144,7 @@ iri -> NamedNode = i:(IRIREF / PrefixedName) {
//[136s]
PrefixedName -> Url = PNAME_LN /
ns:PNAME_NS {? state.namespaces.get(ns).map(|v| v.clone()).ok_or("Prefix not found") }
ns:PNAME_NS {? state.namespaces.get(ns).cloned().ok_or("Prefix not found") }
//[137s]
BlankNode -> BlankNode =

@ -7,7 +7,8 @@ mod grammar {
unit_arg,
naive_bytecount,
cyclomatic_complexity,
many_single_char_names
many_single_char_names,
type_complexity
)]
use model::*;

@ -33,7 +33,7 @@ BaseDecl -> () = "BASE"i _ i:IRIREF {?
//[6]
PrefixDecl -> () = "PREFIX"i _ ns:PNAME_NS _ i:IRIREF {
state.namespaces.insert(ns.into(), i.into());
state.namespaces.insert(ns.into(), i);
}
//[7]
@ -82,7 +82,7 @@ ConstructQuery -> Query =
dataset: d,
algebra: build_select(
Selection::default(),
MultiSetPattern::BGP(c.into_iter().map(|p| TripleOrPathPattern::from(p)).collect()).into(),
MultiSetPattern::BGP(c.into_iter().map(TripleOrPathPattern::from).collect()),
g, h, o, l, v, state
)
}
@ -668,7 +668,7 @@ GraphNode -> FocusedTriplePattern<TermOrVariable> =
//[105]
GraphNodePath -> FocusedTripleOrPathPattern<TermOrVariable> =
t:VarOrTerm { FocusedTripleOrPathPattern::new(t.into()) } /
t:VarOrTerm { FocusedTripleOrPathPattern::new(t) } /
TriplesNodePath
//[106]

Loading…
Cancel
Save