1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution.
4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except according to those terms.
10 #![warn(clippy::redundant_clone)]
12 use std::ffi::OsString;
16 let _ = ["lorem", "ipsum"].join(" ").to_string();
18 let s = String::from("foo");
21 let s = String::from("foo");
22 let _ = s.to_string();
24 let s = String::from("foo");
27 let _ = Path::new("/a/b/").join("c").to_owned();
29 let _ = Path::new("/a/b/").join("c").to_path_buf();
31 let _ = OsString::new().to_owned();
33 let _ = OsString::new().to_os_string();
35 // Check that lint level works
36 #[allow(clippy::redundant_clone)]
37 let _ = String::new().to_string();
42 fn double(a: Alpha) -> (Alpha, Alpha) {
44 (a.clone(), a.clone())