git.delta.rocks / jrsonnet / refs/commits / f22b934c5088

difftreelog

style fix clippy warnings

Yaroslav Bolyukin2022-08-07parent: #aa97bc0.patch.diff
in: master

5 files changed

modifiedcrates/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 {
modifiedcrates/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],
modifiedcrates/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();
 	}
 }
modifiedcrates/jrsonnet-stdlib/src/expr.rsdiffbeforeafterboth
1use jrsonnet_parser::LocExpr;1use jrsonnet_parser::LocExpr;
22
3mod structdump_import {3mod structdump_import {
4 pub(super) use std::{borrow::Cow, rc::Rc};4 pub(super) use std::{borrow::Cow, option::Option, rc::Rc, vec};
55
6 pub(super) use jrsonnet_parser::*;6 pub(super) use jrsonnet_parser::*;
7 pub(super) use vec;
8 pub(super) use Option;
9}7}
108
11pub fn stdlib_expr() -> LocExpr {9pub fn stdlib_expr() -> LocExpr {
modifiedcrates/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,