Skip to content

Commit e71fb81

Browse files
committed
const ORIGINAL_MANIFEST_FILE: &str = "Cargo.toml.orig";
1 parent 4242406 commit e71fb81

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/cargo/ops/cargo_package.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ pub struct PackageOpts<'cfg> {
3636
pub cli_features: CliFeatures,
3737
}
3838

39+
const ORIGINAL_MANIFEST_FILE: &str = "Cargo.toml.orig";
3940
const VCS_INFO_FILE: &str = ".cargo_vcs_info.json";
4041

4142
struct ArchiveFile {
@@ -219,8 +220,8 @@ fn build_ar_list(
219220
match rel_str.as_ref() {
220221
"Cargo.toml" => {
221222
result.push(ArchiveFile {
222-
rel_path: PathBuf::from("Cargo.toml.orig"),
223-
rel_str: "Cargo.toml.orig".to_string(),
223+
rel_path: PathBuf::from(ORIGINAL_MANIFEST_FILE),
224+
rel_str: ORIGINAL_MANIFEST_FILE.to_string(),
224225
contents: FileContents::OnDisk(src_file),
225226
});
226227
result.push(ArchiveFile {
@@ -230,9 +231,8 @@ fn build_ar_list(
230231
});
231232
}
232233
"Cargo.lock" => continue,
233-
VCS_INFO_FILE | "Cargo.toml.orig" => anyhow::bail!(
234-
"invalid inclusion of reserved file name \
235-
{} in package source",
234+
VCS_INFO_FILE | ORIGINAL_MANIFEST_FILE => anyhow::bail!(
235+
"invalid inclusion of reserved file name {} in package source",
236236
rel_str
237237
),
238238
_ => {

0 commit comments

Comments
 (0)