Collected all clippy warnings and fixed 2
https://rust-lang.github.io/rust-clippy/master/index.html#inefficient_to_string https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants Please change `allow` -> `deny` ub src/lib.rs to see other warnings. I feel some of them are important
This commit is contained in:
parent
c999dd26dd
commit
8b5de7db6a
|
@ -201,7 +201,7 @@ impl<'a> QueryPathNode<'a> {
|
|||
let mut res = Vec::new();
|
||||
self.for_each(|s| {
|
||||
res.push(match s {
|
||||
QueryPathSegment::Name(name) => name.to_string(),
|
||||
QueryPathSegment::Name(name) => (*name).to_string(),
|
||||
QueryPathSegment::Index(idx) => idx.to_string(),
|
||||
});
|
||||
});
|
||||
|
|
|
@ -553,7 +553,7 @@ pub fn playground_source(config: GraphQLPlaygroundConfig) -> String {
|
|||
</html>
|
||||
"##.replace("GRAPHQL_PLAYGROUND_CONFIG", &match serde_json::to_string(&config) {
|
||||
Ok(str) => str,
|
||||
_ => "{}".to_string()
|
||||
Err(_) => "{}".to_string()
|
||||
})
|
||||
}
|
||||
|
||||
|
|
34
src/lib.rs
34
src/lib.rs
|
@ -113,6 +113,40 @@
|
|||
//! Now a HTML report is available at `benchmark/target/criterion/report`.
|
||||
//!
|
||||
|
||||
#![deny(clippy::all)]
|
||||
// #![deny(clippy::pedantic)]
|
||||
#![deny(clippy::inefficient_to_string)]
|
||||
#![deny(clippy::match_wildcard_for_single_variants)]
|
||||
#![allow(clippy::module_name_repetitions)]
|
||||
#![allow(clippy::similar_names)]
|
||||
#![allow(clippy::if_not_else)]
|
||||
#![allow(clippy::doc_markdown)]
|
||||
#![allow(clippy::must_use_candidate)]
|
||||
#![allow(clippy::missing_errors_doc)]
|
||||
#![allow(clippy::needless_pass_by_value)]
|
||||
#![allow(clippy::redundant_closure_for_method_calls)]
|
||||
#![allow(clippy::option_if_let_else)]
|
||||
#![allow(clippy::match_same_arms)]
|
||||
#![allow(clippy::filter_map)]
|
||||
#![allow(clippy::default_trait_access)]
|
||||
#![allow(clippy::map_flatten)]
|
||||
#![allow(clippy::map_unwrap_or)]
|
||||
#![allow(clippy::explicit_iter_loop)]
|
||||
#![allow(clippy::too_many_lines)]
|
||||
#![allow(clippy::cast_sign_loss)]
|
||||
#![allow(clippy::unused_self)]
|
||||
#![allow(clippy::find_map)]
|
||||
#![allow(clippy::cast_lossless)]
|
||||
#![allow(clippy::cast_possible_truncation)]
|
||||
#![allow(clippy::implicit_hasher)]
|
||||
// #![deny(clippy::nursery)]
|
||||
#![allow(clippy::use_self)]
|
||||
#![allow(clippy::missing_const_for_fn)]
|
||||
#![allow(clippy::needless_borrow)]
|
||||
#![allow(clippy::future_not_send)]
|
||||
#![allow(clippy::redundant_pub_crate)]
|
||||
#![allow(clippy::cognitive_complexity)]
|
||||
#![allow(clippy::useless_let_if_seq)]
|
||||
#![warn(missing_docs)]
|
||||
#![allow(clippy::trivially_copy_pass_by_ref)]
|
||||
#![recursion_limit = "256"]
|
||||
|
|
Loading…
Reference in New Issue
Block a user