git.delta.rocks / jrsonnet / refs/commits / 6b07ec04fd46

difftreelog

style fix clippy warnings

Yaroslav Bolyukin2021-04-30parent: #1656c74.patch.diff
in: master

5 files changed

modifiedcrates/jrsonnet-evaluator/src/ctx.rsdiffbeforeafterboth
38#[derive(Debug, Clone)]38#[derive(Debug, Clone)]
39pub struct Context(Rc<ContextInternals>);39pub struct Context(Rc<ContextInternals>);
40impl Context {40impl Context {
41 pub fn new_future() -> FutureWrapper<Context> {41 pub fn new_future() -> FutureWrapper<Self> {
42 FutureWrapper::new()42 FutureWrapper::new()
43 }43 }
4444
71 .cloned()71 .cloned()
72 .ok_or(VariableIsNotDefined(name))?)72 .ok_or(VariableIsNotDefined(name))?)
73 }73 }
74 pub fn into_future(self, ctx: FutureWrapper<Context>) -> Self {74 pub fn into_future(self, ctx: FutureWrapper<Self>) -> Self {
75 {75 {
76 ctx.0.borrow_mut().replace(self);76 ctx.0.borrow_mut().replace(self);
77 }77 }
modifiedcrates/jrsonnet-evaluator/src/lib.rsdiffbeforeafterboth
1#![cfg_attr(feature = "unstable", feature(stmt_expr_attributes))]1#![cfg_attr(feature = "unstable", feature(stmt_expr_attributes))]
2#![allow(macro_expanded_macro_exports_accessed_by_absolute_paths)]
3#![warn(clippy::all, clippy::nursery)]2#![warn(clippy::all, clippy::nursery)]
3#![allow(macro_expanded_macro_exports_accessed_by_absolute_paths, clippy::ptr_arg)]
44
5mod builtin;5mod builtin;
6mod ctx;6mod ctx;
429 }429 }
430430
431 pub fn resolve_file(&self, from: &PathBuf, path: &PathBuf) -> Result<Rc<PathBuf>> {431 pub fn resolve_file(&self, from: &PathBuf, path: &PathBuf) -> Result<Rc<PathBuf>> {
432 Ok(self.settings().import_resolver.resolve_file(from, path)?)432 self.settings().import_resolver.resolve_file(from, path)
433 }433 }
434 pub fn load_file_contents(&self, path: &PathBuf) -> Result<IStr> {434 pub fn load_file_contents(&self, path: &PathBuf) -> Result<IStr> {
435 self.settings().import_resolver.load_file_contents(path)435 self.settings().import_resolver.load_file_contents(path)
modifiedcrates/jrsonnet-evaluator/src/obj.rsdiffbeforeafterboth
173 pub fn extend_with_field(self, key: IStr, value: ObjMember) -> Self {173 pub fn extend_with_field(self, key: IStr, value: ObjMember) -> Self {
174 let mut new = FxHashMap::with_capacity_and_hasher(1, BuildHasherDefault::default());174 let mut new = FxHashMap::with_capacity_and_hasher(1, BuildHasherDefault::default());
175 new.insert(key, value);175 new.insert(key, value);
176 ObjValue::new(Some(self), Rc::new(new))176 Self::new(Some(self), Rc::new(new))
177 }177 }
178178
179 pub(crate) fn get_raw(&self, key: IStr, real_this: Option<&Self>) -> Result<Option<Val>> {179 pub(crate) fn get_raw(&self, key: IStr, real_this: Option<&Self>) -> Result<Option<Val>> {
modifiedcrates/jrsonnet-parser/src/lib.rsdiffbeforeafterboth
1#![allow(clippy::redundant_closure_call)]
2
1use peg::parser;3use peg::parser;
2use std::{path::PathBuf, rc::Rc};4use std::{path::PathBuf, rc::Rc};
modifiedcrates/jrsonnet-types/src/lib.rsdiffbeforeafterboth
1#![allow(clippy::redundant_closure_call)]
2
1use std::fmt::Display;3use std::fmt::Display;
24