difftreelog
style fix clippy warnings
in: master
5 files changed
crates/jrsonnet-evaluator/src/lib.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/lib.rs
+++ b/crates/jrsonnet-evaluator/src/lib.rs
@@ -596,7 +596,7 @@
}
pub fn add_tla_code(&self, name: IStr, code: &str) -> Result<()> {
let source_name = format!("<top-level-arg:{}>", name);
- let source = Source::new_virtual(Cow::Owned(source_name.clone()), code.into());
+ let source = Source::new_virtual(Cow::Owned(source_name), code.into());
let parsed = jrsonnet_parser::parse(
code,
&ParserSettings {
crates/jrsonnet-evaluator/src/trace/mod.rsdiffbeforeafterboth237 let start_end = source.0.map_source_locations(&[source.1, source.2]);237 let start_end = source.0.map_source_locations(&[source.1, source.2]);238 self.print_snippet(238 self.print_snippet(239 out,239 out,240 &source.0.code(),240 source.0.code(),241 &source.0,241 &source.0,242 &start_end[0],242 &start_end[0],243 &start_end[1],243 &start_end[1],crates/jrsonnet-stdlib/build.rsdiffbeforeafterboth--- a/crates/jrsonnet-stdlib/build.rs
+++ b/crates/jrsonnet-stdlib/build.rs
@@ -23,7 +23,11 @@
let out_dir = env::var("OUT_DIR").unwrap();
let dest_path = Path::new(&out_dir).join("stdlib.rs");
let mut f = File::create(&dest_path).unwrap();
- f.write_all(v.to_string().replace(';', ";\n").as_bytes())
- .unwrap();
+ f.write_all(
+ ("#[allow(clippy::redundant_clone)]".to_owned() + &v.to_string())
+ .replace(';', ";\n")
+ .as_bytes(),
+ )
+ .unwrap();
}
}
crates/jrsonnet-stdlib/src/expr.rsdiffbeforeafterboth--- a/crates/jrsonnet-stdlib/src/expr.rs
+++ b/crates/jrsonnet-stdlib/src/expr.rs
@@ -1,11 +1,9 @@
use jrsonnet_parser::LocExpr;
mod structdump_import {
- pub(super) use std::{borrow::Cow, rc::Rc};
+ pub(super) use std::{borrow::Cow, option::Option, rc::Rc, vec};
pub(super) use jrsonnet_parser::*;
- pub(super) use vec;
- pub(super) use Option;
}
pub fn stdlib_expr() -> LocExpr {
crates/jrsonnet-stdlib/src/lib.rsdiffbeforeafterboth--- a/crates/jrsonnet-stdlib/src/lib.rs
+++ b/crates/jrsonnet-stdlib/src/lib.rs
@@ -465,6 +465,7 @@
Ok(out.into())
}
+#[allow(clippy::comparison_chain)]
#[builtin]
fn builtin_starts_with(
s: State,
@@ -497,6 +498,7 @@
})
}
+#[allow(clippy::comparison_chain)]
#[builtin]
fn builtin_ends_with(
s: State,