]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: alloc: add doctest for `ArrayLayout::new()`
authorJimmy Ostler <jtostler1@gmail.com>
Fri, 20 Dec 2024 06:25:33 +0000 (22:25 -0800)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 13 Jan 2025 22:45:30 +0000 (23:45 +0100)
commit91da5a24144e5a82bf88c5f72068cf1628198668
tree4c39526b0a90efa79e3422fc5abb6370fcb3f47e
parent59d5846594e9f82c11af72151de7cef3f325dd4b
rust: alloc: add doctest for `ArrayLayout::new()`

Add a rustdoc example and Kunit test to the `ArrayLayout` struct's
`ArrayLayout::new()` function.

This patch depends on the first patch in this series in order for the
KUnit test to compile.

Suggested-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://github.com/Rust-for-Linux/linux/issues/1131
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Jimmy Ostler <jtostler1@gmail.com>
Link: https://lore.kernel.org/r/f1564da5bcaa6be87aee312767a1d1694a03d1b7.1734674670.git.jtostler1@gmail.com
[ Added periods to example comments. Reworded title. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/alloc/layout.rs