Skip to content

Commit

Permalink
[Clippy] Remove unnecessary borrows.
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulJuliusMartinez committed Feb 9, 2022
1 parent 3c1efd2 commit 73af0fb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/lineprinter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,9 +851,9 @@ impl<'a, 'b, 'c> LinePrinter<'a, 'b, 'c> {
}

let space_used_for_value = if is_only_child && row.value.is_container() {
self.generate_container_preview(flatjson, &row, available_space, quoted_object_keys)?
self.generate_container_preview(flatjson, row, available_space, quoted_object_keys)?
} else {
self.fill_in_value_preview(&flatjson.1, &row, available_space)?
self.fill_in_value_preview(&flatjson.1, row, available_space)?
};
used_space += space_used_for_value;

Expand Down
8 changes: 4 additions & 4 deletions src/screenwriter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ impl ScreenWriter {
let path_to_node = ScreenWriter::get_path_to_focused_node(viewer);
self.print_path_to_node_and_file_name(
&path_to_node,
&input_filename,
input_filename,
viewer.dimensions.width as isize,
)?;

Expand Down Expand Up @@ -541,7 +541,7 @@ impl ScreenWriter {
// Make tsv not a reference.
let mut tsv = *tsv;
let value_ref = self
.line_primitive_value_ref(&viewer.flatjson[row], &viewer)
.line_primitive_value_ref(&viewer.flatjson[row], viewer)
.unwrap();
if to_right {
tsv = tsv.scroll_right(value_ref, count);
Expand All @@ -564,7 +564,7 @@ impl ScreenWriter {
// Make tsv not a reference.
let mut tsv = *tsv;
let value_ref = self
.line_primitive_value_ref(&viewer.flatjson[row], &viewer)
.line_primitive_value_ref(&viewer.flatjson[row], viewer)
.unwrap();
tsv = tsv.jump_to_an_end(value_ref);
self.truncated_row_value_views
Expand All @@ -587,7 +587,7 @@ impl ScreenWriter {
}

let json_row = &viewer.flatjson[row];
let value_ref = self.line_primitive_value_ref(json_row, &viewer).unwrap();
let value_ref = self.line_primitive_value_ref(json_row, viewer).unwrap();

let mut range = json_row.range.clone();
if json_row.is_string() {
Expand Down
2 changes: 1 addition & 1 deletion src/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl SearchState {

// The default Display implementation for these errors spills
// onto multiple lines.
let inverted = Self::invert_square_and_curly_bracket_escaping(&regex_input);
let inverted = Self::invert_square_and_curly_bracket_escaping(regex_input);

let regex = RegexBuilder::new(&inverted)
.case_insensitive(!case_sensitive)
Expand Down

0 comments on commit 73af0fb

Please sign in to comment.