Skip to content

rust: Mark all from() for Error functions inline#126

Open
alistair23 wants to merge 1 commit intoRust-for-Linux:mainfrom
alistair23:alistair/inline
Open

rust: Mark all from() for Error functions inline#126
alistair23 wants to merge 1 commit intoRust-for-Linux:mainfrom
alistair23:alistair/inline

Conversation

@alistair23
Copy link
Copy Markdown

@alistair23 alistair23 commented Mar 25, 2026

Mark all of the existing

impl From<...> for Error {
    fn from(err: ...) -> Self {
        ...
    }
}

functions as #[inline]

There was a recent request [1] to inline the simple from() Error functions to avoid the function call overhead.

This patch inlines all of the functions.

1: https://lkml.org/lkml/2026/3/13/962

Mark all of the existing

impl From<...> for Error {
    fn from(err: ...) -> Self {
        ...
    }
}

functions as `#[inline]`

There was a recent request [1] to inline the simple from() Error
functions to avoid the function call overhead.

This patch inlines all of the functions.

1: https://lkml.org/lkml/2026/3/13/962

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Copy link
Copy Markdown
Member

@nbdd0121 nbdd0121 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these #[inline]s are useful given it's only in examples, but I don't think these'll hurt either.

Anyhow, please adjust your commit summary and message to quote code blocks properly and to use lore link. You can see the commit message that Miguel fixed up for you: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4f13c93497e366cd8e41561a8e30ad4da887cb82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants