mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
refactor(embedded): Clarify a variable name
This commit is contained in:
parent
6e90f0ef6e
commit
4638ef9d2b
@ -59,10 +59,11 @@ fn expand_manifest_(
|
|||||||
anyhow::bail!("`package.{key}` is not allowed in embedded manifests")
|
anyhow::bail!("`package.{key}` is not allowed in embedded manifests")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let file_name = path
|
let bin_path = path
|
||||||
.file_name()
|
.file_name()
|
||||||
.ok_or_else(|| anyhow::format_err!("no file name"))?
|
.ok_or_else(|| anyhow::format_err!("no file name"))?
|
||||||
.to_string_lossy();
|
.to_string_lossy()
|
||||||
|
.into_owned();
|
||||||
let file_stem = path
|
let file_stem = path
|
||||||
.file_stem()
|
.file_stem()
|
||||||
.ok_or_else(|| anyhow::format_err!("no file name"))?
|
.ok_or_else(|| anyhow::format_err!("no file name"))?
|
||||||
@ -96,10 +97,7 @@ fn expand_manifest_(
|
|||||||
|
|
||||||
let mut bin = toml::Table::new();
|
let mut bin = toml::Table::new();
|
||||||
bin.insert("name".to_owned(), toml::Value::String(bin_name));
|
bin.insert("name".to_owned(), toml::Value::String(bin_name));
|
||||||
bin.insert(
|
bin.insert("path".to_owned(), toml::Value::String(bin_path));
|
||||||
"path".to_owned(),
|
|
||||||
toml::Value::String(file_name.into_owned()),
|
|
||||||
);
|
|
||||||
manifest.insert(
|
manifest.insert(
|
||||||
"bin".to_owned(),
|
"bin".to_owned(),
|
||||||
toml::Value::Array(vec![toml::Value::Table(bin)]),
|
toml::Value::Array(vec![toml::Value::Table(bin)]),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user