Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- let a = "a".to_string();
- let a_ref = &a;
- let b_ref;
- let g_ref;
- // let h_ref;
- // let i_ref;
- // let j_ref;
- {
- let b = "b".to_string();
- b_ref = &b;
- let (c_ref, _d_ref) = return_tuple(a_ref, b_ref);
- g_ref = c_ref;
- // h_ref = d_ref;
- // let (x_ref, y_ref) = return_tuple_strict(a_ref, b_ref);
- // i_ref = x_ref;
- // j_ref = y_ref;
- }
- println!("{}", g_ref);
- // println!("{}", h_ref);
- // println!("{}", i_ref);
- // println!("{}", j_ref);
- }
- fn return_tuple<'a, 'b>(a: &'a str, b: &'b str) -> (&'a str, &'b str) {
- (a, b)
- }
- fn return_tuple_strict<'a>(a: &'a str, b: &'a str) -> (&'a str, &'a str) {
- (a, b)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement