浏览代码

rust: fix doc test syntax

Allow "cargo test --doc" to pass.

Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini 9 月之前
父节点
当前提交
8a88b55f69
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      rust/qemu-api/src/zeroable.rs

+ 3 - 3
rust/qemu-api/src/zeroable.rs

@@ -7,9 +7,9 @@
 /// behavior.  This trait in principle could be implemented as just:
 /// behavior.  This trait in principle could be implemented as just:
 ///
 ///
 /// ```
 /// ```
-///     const ZERO: Self = unsafe {
-///         ::core::mem::MaybeUninit::<$crate::bindings::Property>::zeroed().assume_init()
-///     },
+/// pub unsafe trait Zeroable: Default {
+///     const ZERO: Self = unsafe { ::core::mem::MaybeUninit::<Self>::zeroed().assume_init() };
+/// }
 /// ```
 /// ```
 ///
 ///
 /// The need for a manual implementation is only because `zeroed()` cannot
 /// The need for a manual implementation is only because `zeroed()` cannot