Changes:
- Sort imports alphabetically in use statements
- Add semicolon after return statement in error path

Rationale:
1. Import ordering: Alphabetically sorted imports improve code readability
   and reduce merge conflicts. Changed imports follow the pattern of
   sorting type/struct names before function names within the same crate.

   Examples:
   - anyhow::{Error, bail, format_err} (Error before bail/format_err)
   - tokio::signal::unix::{SignalKind, signal} (type before function)
   - sys::{EntryParam, ROOT_ID, ReplyBufState} (alphabetical order)

2. Semicolon after return: In src/fuse_fd.rs:376, added semicolon after
   the return statement for consistency with Rust style conventions.
   While optional for return statements, rustfmt and most style guides
   prefer explicit semicolons for uniformity.

Impact:
- No functional changes - purely stylistic improvements
- Better alignment with standard Rust formatting tools (rustfmt)
- Improved code consistency across the codebase

Signed-off-by: Kefu Chai <[email protected]>
---
 examples/tmpfs/main.rs | 4 ++--
 src/fuse_fd.rs         | 2 +-
 src/lib.rs             | 2 +-
 src/session.rs         | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/examples/tmpfs/main.rs b/examples/tmpfs/main.rs
index 8ca7f9e..0f7e9c2 100644
--- a/examples/tmpfs/main.rs
+++ b/examples/tmpfs/main.rs
@@ -3,11 +3,11 @@ use std::ffi::OsStr;
 use std::path::Path;
 use std::{io, mem};
 
-use anyhow::{bail, format_err, Error};
+use anyhow::{Error, bail, format_err};
 use futures::future::FutureExt;
 use futures::select;
 use futures::stream::TryStreamExt;
-use tokio::signal::unix::{signal, SignalKind};
+use tokio::signal::unix::{SignalKind, signal};
 
 use proxmox_fuse::requests::{self, FuseRequest, SetTime};
 use proxmox_fuse::{EntryParam, Fuse, ReplyBufState, Request};
diff --git a/src/fuse_fd.rs b/src/fuse_fd.rs
index 9205615..ae292b8 100644
--- a/src/fuse_fd.rs
+++ b/src/fuse_fd.rs
@@ -374,7 +374,7 @@ fn poll_thread_inner(poll: Arc<Epoll>, fd: RawFd, state: 
Arc<PollState>) -> io::
                     return Err(io::Error::new(
                         io::ErrorKind::Other,
                         "epoll_wait returned unexpected events",
-                    ))
+                    ));
                 }
             }
         }
diff --git a/src/lib.rs b/src/lib.rs
index df509ec..32abbe9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -5,7 +5,7 @@ pub(crate) mod sys;
 pub(crate) mod util;
 
 #[doc(inline)]
-pub use sys::{EntryParam, ReplyBufState, ROOT_ID};
+pub use sys::{EntryParam, ROOT_ID, ReplyBufState};
 
 #[doc(inline)]
 pub use requests::Request;
diff --git a/src/session.rs b/src/session.rs
index a38593e..62a8a9e 100644
--- a/src/session.rs
+++ b/src/session.rs
@@ -9,7 +9,7 @@ use std::sync::Arc;
 use std::task::{Context, Poll};
 use std::{io, mem};
 
-use anyhow::{bail, format_err, Error};
+use anyhow::{Error, bail, format_err};
 use futures::ready;
 use futures::stream::{FusedStream, Stream};
 
-- 
2.47.3



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to