Lifetime1 [Rust] Lifetime 예제 (25일차) fn longest y.len() { x } else { y } } fn main() { let string1 = String::from("abcd"); let string2 = "xyz"; let result = longest(string1.as_str(), string2); println!("The longest string is {}", result); } https://rinthel.github.io/rust-lang-book-ko/ch10-03-lifetime-syntax.html 2023. 1. 7. 이전 1 다음