Refactor struct Book to use lifetimes

This commit is contained in:
Rock070 2024-01-05 00:28:18 +08:00
parent 2432fde73d
commit edd6b3eb49

View File

@ -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() {