mirror of
https://git.aramjonghu.dev/AramJonghu/rustlings.git
synced 2026-09-10 19:43:32 +02:00
Clean up and unify exercises
This commit is contained in:
@@ -1,12 +1,7 @@
|
||||
// lifetimes1.rs
|
||||
//
|
||||
// The Rust compiler needs to know how to check whether supplied references are
|
||||
// valid, so that it can let the programmer know if a reference is at risk of
|
||||
// going out of scope before it is used. Remember, references are borrows and do
|
||||
// not own their own data. What if their owner goes out of scope?
|
||||
//
|
||||
// Execute `rustlings hint lifetimes1` or use the `hint` watch subcommand for a
|
||||
// hint.
|
||||
|
||||
fn longest(x: &str, y: &str) -> &str {
|
||||
if x.len() > y.len() {
|
||||
|
||||
Reference in New Issue
Block a user