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
596 }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 {
modifiedcrates/jrsonnet-evaluator/src/trace/mod.rsdiffbeforeafterboth
237 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],
modifiedcrates/jrsonnet-stdlib/build.rsdiffbeforeafterboth
24 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 )
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
465 Ok(out.into())465 Ok(out.into())
466}466}
467467
468#[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}
499500
501#[allow(clippy::comparison_chain)]
500#[builtin]502#[builtin]
501fn builtin_ends_with(503fn builtin_ends_with(
502 s: State,504 s: State,