Skip to content

Commit

Permalink
tree-wide: Use inline format! args in most places
Browse files Browse the repository at this point in the history
I find this easier to read.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Feb 28, 2024
1 parent 5494d84 commit ebe5ff4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ fn generate_man_page<P: AsRef<Path>>(outdir: P, command: &str) -> io::Result<()>
}

let outdir = outdir.as_ref();
let outfile = outdir.join(format!("{}.1", command));
let outfile = outdir.join(format!("{command}.1"));
let cwd = env::current_dir()?;
let txt_path = cwd.join("docs").join(format!("{}.1.txt", command));
let txt_path = cwd.join("docs").join(format!("{command}.1.txt"));

let result = process::Command::new("asciidoctor")
.arg("--doctype")
Expand Down
4 changes: 2 additions & 2 deletions src/commands/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fn map_volumes(_ctx: u32, vmcfg: &VmConfig, rootfs: &str) {
fn map_volumes(ctx: u32, vmcfg: &VmConfig, rootfs: &str) {
let mut volumes = Vec::new();
for (host_path, guest_path) in vmcfg.mapped_volumes.iter() {
let full_guest = format!("{}{}", &rootfs, guest_path);
let full_guest = format!("{rootfs}{guest_path}");
let full_guest_path = Path::new(&full_guest);
if !full_guest_path.exists() {
std::fs::create_dir(full_guest_path)
Expand Down Expand Up @@ -218,7 +218,7 @@ fn set_rlimits() {
}

fn set_lock(rootfs: &str) -> File {
let lock_path = format!("{}/.krunvm.lock", rootfs);
let lock_path = format!("{rootfs}/.krunvm.lock");
let file = File::create(lock_path).expect("Couldn't create lock file");

let ret = unsafe { libc::flock(file.as_raw_fd(), libc::LOCK_EX | libc::LOCK_NB) };
Expand Down
4 changes: 2 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ pub fn get_buildah_args(cfg: &KrunvmConfig, cmd: BuildahCommand) -> Vec<String>
hbpath.pop();
hbpath.pop();
let hbpath = hbpath.as_path().display();
let policy_json = format!("{}/etc/containers/policy.json", hbpath);
let registries_json = format!("{}/etc/containers/registries.conf", hbpath);
let policy_json = format!("{hbpath}/etc/containers/policy.json");
let registries_json = format!("{hbpath}/etc/containers/registries.conf");
let storage_root = format!("{}/root", cfg.storage_volume);
let storage_runroot = format!("{}/runroot", cfg.storage_volume);

Expand Down

0 comments on commit ebe5ff4

Please sign in to comment.