diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-04 22:56:36 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-04 22:56:36 +0100 |
commit | b1bf434dfcf81ac681a9e152628f9eecde68470a (patch) | |
tree | 51ea069481d3a5eefa9ec1f558a12c85690dabce /crates/ra_syntax | |
parent | c6a6e43372de9530ec7df0f38352466ed107e1a2 (diff) | |
parent | e7fb6c83cc33facf0d74e253bd193afc46b1dc5c (diff) |
Merge #1482
1482: Some clippy fixes for 1.36 r=kjeremy a=kjeremy
Some clippy fixes now that 1.36 is released. ~~Plus the requisite format run (I can rebase after #1481 is merged to make this cleaner) .~~
The change from `map(|it| *it)` to `copied()` changes the minimum rust stable to 1.36.
Co-authored-by: Jeremy Kolb <[email protected]>
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r-- | crates/ra_syntax/src/ast/expr_extensions.rs | 2 | ||||
-rw-r--r-- | crates/ra_syntax/src/fuzz.rs | 4 | ||||
-rw-r--r-- | crates/ra_syntax/src/parsing/text_token_source.rs | 2 | ||||
-rw-r--r-- | crates/ra_syntax/src/syntax_node.rs | 2 | ||||
-rw-r--r-- | crates/ra_syntax/src/validation/unescape.rs | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_syntax/src/ast/expr_extensions.rs b/crates/ra_syntax/src/ast/expr_extensions.rs index 87dbb0ea5..4355e3587 100644 --- a/crates/ra_syntax/src/ast/expr_extensions.rs +++ b/crates/ra_syntax/src/ast/expr_extensions.rs | |||
@@ -260,7 +260,7 @@ impl ast::Literal { | |||
260 | .iter() | 260 | .iter() |
261 | .find(|&s| text.ends_with(s)) | 261 | .find(|&s| text.ends_with(s)) |
262 | .map(|&suf| SmolStr::new(suf)); | 262 | .map(|&suf| SmolStr::new(suf)); |
263 | LiteralKind::FloatNumber { suffix: suffix } | 263 | LiteralKind::FloatNumber { suffix } |
264 | } | 264 | } |
265 | STRING | RAW_STRING => LiteralKind::String, | 265 | STRING | RAW_STRING => LiteralKind::String, |
266 | T![true] | T![false] => LiteralKind::Bool, | 266 | T![true] | T![false] => LiteralKind::Bool, |
diff --git a/crates/ra_syntax/src/fuzz.rs b/crates/ra_syntax/src/fuzz.rs index 6d114aad4..00039f970 100644 --- a/crates/ra_syntax/src/fuzz.rs +++ b/crates/ra_syntax/src/fuzz.rs | |||
@@ -21,8 +21,8 @@ pub struct CheckReparse { | |||
21 | 21 | ||
22 | impl CheckReparse { | 22 | impl CheckReparse { |
23 | pub fn from_data(data: &[u8]) -> Option<Self> { | 23 | pub fn from_data(data: &[u8]) -> Option<Self> { |
24 | const PREFIX: &'static str = "fn main(){\n\t"; | 24 | const PREFIX: &str = "fn main(){\n\t"; |
25 | const SUFFIX: &'static str = "\n}"; | 25 | const SUFFIX: &str = "\n}"; |
26 | 26 | ||
27 | let data = str::from_utf8(data).ok()?; | 27 | let data = str::from_utf8(data).ok()?; |
28 | let mut lines = data.lines(); | 28 | let mut lines = data.lines(); |
diff --git a/crates/ra_syntax/src/parsing/text_token_source.rs b/crates/ra_syntax/src/parsing/text_token_source.rs index f592b499f..64cb20ae8 100644 --- a/crates/ra_syntax/src/parsing/text_token_source.rs +++ b/crates/ra_syntax/src/parsing/text_token_source.rs | |||
@@ -28,7 +28,7 @@ pub(crate) struct TextTokenSource<'t> { | |||
28 | 28 | ||
29 | impl<'t> TokenSource for TextTokenSource<'t> { | 29 | impl<'t> TokenSource for TextTokenSource<'t> { |
30 | fn current(&self) -> PToken { | 30 | fn current(&self) -> PToken { |
31 | return self.curr.0; | 31 | self.curr.0 |
32 | } | 32 | } |
33 | 33 | ||
34 | fn lookahead_nth(&self, n: usize) -> PToken { | 34 | fn lookahead_nth(&self, n: usize) -> PToken { |
diff --git a/crates/ra_syntax/src/syntax_node.rs b/crates/ra_syntax/src/syntax_node.rs index 80c8639c8..a1f9a59b6 100644 --- a/crates/ra_syntax/src/syntax_node.rs +++ b/crates/ra_syntax/src/syntax_node.rs | |||
@@ -357,7 +357,7 @@ impl SyntaxNode { | |||
357 | // `range` private afterwards | 357 | // `range` private afterwards |
358 | let mut ptr = SyntaxNodePtr::new(self); | 358 | let mut ptr = SyntaxNodePtr::new(self); |
359 | ptr.range = TextRange::offset_len(ptr.range().start(), len); | 359 | ptr.range = TextRange::offset_len(ptr.range().start(), len); |
360 | return ptr.to_node(file.syntax()).to_owned(); | 360 | ptr.to_node(file.syntax()).to_owned() |
361 | } | 361 | } |
362 | 362 | ||
363 | fn position_of_child(&self, child: SyntaxElement) -> usize { | 363 | fn position_of_child(&self, child: SyntaxElement) -> usize { |
diff --git a/crates/ra_syntax/src/validation/unescape.rs b/crates/ra_syntax/src/validation/unescape.rs index 4c3a7effc..1cb2433f3 100644 --- a/crates/ra_syntax/src/validation/unescape.rs +++ b/crates/ra_syntax/src/validation/unescape.rs | |||
@@ -173,7 +173,7 @@ fn scan_escape(first_char: char, chars: &mut Chars<'_>, mode: Mode) -> Result<ch | |||
173 | } | 173 | } |
174 | 174 | ||
175 | break std::char::from_u32(value).ok_or_else(|| { | 175 | break std::char::from_u32(value).ok_or_else(|| { |
176 | if value > 0x10FFFF { | 176 | if value > 0x0010_FFFF { |
177 | EscapeError::OutOfRangeUnicodeEscape | 177 | EscapeError::OutOfRangeUnicodeEscape |
178 | } else { | 178 | } else { |
179 | EscapeError::LoneSurrogateUnicodeEscape | 179 | EscapeError::LoneSurrogateUnicodeEscape |