We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6afb633 commit d840163Copy full SHA for d840163
1 file changed
src/lib.rs
@@ -33,6 +33,6 @@ pub fn do_not_close_on_exit(fd: i32) -> Result<()> {
33
.map_err(|_| Error::new(Status::GenericFailure, "fcntl failed"))
34
}
35
36
-fn string_ref_to_c_str(string: &String) -> Result<CString> {
37
- CString::new(string.clone()).map_err(|_| Error::new(Status::GenericFailure, "Invalid string"))
+fn string_ref_to_c_str(string: &str) -> Result<CString> {
+ CString::new(string.to_owned()).map_err(|_| Error::new(Status::GenericFailure, "Invalid string"))
38
0 commit comments