Skip to content

Commit 98d6062

Browse files
committed
cargo fmt
1 parent a88f5bb commit 98d6062

6 files changed

Lines changed: 18 additions & 13 deletions

File tree

src/cgroup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use anyhow::{ensure, Context, Result};
1+
use anyhow::{Context, Result, ensure};
22
use aya::maps::{HashMap, MapData};
33
use aya::programs::{CgroupAttachMode, CgroupDevice, Link};
44
use std::ffi::OsStr;

src/cli/device.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::fmt::Display;
22
use std::path::PathBuf;
33
use std::str::FromStr;
44

5-
use anyhow::{bail, ensure, Context, Error, Result};
5+
use anyhow::{Context, Error, Result, bail, ensure};
66
use udev::Enumerator;
77

88
use crate::dev::Device;

src/cli/symlink.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::path::PathBuf;
22
use std::str::FromStr;
33

4-
use anyhow::{bail, ensure, Error, Result};
4+
use anyhow::{Error, Result, bail, ensure};
55

66
use crate::dev::Device;
77

@@ -50,7 +50,10 @@ impl FromStr for Symlink {
5050
match kind {
5151
"usb" => {
5252
let parts: Vec<_> = dev.split(':').collect();
53-
ensure!(parts.len() == 3, "Symlink DEVICE format for usb should be `<VID>:<PID>:<INTERFACE>`, found `{dev}`.");
53+
ensure!(
54+
parts.len() == 3,
55+
"Symlink DEVICE format for usb should be `<VID>:<PID>:<INTERFACE>`, found `{dev}`."
56+
);
5457

5558
let vid = parts[0];
5659
let pid = parts[1];

src/dev/monitor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
//!
33
//! Provides async support and convience methods to monitor devices and retrieve device properties.
44
5-
use std::collections::hash_map::Entry;
65
use std::collections::HashMap;
76
use std::collections::VecDeque;
7+
use std::collections::hash_map::Entry;
88
use std::path::PathBuf;
99
use std::rc::Rc;
10-
use std::task::{ready, Poll};
10+
use std::task::{Poll, ready};
1111

1212
use anyhow::Result;
1313
use tokio::io::unix::AsyncFd;

src/main.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ use std::pin::pin;
1616
use std::process::ExitCode;
1717
use std::sync::Arc;
1818

19-
use anyhow::{bail, Context, Result};
19+
use anyhow::{Context, Result, bail};
2020
use clap::Parser;
2121
use log::info;
22-
use runc::cli::{CreateOptions, GlobalOptions};
2322
use runc::Container;
23+
use runc::cli::{CreateOptions, GlobalOptions};
2424
use rustix::fd::OwnedFd;
2525
use rustix::pipe::PipeFlags;
2626
use rustix::process::Signal;
@@ -118,9 +118,11 @@ async fn create(global: GlobalOptions, create: CreateOptions, notifier: OwnedFd)
118118
}
119119
};
120120

121-
let mut stream = pin!(tokio_stream::empty()
122-
.merge(hotplug_stream)
123-
.merge(container_stream));
121+
let mut stream = pin!(
122+
tokio_stream::empty()
123+
.merge(hotplug_stream)
124+
.merge(container_stream)
125+
);
124126

125127
loop {
126128
let event = stream.try_next().await?.context("No more events")?;

src/runc/container.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ use std::os::fd::AsFd;
44
use std::os::unix::fs::{FileTypeExt, MetadataExt, PermissionsExt};
55
use std::path::Path;
66

7-
use anyhow::{bail, Context, Result};
7+
use anyhow::{Context, Result, bail};
88
use rustix::fs::{FileType, Mode};
99
use rustix::mount::{FsMountFlags, FsOpenFlags, MountAttrFlags, MoveMountFlags, UnmountFlags};
1010
use rustix::process::{Pid, Signal};
11-
use tokio::io::unix::AsyncFd;
1211
use tokio::io::Interest;
12+
use tokio::io::unix::AsyncFd;
1313
use tokio::sync::Mutex;
1414

1515
use crate::cgroup::{

0 commit comments

Comments
 (0)