tree-wide: update to new inclusive range syntax

1.38 nightly started warning about using `...` vs `..=`, update to avoid
the warning.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Change-Id: Ibc3d24c5410b6eed9a1207db21e529ec6a763376
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1715575
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Dylan Reid 2019-07-22 22:10:54 -07:00 committed by Commit Bot
parent 13c2191395
commit c3bee1f8c3
3 changed files with 8 additions and 8 deletions

View file

@ -285,9 +285,9 @@ impl Ac97BusMaster {
let regs = self.regs.lock();
match offset {
PI_BASE_00...PI_CR_0B => readb_func_regs(&regs.pi_regs, offset - PI_BASE_00),
PO_BASE_10...PO_CR_1B => readb_func_regs(&regs.po_regs, offset - PO_BASE_10),
MC_BASE_20...MC_CR_2B => readb_func_regs(&regs.mc_regs, offset - MC_BASE_20),
PI_BASE_00..=PI_CR_0B => readb_func_regs(&regs.pi_regs, offset - PI_BASE_00),
PO_BASE_10..=PO_CR_1B => readb_func_regs(&regs.po_regs, offset - PO_BASE_10),
MC_BASE_20..=MC_CR_2B => readb_func_regs(&regs.mc_regs, offset - MC_BASE_20),
ACC_SEMA_34 => self.acc_sema,
_ => 0,
}

View file

@ -201,8 +201,8 @@ impl BusDevice for PciConfigIo {
fn read(&mut self, offset: u64, data: &mut [u8]) {
// `offset` is relative to 0xcf8
let value = match offset {
0...3 => self.config_address,
4...7 => self.config_space_read(),
0..=3 => self.config_address,
4..=7 => self.config_space_read(),
_ => 0xffff_ffff,
};
@ -223,8 +223,8 @@ impl BusDevice for PciConfigIo {
fn write(&mut self, offset: u64, data: &[u8]) {
// `offset` is relative to 0xcf8
match offset {
o @ 0...3 => self.set_config_address(o, data),
o @ 4...7 => self.config_space_write(o - 4, data),
o @ 0..=3 => self.set_config_address(o, data),
o @ 4..=7 => self.config_space_write(o - 4, data),
_ => (),
};
}

View file

@ -40,7 +40,7 @@ pub type Result<T> = result::Result<T, Error>;
fn valid_char(c: char) -> bool {
match c {
' '...'~' => true,
' '..='~' => true,
_ => false,
}
}