diff options
author | Matthias Krüger <matthias.krueger@famsik.de> | 2017-11-30 00:38:29 +0100 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-12-03 12:50:40 -0800 |
commit | d552d28418ef192724b2b4353863708f31f325d4 (patch) | |
tree | 75c3946cc57180df816036cc22deca72fdf2afee /src/selection.rs | |
parent | ed6595543b4034cb295761e1a6fb2c49762d554f (diff) | |
download | alacritty-d552d28418ef192724b2b4353863708f31f325d4.tar.gz alacritty-d552d28418ef192724b2b4353863708f31f325d4.zip |
clippy: do and don't pass some things by reference as suggested (needless_pass_by_value, needless_borrow).
Diffstat (limited to 'src/selection.rs')
-rw-r--r-- | src/selection.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/selection.rs b/src/selection.rs index 1c31a452..625ebc31 100644 --- a/src/selection.rs +++ b/src/selection.rs @@ -148,18 +148,18 @@ impl Selection { pub fn to_span<G: SemanticSearch + Dimensions>(&self, grid: G) -> Option<Span> { match *self { Selection::Simple { ref region } => { - Selection::span_simple(grid, region) + Selection::span_simple(&grid, region) }, Selection::Semantic { ref region, ref initial_expansion } => { - Selection::span_semantic(grid, region, initial_expansion) + Selection::span_semantic(&grid, region, initial_expansion) }, Selection::Lines { ref region, ref initial_line } => { - Selection::span_lines(grid, region, initial_line) + Selection::span_lines(&grid, region, initial_line) } } } fn span_semantic<G>( - grid: G, + grid: &G, region: &Region<Point>, initial_expansion: &Region<Point> ) -> Option<Span> @@ -193,7 +193,7 @@ impl Selection { }) } - fn span_lines<G>( grid: G, region: &Region<Point>, initial_line: &Line) -> Option<Span> + fn span_lines<G>(grid: &G, region: &Region<Point>, initial_line: &Line) -> Option<Span> where G: Dimensions { // First, create start and end points based on initial line and the grid @@ -226,7 +226,7 @@ impl Selection { }) } - fn span_simple<G: Dimensions>(grid: G, region: &Region<Anchor>) -> Option<Span> { + fn span_simple<G: Dimensions>(grid: &G, region: &Region<Anchor>) -> Option<Span> { let start = region.start.point; let start_side = region.start.side; let end = region.end.point; |