Rust-for-Linux/linux

Add more examples to `Either`

Opened this issue · 2 comments

Add more examples to Either.

For instance, it would be nice to add a "real-life" example similar to Wedson's example on the filesystem abstractions' get_or_crate_inode proposal from his talk at LSF/MM/BPF 2024, i.e. something like:

fn get_or_create_inode(&self, ino: Ino) -> Result<Either<ARef<INode<T>>, inode::New<T>>>

See https://rust-for-linux.zulipchat.com/#narrow/stream/291565-Help/topic/What.20to.20work.20on.20next.3F/near/467478085.


This requires submitting a proper patch to the LKML and the Rust for Linux mailing list. Please recall to test your changes (including generating the documentation if changed, running the Rust doctests if changed, etc.), to use a proper title for the commit, to sign your commit under the Developer's Certificate of Origin and to add a Suggested-by: tag and a Link: tag to this issue. Please see https://rust-for-linux.com/contributing for details.

Please take this issue only if you are new to the kernel development process and you would like to use it as a test to submit your first patch to the kernel. Please do not take it if you do not plan to make other contributions to the kernel.

Hey @ojeda, im working on this.

Thanks for letting me know @Timgrau, that is great.