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 // Execute `rustlings hint lifetimes3` or use the `hint` watch subcommand for a
// hint. // hint.
// I AM NOT DONE struct Book<'a> {
author: &'a str,
struct Book { title: &'a str,
author: &str,
title: &str,
} }
fn main() { fn main() {