Skip to content

Commit 93c9cee

Browse files
committed
Use clone_from/clone_into
1 parent a3e322d commit 93c9cee

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ readme = "README.md"
99
repository = "https://github.com/lu-zero/cargo-c"
1010
categories = ["command-line-utilities", "development-tools::cargo-plugins"]
1111
keywords = ["cargo", "cdylib"]
12-
rust-version = "1.75"
12+
rust-version = "1.76"
1313

1414
[[bin]]
1515
name = "cargo-capi"

src/pkg_config_gen.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ impl PkgConfig {
129129
) -> Self {
130130
let mut pc = PkgConfig::new(name, capi_config);
131131

132-
pc.prefix = install_paths.prefix.clone();
132+
pc.prefix.clone_from(&install_paths.prefix);
133133
// TODO: support exec_prefix
134134
if args.contains_id("includedir") {
135135
if let Ok(suffix) = install_paths.includedir.strip_prefix(&pc.prefix) {
136136
let mut includedir = PathBuf::from("${prefix}");
137137
includedir.push(suffix);
138138
pc.includedir = includedir;
139139
} else {
140-
pc.includedir = install_paths.includedir.clone();
140+
pc.includedir.clone_from(&install_paths.includedir);
141141
}
142142
}
143143
if args.contains_id("libdir") {
@@ -146,7 +146,7 @@ impl PkgConfig {
146146
libdir.push(suffix);
147147
pc.libdir = libdir;
148148
} else {
149-
pc.libdir = install_paths.libdir.clone();
149+
pc.libdir.clone_from(&install_paths.libdir);
150150
}
151151
}
152152
pc
@@ -164,7 +164,7 @@ impl PkgConfig {
164164
}
165165

166166
pub fn set_description<S: AsRef<str>>(&mut self, descr: S) -> &mut Self {
167-
self.description = descr.as_ref().to_owned();
167+
descr.as_ref().clone_into(&mut self.description);
168168
self
169169
}
170170

0 commit comments

Comments
 (0)