difftreelog
style fix clippy warnings
in: master
5 files changed
crates/jrsonnet-evaluator/src/lib.rsdiffbeforeafterboth596 }596 }597 pub fn add_tla_code(&self, name: IStr, code: &str) -> Result<()> {597 pub fn add_tla_code(&self, name: IStr, code: &str) -> Result<()> {598 let source_name = format!("<top-level-arg:{}>", name);598 let source_name = format!("<top-level-arg:{}>", name);599 let source = Source::new_virtual(Cow::Owned(source_name.clone()), code.into());599 let source = Source::new_virtual(Cow::Owned(source_name), code.into());600 let parsed = jrsonnet_parser::parse(600 let parsed = jrsonnet_parser::parse(601 code,601 code,602 &ParserSettings {602 &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.rsdiffbeforeafterboth24 let dest_path = Path::new(&out_dir).join("stdlib.rs");24 let dest_path = Path::new(&out_dir).join("stdlib.rs");25 let mut f = File::create(&dest_path).unwrap();25 let mut f = File::create(&dest_path).unwrap();26 f.write_all(v.to_string().replace(';', ";\n").as_bytes())26 f.write_all(27 ("#[allow(clippy::redundant_clone)]".to_owned() + &v.to_string())28 .replace(';', ";\n")29 .as_bytes(),30 )crates/jrsonnet-stdlib/src/expr.rsdiffbeforeafterboth1use jrsonnet_parser::LocExpr;1use jrsonnet_parser::LocExpr;223mod 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};556 pub(super) use jrsonnet_parser::*;6 pub(super) use jrsonnet_parser::*;7 pub(super) use vec;8 pub(super) use Option;9}7}10811pub fn stdlib_expr() -> LocExpr {9pub 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,