From 177bb682b8c3a8b851d0908e070909edff4dd04b Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Thu, 28 Dec 2023 19:16:46 -0800 Subject: [PATCH] Use Self (#1795) --- src/assignment_resolver.rs | 4 ++-- src/evaluator.rs | 6 +++--- src/recipe_resolver.rs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/assignment_resolver.rs b/src/assignment_resolver.rs index 68ff2a2..72d825f 100644 --- a/src/assignment_resolver.rs +++ b/src/assignment_resolver.rs @@ -8,9 +8,9 @@ pub(crate) struct AssignmentResolver<'src: 'run, 'run> { impl<'src: 'run, 'run> AssignmentResolver<'src, 'run> { pub(crate) fn resolve_assignments( - assignments: &Table<'src, Assignment<'src>>, + assignments: &'run Table<'src, Assignment<'src>>, ) -> CompileResult<'src, ()> { - let mut resolver = AssignmentResolver { + let mut resolver = Self { stack: Vec::new(), evaluated: BTreeSet::new(), assignments, diff --git a/src/evaluator.rs b/src/evaluator.rs index ac70f6b..067d0b4 100644 --- a/src/evaluator.rs +++ b/src/evaluator.rs @@ -18,7 +18,7 @@ impl<'src, 'run> Evaluator<'src, 'run> { settings: &'run Settings<'run>, search: &'run Search, ) -> RunResult<'src, Scope<'src, 'run>> { - let mut evaluator = Evaluator { + let mut evaluator = Self { scope: overrides, assignments: Some(assignments), config, @@ -260,7 +260,7 @@ impl<'src, 'run> Evaluator<'src, 'run> { settings: &'run Settings, search: &'run Search, ) -> RunResult<'src, (Scope<'src, 'run>, Vec)> { - let mut evaluator = Evaluator { + let mut evaluator = Self { assignments: None, scope: scope.child(), search, @@ -313,7 +313,7 @@ impl<'src, 'run> Evaluator<'src, 'run> { settings: &'run Settings, search: &'run Search, ) -> Evaluator<'src, 'run> { - Evaluator { + Self { assignments: None, scope: Scope::child(scope), search, diff --git a/src/recipe_resolver.rs b/src/recipe_resolver.rs index 2715acc..b89c7c6 100644 --- a/src/recipe_resolver.rs +++ b/src/recipe_resolver.rs @@ -9,9 +9,9 @@ pub(crate) struct RecipeResolver<'src: 'run, 'run> { impl<'src: 'run, 'run> RecipeResolver<'src, 'run> { pub(crate) fn resolve_recipes( unresolved_recipes: Table<'src, UnresolvedRecipe<'src>>, - assignments: &Table<'src, Assignment<'src>>, + assignments: &'run Table<'src, Assignment<'src>>, ) -> CompileResult<'src, Table<'src, Rc>>> { - let mut resolver = RecipeResolver { + let mut resolver = Self { resolved_recipes: Table::new(), unresolved_recipes, assignments,