mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
s/width/min_width
This commit is contained in:
parent
b36ad76cdd
commit
879719b166
2 changed files with 3 additions and 3 deletions
|
@ -38,7 +38,7 @@ impl NumericRange {
|
|||
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::*;
|
||||
match self {
|
||||
IntAtLeastSigned(w)
|
||||
|
@ -52,7 +52,7 @@ impl NumericRange {
|
|||
/// `None` if there is no common lower bound.
|
||||
pub fn intersection(&self, other: &Self) -> Option<Self> {
|
||||
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) {
|
||||
// Matching against a signed int, the intersection must also be a signed int
|
||||
(IntAtLeastSigned(_), _) | (_, IntAtLeastSigned(_)) => (IntAtLeastSigned, true),
|
||||
|
|
|
@ -1609,7 +1609,7 @@ mod debug_types {
|
|||
use crate::num::IntLitWidth::*;
|
||||
use crate::num::NumericRange::*;
|
||||
|
||||
let fmt_width = f.text(match range.width() {
|
||||
let fmt_width = f.text(match range.min_width() {
|
||||
U8 | I8 => "8",
|
||||
U16 | I16 => "16",
|
||||
U32 | I32 => "32",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue