Skip to content

Commit

Permalink
Use format
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil committed Dec 3, 2024
1 parent af62459 commit 2d66a9d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions compiler-cli/src/hex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,18 @@ pub fn revert(package: Option<String>, version: Option<String>) -> Result<()> {
(Some(pkg), Some(ver)) => (pkg, ver),
(None, Some(ver)) => (crate::config::root_config()?.name.to_string(), ver),
(Some(pkg), None) => {
let query = "Which version of package ".to_string() + &pkg + " do you want to revert?";
let query = format!("Which version of package {pkg} do you want to revert?");
let ver = cli::ask(&query)?;
(pkg, ver)
}
(None, None) => {
// Only want to access root_config once rather than twice
let config = crate::config::root_config()?;

(config.name.to_string(), config.version.to_string())
}
};

let question = "Do you wish to revert ".to_string() + &package + " version " + &version + "?";
let question = format!("Do you wish to revert {package} version {version}?");
if !cli::confirm(&question)? {
println!("Not reverting.");
return Ok(());
Expand Down

0 comments on commit 2d66a9d

Please sign in to comment.