Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tree-wide: Use inline format! args in most places #59

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading