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] //[4]
prefixID -> () = "@prefix" _ ns:PNAME_NS _ i:IRIREF _ "." { prefixID -> () = "@prefix" _ ns:PNAME_NS _ i:IRIREF _ "." {
state.namespaces.insert(ns.into(), i.into()); state.namespaces.insert(ns.into(), i);
} }
//[5] //[5]
@ -144,7 +144,7 @@ iri -> NamedNode = i:(IRIREF / PrefixedName) {
//[136s] //[136s]
PrefixedName -> Url = PNAME_LN / 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] //[137s]
BlankNode -> BlankNode = BlankNode -> BlankNode =

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

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

Loading…
Cancel
Save