summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fuse/io.rs11
-rw-r--r--src/fuse/mod.rs2
-rw-r--r--src/fuse/ops.rs6
-rw-r--r--src/fuse/session.rs10
4 files changed, 18 insertions, 11 deletions
diff --git a/src/fuse/io.rs b/src/fuse/io.rs
index d7f1100..727a83f 100644
--- a/src/fuse/io.rs
+++ b/src/fuse/io.rs
@@ -128,7 +128,7 @@ impl<'o, O: Operation<'o>> Reply<'o, O> {
log::error!("Replying to request {}: {}", self.unique, error);
}
- Done::done()
+ Done::new()
}
}
@@ -207,10 +207,12 @@ impl<'o, O: Operation<'o>, T> Try for Interruptible<'o, O, T> {
}
impl Attrs {
+ #[must_use]
pub fn size(self, size: u64) -> Self {
Attrs(proto::Attrs { size, ..self.0 })
}
+ #[must_use]
pub fn owner(self, uid: Uid, gid: Gid) -> Self {
Attrs(proto::Attrs {
uid: uid.as_raw(),
@@ -219,6 +221,7 @@ impl Attrs {
})
}
+ #[must_use]
pub fn mode(self, mode: Mode) -> Self {
Attrs(proto::Attrs {
mode: mode.bits(),
@@ -226,6 +229,7 @@ impl Attrs {
})
}
+ #[must_use]
pub fn blocks(self, blocks: u64, block_size: u32) -> Self {
Attrs(proto::Attrs {
blocks,
@@ -234,6 +238,7 @@ impl Attrs {
})
}
+ #[must_use]
pub fn times(self, access: Timestamp, modify: Timestamp, create: Timestamp) -> Self {
Attrs(proto::Attrs {
atime: access.seconds,
@@ -246,6 +251,7 @@ impl Attrs {
})
}
+ #[must_use]
pub fn links(self, links: u32) -> Self {
Attrs(proto::Attrs {
nlink: links,
@@ -280,6 +286,7 @@ impl Default for Attrs {
}
impl FsInfo {
+ #[must_use]
pub fn blocks(self, size: u32, total: u64, free: u64, available: u64) -> Self {
FsInfo(proto::StatfsOut {
bsize: size,
@@ -290,6 +297,7 @@ impl FsInfo {
})
}
+ #[must_use]
pub fn inodes(self, total: u64, free: u64) -> Self {
FsInfo(proto::StatfsOut {
files: total,
@@ -298,6 +306,7 @@ impl FsInfo {
})
}
+ #[must_use]
pub fn max_filename(self, max: u32) -> Self {
FsInfo(proto::StatfsOut {
namelen: max,
diff --git a/src/fuse/mod.rs b/src/fuse/mod.rs
index 2e20972..84c6878 100644
--- a/src/fuse/mod.rs
+++ b/src/fuse/mod.rs
@@ -33,7 +33,7 @@ pub struct Reply<'o, O: Operation<'o>> {
pub struct Done<'o>(PhantomData<&'o mut &'o ()>);
impl Done<'_> {
- fn done() -> Self {
+ fn new() -> Self {
Done(PhantomData)
}
diff --git a/src/fuse/ops.rs b/src/fuse/ops.rs
index e55511a..becc143 100644
--- a/src/fuse/ops.rs
+++ b/src/fuse/ops.rs
@@ -122,7 +122,7 @@ op! {
impl Reply {
pub fn ok(self) -> Done<'o> {
// No reply for forget requests
- Done::done()
+ Done::new()
}
}
}
@@ -722,9 +722,7 @@ pub(crate) mod state {
}
impl<'o, O: Operation<'o>> FromRequest<'o, O> for () {
- fn from_request(_request: &Request<'o, O>) -> Self {
- ()
- }
+ fn from_request(_request: &Request<'o, O>) -> Self {}
}
impl<'o> FromRequest<'o, Open> for proto::OpenOutFlags {
diff --git a/src/fuse/session.rs b/src/fuse/session.rs
index 1fbcb68..39e63b0 100644
--- a/src/fuse/session.rs
+++ b/src/fuse/session.rs
@@ -86,6 +86,8 @@ pub struct Owned<O> {
}
impl Session {
+ // Does not seem like 'a can be elided here
+ #[allow(clippy::needless_lifetimes)]
pub fn endpoint<'a>(self: &'a Arc<Self>) -> Endpoint<'a> {
Endpoint {
session: self,
@@ -185,8 +187,7 @@ impl Session {
fn send(&self, unique: u64, error: i32, output: OutputChain<'_>) -> FuseResult<()> {
let after_header: usize = output
.iter()
- .map(<[_]>::iter)
- .flatten()
+ .flat_map(<[_]>::iter)
.copied()
.map(<[_]>::len)
.sum();
@@ -203,8 +204,7 @@ impl Session {
let output = output.preceded(&header);
let buffers: SmallVec<[_; 8]> = output
.iter()
- .map(<[_]>::iter)
- .flatten()
+ .flat_map(<[_]>::iter)
.copied()
.filter(|slice| !slice.is_empty())
.map(IoVec::from_slice)
@@ -420,7 +420,7 @@ where
_phantom: PhantomData,
};
- (Done::done(), owned)
+ (Done::new(), owned)
}
}