diff --git a/src/format.rs b/src/format.rs index 3218af1..10a0c5e 100644 --- a/src/format.rs +++ b/src/format.rs @@ -74,8 +74,10 @@ pub fn format_file( &pattern, ); - let indent_length = usize::try_from(indent.visual * args.tab as i8) - .expect("Visual indent is non-negative."); + #[allow(clippy::cast_possible_wrap)] + let indent_length = + usize::try_from(indent.visual * args.tab as i8) + .expect("Visual indent is non-negative."); // Wrap the line before applying the indent, and loop back // if the line needed wrapping. diff --git a/src/indent.rs b/src/indent.rs index d184d31..161bb83 100644 --- a/src/indent.rs +++ b/src/indent.rs @@ -184,7 +184,9 @@ pub fn apply_indent( // Otherwise, allocate enough memory to fit line with the added // indentation and insert the appropriate string slices } else { - let n_indent_chars = usize::try_from(indent.visual * args.tab as i8).unwrap(); + #[allow(clippy::cast_possible_wrap)] + let n_indent_chars = + usize::try_from(indent.visual * args.tab as i8).unwrap(); let mut new_line = String::with_capacity(trimmed_line.len() + n_indent_chars); for idx in 0..n_indent_chars {