Skip to content

Commit ebe5ff4

Browse files
committed
tree-wide: Use inline format! args in most places
I find this easier to read. Signed-off-by: Colin Walters <walters@verbum.org>
1 parent 5494d84 commit ebe5ff4

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ fn generate_man_page<P: AsRef<Path>>(outdir: P, command: &str) -> io::Result<()>
3838
}
3939

4040
let outdir = outdir.as_ref();
41-
let outfile = outdir.join(format!("{}.1", command));
41+
let outfile = outdir.join(format!("{command}.1"));
4242
let cwd = env::current_dir()?;
43-
let txt_path = cwd.join("docs").join(format!("{}.1.txt", command));
43+
let txt_path = cwd.join("docs").join(format!("{command}.1.txt"));
4444

4545
let result = process::Command::new("asciidoctor")
4646
.arg("--doctype")

src/commands/start.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ fn map_volumes(_ctx: u32, vmcfg: &VmConfig, rootfs: &str) {
100100
fn map_volumes(ctx: u32, vmcfg: &VmConfig, rootfs: &str) {
101101
let mut volumes = Vec::new();
102102
for (host_path, guest_path) in vmcfg.mapped_volumes.iter() {
103-
let full_guest = format!("{}{}", &rootfs, guest_path);
103+
let full_guest = format!("{rootfs}{guest_path}");
104104
let full_guest_path = Path::new(&full_guest);
105105
if !full_guest_path.exists() {
106106
std::fs::create_dir(full_guest_path)
@@ -218,7 +218,7 @@ fn set_rlimits() {
218218
}
219219

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

224224
let ret = unsafe { libc::flock(file.as_raw_fd(), libc::LOCK_EX | libc::LOCK_NB) };

src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ pub fn get_buildah_args(cfg: &KrunvmConfig, cmd: BuildahCommand) -> Vec<String>
3333
hbpath.pop();
3434
hbpath.pop();
3535
let hbpath = hbpath.as_path().display();
36-
let policy_json = format!("{}/etc/containers/policy.json", hbpath);
37-
let registries_json = format!("{}/etc/containers/registries.conf", hbpath);
36+
let policy_json = format!("{hbpath}/etc/containers/policy.json");
37+
let registries_json = format!("{hbpath}/etc/containers/registries.conf");
3838
let storage_root = format!("{}/root", cfg.storage_volume);
3939
let storage_runroot = format!("{}/runroot", cfg.storage_volume);
4040

0 commit comments

Comments
 (0)