Skip to content

Commit 6b0dd81

Browse files
committed
chore: cargo fmt
Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
1 parent cef2016 commit 6b0dd81

2 files changed

Lines changed: 12 additions & 13 deletions

File tree

src/mount.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,7 @@ pub fn move_mount_fd_to(fd: &OwnedFd, target: &str) -> io::Result<()> {
101101
)
102102
}
103103

104-
pub fn mount_setattr_fd(
105-
fd: &OwnedFd,
106-
recursive: bool,
107-
attr: &libc::mount_attr,
108-
) -> io::Result<()> {
104+
pub fn mount_setattr_fd(fd: &OwnedFd, recursive: bool, attr: &libc::mount_attr) -> io::Result<()> {
109105
let mut flags = libc::AT_EMPTY_PATH as c_uint;
110106
if recursive {
111107
flags |= libc::AT_RECURSIVE as c_uint;
@@ -118,8 +114,10 @@ impl Mountable for MountSpec {
118114
fn seal(&self) -> Result<()> {
119115
let tree = open_tree(
120116
libc::AT_FDCWD,
121-
self.source.as_deref().ok_or_else(|| anyhow!("source missing"))?,
122-
libc::OPEN_TREE_CLOEXEC as u32
117+
self.source
118+
.as_deref()
119+
.ok_or_else(|| anyhow!("source missing"))?,
120+
libc::OPEN_TREE_CLOEXEC as u32,
123121
)?;
124122

125123
let mut attr: libc::mount_attr = unsafe { std::mem::zeroed() };
@@ -196,8 +194,7 @@ impl Mountable for MountSpec {
196194
msaflags |= libc::AT_RECURSIVE as c_uint;
197195
}
198196

199-
mount_setattr(libc::AT_FDCWD, &self.target, msaflags, &attr)
200-
.map_err(|e| anyhow!(e))?;
197+
mount_setattr(libc::AT_FDCWD, &self.target, msaflags, &attr).map_err(|e| anyhow!(e))?;
201198
}
202199

203200
Ok(())

src/wrap.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ impl CreateRequest {
332332
// we have to do some special things to cope with that.
333333
let stage_base = format!("/tmp/styrolite-stage-{}", self.identity()?);
334334
let stage_root = format!("/tmp/styrolite-stage-{}/root", self.identity()?);
335-
let stage_old = format!("/tmp/styrolite-stage-{}/old", self.identity()?);
335+
let stage_old = format!("/tmp/styrolite-stage-{}/old", self.identity()?);
336336

337337
if rootfs == "/" {
338338
// Mount a tmpfs staging area so we can pivot into a non-"/" mountpoint.
@@ -343,8 +343,8 @@ impl CreateRequest {
343343
bind: false,
344344
recurse: false,
345345
unshare: false,
346-
safe: true, // nodev/nosuid/noexec on the staging mount is fine
347-
create_mountpoint: true, // ensure stage_base exists
346+
safe: true,
347+
create_mountpoint: true,
348348
read_only: false,
349349
};
350350
stage_tmpfs.mount().expect("failed to mount staging tmpfs");
@@ -363,7 +363,9 @@ impl CreateRequest {
363363
create_mountpoint: false,
364364
read_only: false,
365365
};
366-
stage_bind.mount().expect("failed to bind / into staging root");
366+
stage_bind
367+
.mount()
368+
.expect("failed to bind / into staging root");
367369

368370
rootfs = stage_root.to_string();
369371
}

0 commit comments

Comments
 (0)