Skip to content

Commit

Permalink
Clean clippy warning by cargo fmt
Browse files Browse the repository at this point in the history
Clean clippy warning by `cargo fmt`.

Signed-off-by: Liu Jiang <[email protected]>
  • Loading branch information
jiangliu committed Dec 3, 2021
1 parent 35a0044 commit 9c594c8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion blobfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ rafs = { path = "../rafs" }
nydus-error = { path = "../error" }
storage = { path = "../storage", features = ["backend-localfs", "backend-oss", "backend-registry"] }

fuse-backend-rs = { git = "https://github.com/cloud-hypervisor/fuse-backend-rs.git", rev = "afc7b69", optional = true }
fuse-backend-rs = { git = "https://github.com/cloud-hypervisor/fuse-backend-rs.git", rev = "afc7b69" }

[features]
virtiofs = [ "fuse-backend-rs/virtiofs", "vm-memory/backend-mmap"]
Expand Down
1 change: 0 additions & 1 deletion rafs/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1097,4 +1097,3 @@ pub(crate) mod tests {
assert!(BlobPrefetchConfig::try_from(&config).is_ok());
}
}

5 changes: 2 additions & 3 deletions src/bin/nydusd/fusedev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ use std::thread::{self, JoinHandle};
use std::time::{SystemTime, UNIX_EPOCH};

use fuse_backend_rs::abi::linux_abi::{InHeader, OutHeader};
use fuse_backend_rs::transport::fusedev::{FuseChannel, FuseSession};
use fuse_backend_rs::api::server::{MetricsHook, Server};
use fuse_backend_rs::api::Vfs;
use fuse_backend_rs::transport::fusedev::{FuseChannel, FuseSession};
use nix::sys::stat::{major, minor};
use nydus_app::BuildTimeInfo;
use serde::Serialize;
use vmm_sys_util::eventfd::EventFd;

use crate::upgrade::{self, FailoverPolicy, UpgradeManager};
use crate::daemon::{
DaemonError, DaemonResult, DaemonState, DaemonStateMachineContext, DaemonStateMachineInput,
DaemonStateMachineSubscriber, FsBackendCollection, FsBackendMountCmd, NydusDaemon, Trigger,
};
use crate::exit_event_manager;
use crate::upgrade::{self, FailoverPolicy, UpgradeManager};

#[derive(Serialize)]
struct FuseOp {
Expand Down Expand Up @@ -398,7 +398,6 @@ pub fn create_nydus_daemon(
mount_cmd: Option<FsBackendMountCmd>,
bti: BuildTimeInfo,
) -> Result<Arc<dyn NydusDaemon + Send + Sync>> {
let (trigger, events_rx) = channel::<DaemonStateMachineInput>();
let session = FuseSession::new(Path::new(mountpoint), "rafs", "", readonly)?;

// Create upgrade manager
Expand Down
13 changes: 7 additions & 6 deletions src/bin/nydusd/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ fn main() -> Result<()> {
.short("B")
.help("Rafs filesystem bootstrap/metadata file")
.takes_value(true)
.conflicts_with("shared-dir")
.conflicts_with("shared-dir"),
)
.arg(
Arg::with_name("shared-dir")
Expand All @@ -246,11 +246,12 @@ fn main() -> Result<()> {
.conflicts_with("bootstrap"),
)
.arg(
Arg::with_name("hybrid-mode").long("hybrid-mode")
.help("run nydusd in rafs and passthroughfs hybrid mode")
.required(false)
.takes_value(false)
.global(true)
Arg::with_name("hybrid-mode")
.long("hybrid-mode")
.help("run nydusd in rafs and passthroughfs hybrid mode")
.required(false)
.takes_value(false)
.global(true),
);

#[cfg(feature = "fusedev")]
Expand Down
6 changes: 5 additions & 1 deletion storage/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,11 @@ impl BlobDevice {
}

/// Read a range of data from blob into the provided writer
pub fn read_to(&self, w: &mut dyn ZeroCopyWriter<S = ()>, desc: &mut BlobIoVec) -> io::Result<usize> {
pub fn read_to(
&self,
w: &mut dyn ZeroCopyWriter<S = ()>,
desc: &mut BlobIoVec,
) -> io::Result<usize> {
// Validate that:
// - bi_vec[0] is valid
// - bi_vec[0].blob.blob_index() is valid
Expand Down

0 comments on commit 9c594c8

Please sign in to comment.