Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ suboptimal_flops = { level = "allow", priority = 1 }
suspicious_operation_groupings = { level = "allow", priority = 1 }
use_self = { level = "allow", priority = 1 }
while_float = { level = "allow", priority = 1 }
needless_pass_by_ref_mut = { level = "allow", priority = 1 }
too_long_first_doc_paragraph = { level = "allow", priority = 1 }
# cargo-lints:
cargo_common_metadata = { level = "allow", priority = 1 }
Expand Down
4 changes: 2 additions & 2 deletions src/backtracking/rat_in_maze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub fn find_path_in_maze(
}

// If validations pass, proceed with finding the path
let mut maze_instance = Maze::new(maze.to_owned());
let maze_instance = Maze::new(maze.to_owned());
Ok(maze_instance.find_path(start_x, start_y))
}

Expand Down Expand Up @@ -114,7 +114,7 @@ impl Maze {
/// # Returns
///
/// A solution matrix if a path is found or None if not found.
fn find_path(&mut self, start_x: usize, start_y: usize) -> Option<Vec<Vec<bool>>> {
fn find_path(&self, start_x: usize, start_y: usize) -> Option<Vec<Vec<bool>>> {
let mut solution = vec![vec![false; self.width()]; self.height()];
if self.solve(start_x as isize, start_y as isize, &mut solution) {
Some(solution)
Expand Down
5 changes: 2 additions & 3 deletions src/string/z_algorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn calculate_z_value<T: Eq>(
/// # Returns
/// The initialized Z-array value for the current index.
fn initialize_z_array_from_previous_match(
z_array: &mut [usize],
z_array: &[usize],
i: usize,
match_end: usize,
last_match: usize,
Expand Down Expand Up @@ -92,8 +92,7 @@ fn match_with_z_array<T: Eq>(

for i in start_index..size {
if i <= match_end {
z_array[i] =
initialize_z_array_from_previous_match(&mut z_array, i, match_end, last_match);
z_array[i] = initialize_z_array_from_previous_match(&z_array, i, match_end, last_match);
}

z_array[i] = calculate_z_value(input_string, pattern, i, z_array[i]);
Expand Down
Loading