From edd6b3eb496f6e2544ed78fe307f69088ed100fb Mon Sep 17 00:00:00 2001 From: Rock070 Date: Fri, 5 Jan 2024 00:28:18 +0800 Subject: [PATCH] Refactor struct Book to use lifetimes --- exercises/16_lifetimes/lifetimes3.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/exercises/16_lifetimes/lifetimes3.rs b/exercises/16_lifetimes/lifetimes3.rs index 9c59f9c0..aede10de 100644 --- a/exercises/16_lifetimes/lifetimes3.rs +++ b/exercises/16_lifetimes/lifetimes3.rs @@ -5,11 +5,9 @@ // Execute `rustlings hint lifetimes3` or use the `hint` watch subcommand for a // hint. -// I AM NOT DONE - -struct Book { - author: &str, - title: &str, +struct Book<'a> { + author: &'a str, + title: &'a str, } fn main() {