volatile_memory: Fix usize/u64 confusion in doc test

VolatileMemory::size() now returns a u64, fix the doctest so it
compares the returned value with a u64.

BUG=none
TEST=cargo test --all -- --test-threads=1

Change-Id: If1ae94d83bfc1f2f995fd71bfdede324c162ab4e
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/902777
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
This commit is contained in:
Dylan Reid 2018-02-05 16:09:18 -08:00 committed by chrome-bot
parent 6cc352f4fa
commit 2f307b2f3f

View file

@ -394,7 +394,7 @@ impl<'a, T: DataInit> VolatileRef<'a, T> {
/// # use std::mem::size_of;
/// # use data_model::VolatileRef;
/// let v_ref = unsafe { VolatileRef::new(0 as *mut u32) };
/// assert_eq!(v_ref.size(), size_of::<u32>());
/// assert_eq!(v_ref.size(), size_of::<u32>() as u64);
/// ```
pub fn size(&self) -> u64 {
size_of::<T>() as u64