diff --git a/src/config/mod.rs b/src/config/mod.rs index 8e67d452d43..ea257c0a8ba 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -1049,10 +1049,10 @@ make_backup = false max_width = 100 "#; let config = Config::from_toml(toml, Path::new("./rustfmt.toml")).unwrap(); - assert_eq!(config.array_width(), usize::max_value()); - assert_eq!(config.attr_fn_like_width(), usize::max_value()); - assert_eq!(config.chain_width(), usize::max_value()); - assert_eq!(config.fn_call_width(), usize::max_value()); + assert_eq!(config.array_width(), usize::MAX); + assert_eq!(config.attr_fn_like_width(), usize::MAX); + assert_eq!(config.chain_width(), usize::MAX); + assert_eq!(config.fn_call_width(), usize::MAX); assert_eq!(config.single_line_if_else_max_width(), 0); assert_eq!(config.struct_lit_width(), 0); assert_eq!(config.struct_variant_width(), 0); diff --git a/src/config/options.rs b/src/config/options.rs index 45496fd4e48..c526b5c678f 100644 --- a/src/config/options.rs +++ b/src/config/options.rs @@ -255,12 +255,12 @@ impl WidthHeuristics { // Using this WidthHeuristics means we ignore heuristics. pub fn null() -> WidthHeuristics { WidthHeuristics { - fn_call_width: usize::max_value(), - attr_fn_like_width: usize::max_value(), + fn_call_width: usize::MAX, + attr_fn_like_width: usize::MAX, struct_lit_width: 0, struct_variant_width: 0, - array_width: usize::max_value(), - chain_width: usize::max_value(), + array_width: usize::MAX, + chain_width: usize::MAX, single_line_if_else_max_width: 0, single_line_let_else_max_width: 0, } diff --git a/src/macros.rs b/src/macros.rs index 06495e2f8e9..5a35e115d8f 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -1163,9 +1163,9 @@ pub(crate) fn convert_try_mac( pub(crate) fn macro_style(mac: &ast::MacCall, context: &RewriteContext<'_>) -> Delimiter { let snippet = context.snippet(mac.span()); - let paren_pos = snippet.find_uncommented("(").unwrap_or(usize::max_value()); - let bracket_pos = snippet.find_uncommented("[").unwrap_or(usize::max_value()); - let brace_pos = snippet.find_uncommented("{").unwrap_or(usize::max_value()); + let paren_pos = snippet.find_uncommented("(").unwrap_or(usize::MAX); + let bracket_pos = snippet.find_uncommented("[").unwrap_or(usize::MAX); + let brace_pos = snippet.find_uncommented("{").unwrap_or(usize::MAX); if paren_pos < bracket_pos && paren_pos < brace_pos { Delimiter::Parenthesis diff --git a/src/string.rs b/src/string.rs index 41fddeb517e..3b971188cd5 100644 --- a/src/string.rs +++ b/src/string.rs @@ -84,7 +84,7 @@ pub(crate) fn rewrite_string<'a>( stripped_str .len() .checked_next_power_of_two() - .unwrap_or(usize::max_value()), + .unwrap_or(usize::MAX), ); result.push_str(fmt.opener);