From a5570135141fbb3a26a4bc39aa09812e09ea2756 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Sat, 15 May 2021 09:27:13 -0400 Subject: [PATCH] remove some unneeded lifetime parameters Makes the compiler example read better. --- examples/compiler/compiler.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/compiler/compiler.rs b/examples/compiler/compiler.rs index 319cc241..f0d5592a 100644 --- a/examples/compiler/compiler.rs +++ b/examples/compiler/compiler.rs @@ -28,7 +28,7 @@ pub trait Compiler: Interner { /// dolor,sit,amet, /// consectetur,adipiscing,elit /// ``` -fn all_classes<'d>(db: &(dyn Compiler + 'd)) -> Arc> { +fn all_classes(db: &dyn Compiler) -> Arc> { let string = db.input_string(); let rows = string.split('\n'); @@ -53,13 +53,13 @@ fn all_classes<'d>(db: &(dyn Compiler + 'd)) -> Arc> { Arc::new(classes) } -fn fields<'d>(db: &(dyn Compiler + 'd), class: Class) -> Arc> { +fn fields(db: &dyn Compiler, class: Class) -> Arc> { let class = db.lookup_intern_class(class); let fields = class.fields.clone(); Arc::new(fields) } -fn all_fields<'d>(db: &(dyn Compiler + 'd)) -> Arc> { +fn all_fields(db: &dyn Compiler) -> Arc> { Arc::new( db.all_classes() .iter()