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.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/trace/mod.rs
+++ b/crates/jrsonnet-evaluator/src/trace/mod.rs
@@ -237,7 +237,7 @@
let start_end = source.0.map_source_locations(&[source.1, source.2]);
self.print_snippet(
out,
- &source.0.code(),
+ source.0.code(),
&source.0,
&start_end[0],
&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.rsdiffbeforeafterboth465 Ok(out.into())465 Ok(out.into())466}466}467467468#[allow(clippy::comparison_chain)]468#[builtin]469#[builtin]469fn builtin_starts_with(470fn builtin_starts_with(470 s: State,471 s: State,497 })498 })498}499}499500501#[allow(clippy::comparison_chain)]500#[builtin]502#[builtin]501fn builtin_ends_with(503fn builtin_ends_with(502 s: State,504 s: State,