diff options
| author | mo8it <mo8it@proton.me> | 2024-04-17 23:34:27 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-04-17 23:34:27 +0200 |
| commit | 2f810a4da67233716ad93e00afff6e8b260f4807 (patch) | |
| tree | f5a33357141d25d08b6726910efe33f2338b9cdb /exercises/16_lifetimes/lifetimes3.rs | |
| parent | cb9f1ac9ce3c834b0cca964b6809b74508f80b54 (diff) | |
Clean up and unify exercises
Diffstat (limited to 'exercises/16_lifetimes/lifetimes3.rs')
| -rw-r--r-- | exercises/16_lifetimes/lifetimes3.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/exercises/16_lifetimes/lifetimes3.rs b/exercises/16_lifetimes/lifetimes3.rs index de6005e..9b631ca 100644 --- a/exercises/16_lifetimes/lifetimes3.rs +++ b/exercises/16_lifetimes/lifetimes3.rs @@ -1,9 +1,4 @@ -// lifetimes3.rs -// // Lifetimes are also needed when structs hold references. -// -// Execute `rustlings hint lifetimes3` or use the `hint` watch subcommand for a -// hint. struct Book { author: &str, @@ -13,7 +8,10 @@ struct Book { fn main() { let name = String::from("Jill Smith"); let title = String::from("Fish Flying"); - let book = Book { author: &name, title: &title }; + let book = Book { + author: &name, + title: &title, + }; println!("{} by {}", book.title, book.author); } |
