Enables some extra Clippy lints

pull/543/head
Tpt 2 years ago
parent c016116b09
commit a8abf26913
  1. 24
      .cargo/config.toml
  2. 6
      js/src/model.rs
  3. 2
      lib/oxrdf/src/blank_node.rs
  4. 2
      lib/oxrdf/src/interning.rs
  5. 2
      lib/oxrdf/src/variable.rs
  6. 2
      lib/src/sparql/http/dummy.rs

@ -5,8 +5,8 @@ rustflags = [
"-Wunsafe-code", "-Wunsafe-code",
"-Wunused-lifetimes", "-Wunused-lifetimes",
"-Wunused-qualifications", "-Wunused-qualifications",
# TODO: 1.63+ "-Wclippy::as-underscore", "-Wclippy::as-underscore",
# TODO: 1.65+ ""-Wclippy::bool-to-int-with-if", "-Wclippy::bool-to-int-with-if",
"-Wclippy::borrow-as-ptr", "-Wclippy::borrow-as-ptr",
"-Wclippy::case-sensitive-file-extension-comparisons", "-Wclippy::case-sensitive-file-extension-comparisons",
"-Wclippy::cast-lossless", "-Wclippy::cast-lossless",
@ -23,11 +23,11 @@ rustflags = [
"-Wclippy::decimal-literal-representation", "-Wclippy::decimal-literal-representation",
"-Wclippy::default-trait-access", "-Wclippy::default-trait-access",
"-Wclippy::default-union-representation", "-Wclippy::default-union-representation",
# TODO: 1.61+ "-Wclippy::deref-by-slicing", "-Wclippy::deref-by-slicing",
# TODO: 1.63+ "-Wclippy::doc-link-with-quotes", "-Wclippy::doc-link-with-quotes",
# TODO: 1.62+ "-Wclippy::empty-drop", "-Wclippy::empty-drop",
"-Wclippy::empty-enum", "-Wclippy::empty-enum",
# TODO: on major version "-Wclippy::empty-structs-with-brackets", "-Wclippy::empty-structs-with-brackets",
"-Wclippy::enum-glob-use", "-Wclippy::enum-glob-use",
"-Wclippy::exit", "-Wclippy::exit",
"-Wclippy::expect-used", "-Wclippy::expect-used",
@ -38,7 +38,7 @@ rustflags = [
"-Wclippy::filter-map-next", "-Wclippy::filter-map-next",
"-Wclippy::flat-map-option", "-Wclippy::flat-map-option",
"-Wclippy::fn-to-numeric-cast-any", "-Wclippy::fn-to-numeric-cast-any",
# TODO: 1.62+ "-Wclippy::format-push-string", "-Wclippy::format-push-string",
"-Wclippy::from-iter-instead-of-collect", "-Wclippy::from-iter-instead-of-collect",
"-Wclippy::get-unwrap", "-Wclippy::get-unwrap",
"-Wclippy::if-not-else", "-Wclippy::if-not-else",
@ -62,10 +62,10 @@ rustflags = [
"-Wclippy::lossy-float-literal", "-Wclippy::lossy-float-literal",
"-Wclippy::macro-use-imports", "-Wclippy::macro-use-imports",
"-Wclippy::manual-assert", "-Wclippy::manual-assert",
# TODO: 1.65+ "-Wclippy::manual-instant-elapsed", "-Wclippy::manual-instant-elapsed",
# TODO: 1.67+ "-Wclippy::manual-let-else", # TODO: 1.67+ "-Wclippy::manual-let-else",
"-Wclippy::manual-ok-or", "-Wclippy::manual-ok-or",
# TODO: 1.65+ "-Wclippy::manual-string-new", "-Wclippy::manual-string-new",
"-Wclippy::many-single-char-names", "-Wclippy::many-single-char-names",
"-Wclippy::map-unwrap-or", "-Wclippy::map-unwrap-or",
"-Wclippy::match-bool", "-Wclippy::match-bool",
@ -73,7 +73,7 @@ rustflags = [
"-Wclippy::match-wildcard-for-single-variants", "-Wclippy::match-wildcard-for-single-variants",
"-Wclippy::maybe-infinite-iter", "-Wclippy::maybe-infinite-iter",
"-Wclippy::mem-forget", "-Wclippy::mem-forget",
# TODO: 1.63+ "-Wclippy::mismatching-type-param-order", "-Wclippy::mismatching-type-param-order",
"-Wclippy::multiple-inherent-impl", "-Wclippy::multiple-inherent-impl",
"-Wclippy::mut-mut", "-Wclippy::mut-mut",
"-Wclippy::mutex-atomic", "-Wclippy::mutex-atomic",
@ -99,7 +99,7 @@ rustflags = [
"-Wclippy::rest-pat-in-fully-bound-structs", "-Wclippy::rest-pat-in-fully-bound-structs",
"-Wclippy::return-self-not-must-use", "-Wclippy::return-self-not-must-use",
"-Wclippy::same-functions-in-if-condition", "-Wclippy::same-functions-in-if-condition",
# TODO: strange failure on 1.60 "-Wclippy::same-name-method", "-Wclippy::same-name-method",
# TODO: 1.68+ "-Wclippy::semicolon-outside-block", # TODO: 1.68+ "-Wclippy::semicolon-outside-block",
"-Wclippy::single-match-else", "-Wclippy::single-match-else",
"-Wclippy::stable-sort-primitive", "-Wclippy::stable-sort-primitive",
@ -117,7 +117,7 @@ rustflags = [
"-Wclippy::unimplemented", "-Wclippy::unimplemented",
# TODO: 1.66+ "-Wclippy::uninlined-format-args", # TODO: 1.66+ "-Wclippy::uninlined-format-args",
# TODO: 1.70+ "-Wclippy::unnecessary-box-returns", # TODO: 1.70+ "-Wclippy::unnecessary-box-returns",
# TODO: 1.61+ "-Wclippy::unnecessary-join", "-Wclippy::unnecessary-join",
# TODO: 1.67+ "-Wclippy::unnecessary-safety-comment", # TODO: 1.67+ "-Wclippy::unnecessary-safety-comment",
# TODO: 1.67+ "-Wclippy::unnecessary-safety-doc", # TODO: 1.67+ "-Wclippy::unnecessary-safety-doc",
"-Wclippy::unnecessary-self-imports", "-Wclippy::unnecessary-self-imports",

@ -302,7 +302,7 @@ impl From<JsLiteral> for Term {
#[wasm_bindgen(js_name = DefaultGraph)] #[wasm_bindgen(js_name = DefaultGraph)]
#[derive(Eq, PartialEq, Debug, Clone, Hash)] #[derive(Eq, PartialEq, Debug, Clone, Hash)]
pub struct JsDefaultGraph {} pub struct JsDefaultGraph;
#[wasm_bindgen(js_class = DefaultGraph)] #[wasm_bindgen(js_class = DefaultGraph)]
impl JsDefaultGraph { impl JsDefaultGraph {
@ -313,7 +313,7 @@ impl JsDefaultGraph {
#[wasm_bindgen(getter)] #[wasm_bindgen(getter)]
pub fn value(&self) -> String { pub fn value(&self) -> String {
"".to_owned() String::new()
} }
#[wasm_bindgen(js_name = toString)] #[wasm_bindgen(js_name = toString)]
@ -393,7 +393,7 @@ impl JsQuad {
#[wasm_bindgen(getter)] #[wasm_bindgen(getter)]
pub fn value(&self) -> String { pub fn value(&self) -> String {
"".to_owned() String::new()
} }
#[wasm_bindgen(getter = subject)] #[wasm_bindgen(getter = subject)]

@ -343,7 +343,7 @@ fn to_integer_id(id: &str) -> Option<u128> {
/// An error raised during [`BlankNode`] IDs validation. /// An error raised during [`BlankNode`] IDs validation.
#[derive(Debug)] #[derive(Debug)]
pub struct BlankNodeIdParseError {} pub struct BlankNodeIdParseError;
impl fmt::Display for BlankNodeIdParseError { impl fmt::Display for BlankNodeIdParseError {
#[inline] #[inline]

@ -479,7 +479,7 @@ impl InternedTriple {
} }
#[derive(Default)] #[derive(Default)]
struct IdentityHasherBuilder {} struct IdentityHasherBuilder;
impl BuildHasher for IdentityHasherBuilder { impl BuildHasher for IdentityHasherBuilder {
type Hasher = IdentityHasher; type Hasher = IdentityHasher;

@ -219,7 +219,7 @@ fn validate_variable_identifier(id: &str) -> Result<(), VariableNameParseError>
/// An error raised during [`Variable`] name validation. /// An error raised during [`Variable`] name validation.
#[derive(Debug)] #[derive(Debug)]
pub struct VariableNameParseError {} pub struct VariableNameParseError;
impl fmt::Display for VariableNameParseError { impl fmt::Display for VariableNameParseError {
#[inline] #[inline]

@ -3,7 +3,7 @@
use std::io::{Empty, Error, ErrorKind, Result}; use std::io::{Empty, Error, ErrorKind, Result};
use std::time::Duration; use std::time::Duration;
pub struct Client {} pub struct Client;
impl Client { impl Client {
pub fn new(_timeout: Option<Duration>, _redirection_limit: usize) -> Self { pub fn new(_timeout: Option<Duration>, _redirection_limit: usize) -> Self {

Loading…
Cancel
Save