rust: str: make doctests compilable/testable
authorMiguel Ojeda <ojeda@kernel.org>
Tue, 18 Jul 2023 05:27:48 +0000 (07:27 +0200)
committerShuah Khan <skhan@linuxfoundation.org>
Wed, 19 Jul 2023 15:25:02 +0000 (09:25 -0600)
commitcf36a495f07059d23d62640a3f7b6b157da1bfa0
tree7b97c5c5e515ddee3beac5c59d9c3db903e279c7
parenta30e94c2967308d45dcecfd1eede50fc3f6495eb
rust: str: make doctests compilable/testable

Rust documentation tests are going to be build/run-tested
with the KUnit integration added in a future patch, thus
update them to make them compilable/testable so that we
may start enforcing it.

Reviewed-by: Björn Roy Baron <bjorn3_gh@protonmail.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
rust/kernel/str.rs