* [pve-devel] [PATCH proxmox-fuse-rs] Apply code formatting improvements for consistency
@ 2026-01-05 14:08 Kefu Chai
2026-01-15 4:00 ` Kefu Chai
0 siblings, 1 reply; 2+ messages in thread
From: Kefu Chai @ 2026-01-05 14:08 UTC (permalink / raw)
To: pve-devel; +Cc: Wolfgang Bumiller
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 <k.chai@proxmox.com>
---
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
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [pve-devel] [PATCH proxmox-fuse-rs] Apply code formatting improvements for consistency
2026-01-05 14:08 [pve-devel] [PATCH proxmox-fuse-rs] Apply code formatting improvements for consistency Kefu Chai
@ 2026-01-15 4:00 ` Kefu Chai
0 siblings, 0 replies; 2+ messages in thread
From: Kefu Chai @ 2026-01-15 4:00 UTC (permalink / raw)
To: Kefu Chai, pve-devel, Wolfgang Bumiller
Hey Wolfgang,
could you please help review this change as well at your convenience?
It's a lint change.
On Mon Jan 5, 2026 at 10:08 PM CST, Kefu Chai wrote:
> 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 <k.chai@proxmox.com>
> ---
> 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};
>
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-15 4:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-05 14:08 [pve-devel] [PATCH proxmox-fuse-rs] Apply code formatting improvements for consistency Kefu Chai
2026-01-15 4:00 ` Kefu Chai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox