s/width/min_width

This commit is contained in:
Ayaz Hafiz 2023-07-15 20:25:38 -05:00
parent b36ad76cdd
commit 879719b166
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 3 additions and 3 deletions

View file

@ -38,7 +38,7 @@ impl NumericRange {
width.signedness_and_width().1 >= at_least_width.signedness_and_width().1 width.signedness_and_width().1 >= at_least_width.signedness_and_width().1
} }
pub(crate) fn width(&self) -> IntLitWidth { pub fn min_width(&self) -> IntLitWidth {
use NumericRange::*; use NumericRange::*;
match self { match self {
IntAtLeastSigned(w) IntAtLeastSigned(w)
@ -52,7 +52,7 @@ impl NumericRange {
/// `None` if there is no common lower bound. /// `None` if there is no common lower bound.
pub fn intersection(&self, other: &Self) -> Option<Self> { pub fn intersection(&self, other: &Self) -> Option<Self> {
use NumericRange::*; use NumericRange::*;
let (left, right) = (self.width(), other.width()); let (left, right) = (self.min_width(), other.min_width());
let (constructor, is_negative): (fn(IntLitWidth) -> NumericRange, _) = match (self, other) { let (constructor, is_negative): (fn(IntLitWidth) -> NumericRange, _) = match (self, other) {
// Matching against a signed int, the intersection must also be a signed int // Matching against a signed int, the intersection must also be a signed int
(IntAtLeastSigned(_), _) | (_, IntAtLeastSigned(_)) => (IntAtLeastSigned, true), (IntAtLeastSigned(_), _) | (_, IntAtLeastSigned(_)) => (IntAtLeastSigned, true),

View file

@ -1609,7 +1609,7 @@ mod debug_types {
use crate::num::IntLitWidth::*; use crate::num::IntLitWidth::*;
use crate::num::NumericRange::*; use crate::num::NumericRange::*;
let fmt_width = f.text(match range.width() { let fmt_width = f.text(match range.min_width() {
U8 | I8 => "8", U8 | I8 => "8",
U16 | I16 => "16", U16 | I16 => "16",
U32 | I32 => "32", U32 | I32 => "32",