resources: fix allocator doc tests

Change-Id: I5a9b7460fc798d9abf1ad1f452233fe76c449b29
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1208151
Reviewed-by: Dylan Reid <dgreid@chromium.org>
This commit is contained in:
Dylan Reid 2018-07-04 00:48:47 -07:00 committed by chrome-bot
parent 67afe44f80
commit bc8d9059ab

View file

@ -11,12 +11,12 @@ use sys_util::pagesize;
/// # Example - Use the `SystemAddress` builder.
///
/// ```
/// # use sys_util::AddressRanges;
/// # use resources::AddressRanges;
/// if let Some(mut a) = AddressRanges::new()
/// .add_io_addresses(0x1000, 0x10000)
/// .add_device_addresses(0x10000000, 0x10000000)
/// .add_mmio_addresses(0x30000000, 0x10000)
/// .create_allocator(5) {
/// .create_allocator(5, false) {
/// assert_eq!(a.allocate_irq(), Some(5));
/// assert_eq!(a.allocate_irq(), Some(6));
/// assert_eq!(a.allocate_device_addresses(0x100), Some(0x10000000));