From 8a60a561c95691912cbf41d55866abafcba0127d Mon Sep 17 00:00:00 2001 From: EdJoPaTo Date: Sat, 25 May 2024 03:32:22 +0200 Subject: [PATCH] refactor: needless_pass_by_ref_mut (#1137) --- Cargo.toml | 1 + examples/user_input.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 3f99a4db..74906f04 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -88,6 +88,7 @@ map_err_ignore = "warn" missing_const_for_fn = "warn" mixed_read_write_in_expression = "warn" mod_module_files = "warn" +needless_pass_by_ref_mut = "warn" needless_raw_strings = "warn" redundant_type_annotations = "warn" rest_pat_in_fully_bound_structs = "warn" diff --git a/examples/user_input.rs b/examples/user_input.rs index f4df4d6e..5aeb5783 100644 --- a/examples/user_input.rs +++ b/examples/user_input.rs @@ -86,7 +86,7 @@ impl App { /// /// Since each character in a string can be contain multiple bytes, it's necessary to calculate /// the byte index based on the index of the character. - fn byte_index(&mut self) -> usize { + fn byte_index(&self) -> usize { self.input .char_indices() .map(|(i, _)| i)