Disables clippy in generated parsers and fixes some lints

pull/10/head
Tpt 6 years ago
parent f924821c79
commit 47d5f677cb
  1. 2
      src/rio/ntriples/mod.rs
  2. 3
      src/rio/turtle/mod.rs
  3. 11
      src/sparql/model.rs
  4. 3
      src/sparql/parser.rs
  5. 4
      src/store/store.rs

@ -1,6 +1,8 @@
///Implements https://www.w3.org/TR/n-triples/ ///Implements https://www.w3.org/TR/n-triples/
mod grammar { mod grammar {
#![allow(unknown_lints)]
#![allow(clippy)]
include!(concat!(env!("OUT_DIR"), "/ntriples_grammar.rs")); include!(concat!(env!("OUT_DIR"), "/ntriples_grammar.rs"));
} }

@ -1,6 +1,9 @@
/// Implements https://www.w3.org/TR/turtle/ /// Implements https://www.w3.org/TR/turtle/
mod grammar { mod grammar {
#![allow(unknown_lints)]
#![allow(clippy)]
use model::*; use model::*;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::collections::HashMap; use std::collections::HashMap;

@ -1,5 +1,4 @@
use model::*; use model::*;
use std::collections::btree_map;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::fmt; use std::fmt;
use uuid::Uuid; use uuid::Uuid;
@ -162,7 +161,7 @@ impl Binding {
} }
} }
pub fn iter<'a>(&'a self) -> btree_map::Iter<Variable, Term> { pub fn iter(&self) -> <&BTreeMap<Variable, Term> as IntoIterator>::IntoIter {
self.0.iter() self.0.iter()
} }
} }
@ -175,18 +174,18 @@ impl Default for Binding {
impl IntoIterator for Binding { impl IntoIterator for Binding {
type Item = (Variable, Term); type Item = (Variable, Term);
type IntoIter = btree_map::IntoIter<Variable, Term>; type IntoIter = <BTreeMap<Variable, Term> as IntoIterator>::IntoIter;
fn into_iter(self) -> btree_map::IntoIter<Variable, Term> { fn into_iter(self) -> <BTreeMap<Variable, Term> as IntoIterator>::IntoIter {
self.0.into_iter() self.0.into_iter()
} }
} }
impl<'a> IntoIterator for &'a Binding { impl<'a> IntoIterator for &'a Binding {
type Item = (&'a Variable, &'a Term); type Item = (&'a Variable, &'a Term);
type IntoIter = btree_map::Iter<'a, Variable, Term>; type IntoIter = <&'a BTreeMap<Variable, Term> as IntoIterator>::IntoIter;
fn into_iter(self) -> btree_map::Iter<'a, Variable, Term> { fn into_iter(self) -> <&'a BTreeMap<Variable, Term> as IntoIterator>::IntoIter {
self.0.iter() self.0.iter()
} }
} }

@ -3,6 +3,9 @@ use std::char;
use std::str::Chars; use std::str::Chars;
mod grammar { mod grammar {
#![allow(unknown_lints)]
#![allow(clippy)]
use model::*; use model::*;
use sparql::algebra::*; use sparql::algebra::*;
use sparql::model::*; use sparql::model::*;

@ -764,11 +764,11 @@ impl<S: EncodedQuadsStore> Graph for StoreUnionGraph<S> {
)?.any(|_| true)) )?.any(|_| true))
} }
fn insert(&self, triple: &Triple) -> Result<()> { fn insert(&self, _triple: &Triple) -> Result<()> {
Err("Union graph is not writable".into()) Err("Union graph is not writable".into())
} }
fn remove(&self, triple: &Triple) -> Result<()> { fn remove(&self, _triple: &Triple) -> Result<()> {
Err("Union graph is not writable".into()) Err("Union graph is not writable".into())
} }

Loading…
Cancel
Save