Skip to content

Commit

Permalink
refactor(embedded): Clarify a variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Sep 18, 2023
1 parent 12fe9db commit f8b132d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/cargo/util/toml/embedded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ fn expand_manifest_(
anyhow::bail!("`package.{key}` is not allowed in embedded manifests")
}
}
let file_name = path
let bin_path = path
.file_name()
.ok_or_else(|| anyhow::format_err!("no file name"))?
.to_string_lossy();
.to_string_lossy()
.into_owned();
let file_stem = path
.file_stem()
.ok_or_else(|| anyhow::format_err!("no file name"))?
Expand Down Expand Up @@ -96,10 +97,7 @@ fn expand_manifest_(

let mut bin = toml::Table::new();
bin.insert("name".to_owned(), toml::Value::String(bin_name));
bin.insert(
"path".to_owned(),
toml::Value::String(file_name.into_owned()),
);
bin.insert("path".to_owned(), toml::Value::String(bin_path));
manifest.insert(
"bin".to_owned(),
toml::Value::Array(vec![toml::Value::Table(bin)]),
Expand Down

0 comments on commit f8b132d

Please sign in to comment.