lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZzujX5dXpUxwBFSU@tardis.local>
Date: Mon, 18 Nov 2024 12:28:15 -0800
From: Boqun Feng <boqun.feng@...il.com>
To: manas18244@...td.ac.in
Cc: FUJITA Tomonori <fujita.tomonori@...il.com>,
	Trevor Gross <tmgross@...ch.edu>, Andrew Lunn <andrew@...n.ch>,
	Heiner Kallweit <hkallweit1@...il.com>,
	Russell King <linux@...linux.org.uk>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Andreas Hindborg <a.hindborg@...nel.org>,
	Miguel Ojeda <ojeda@...nel.org>,
	Alex Gaynor <alex.gaynor@...il.com>, Gary Guo <gary@...yguo.net>,
	Björn Roy Baron <bjorn3_gh@...tonmail.com>,
	Benno Lossin <benno.lossin@...ton.me>,
	Alice Ryhl <aliceryhl@...gle.com>,
	Shuah Khan <skhan@...uxfoundation.org>,
	Anup Sharma <anupnewsmail@...il.com>, netdev@...r.kernel.org,
	rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-block@...r.kernel.org
Subject: Re: [PATCH v3 3/3] rust: macros: simplify Result<()> in function
 returns

On Mon, Nov 18, 2024 at 08:07:00PM +0530, Manas via B4 Relay wrote:
> From: Manas <manas18244@...td.ac.in>
> 
> Functions foo and bar in doctests return `Result<()>` type. This type

Same nits here.

> can be simply written as `Result` as default type parameters are unit
> `()` and `Error` types. Thus keep the usage of `Result` consistent.
> 
> Suggested-by: Miguel Ojeda <ojeda@...nel.org>
> Link: https://github.com/Rust-for-Linux/linux/issues/1128
> Signed-off-by: Manas <manas18244@...td.ac.in>

Reviewed-by: Boqun Feng <boqun.feng@...il.com>

Regards,
Boqun

> ---
>  rust/macros/lib.rs | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/rust/macros/lib.rs b/rust/macros/lib.rs
> index 4ab94e44adfe3206faad159e81417ea41a35815b..463920353ca9c408f5d69e2626c13a173bae98d7 100644
> --- a/rust/macros/lib.rs
> +++ b/rust/macros/lib.rs
> @@ -144,11 +144,11 @@ pub fn module(ts: TokenStream) -> TokenStream {
>  /// // Declares a `#[vtable]` trait
>  /// #[vtable]
>  /// pub trait Operations: Send + Sync + Sized {
> -///     fn foo(&self) -> Result<()> {
> +///     fn foo(&self) -> Result {
>  ///         kernel::build_error(VTABLE_DEFAULT_ERROR)
>  ///     }
>  ///
> -///     fn bar(&self) -> Result<()> {
> +///     fn bar(&self) -> Result {
>  ///         kernel::build_error(VTABLE_DEFAULT_ERROR)
>  ///     }
>  /// }
> @@ -158,7 +158,7 @@ pub fn module(ts: TokenStream) -> TokenStream {
>  /// // Implements the `#[vtable]` trait
>  /// #[vtable]
>  /// impl Operations for Foo {
> -///     fn foo(&self) -> Result<()> {
> +///     fn foo(&self) -> Result {
>  /// #        Err(EINVAL)
>  ///         // ...
>  ///     }
> 
> -- 
> 2.47.0
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ