From 4ad9e986ad05e404df73701c098b71f73a847ca6 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Thu, 4 Jul 2019 13:26:44 -0400 Subject: Some clippy fixes for 1.36 --- crates/ra_syntax/src/ast/expr_extensions.rs | 2 +- crates/ra_syntax/src/fuzz.rs | 4 ++-- crates/ra_syntax/src/parsing/text_token_source.rs | 2 +- crates/ra_syntax/src/syntax_node.rs | 2 +- crates/ra_syntax/src/validation/unescape.rs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/ra_syntax') 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 { .iter() .find(|&s| text.ends_with(s)) .map(|&suf| SmolStr::new(suf)); - LiteralKind::FloatNumber { suffix: suffix } + LiteralKind::FloatNumber { suffix } } STRING | RAW_STRING => LiteralKind::String, 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 { impl CheckReparse { pub fn from_data(data: &[u8]) -> Option { - const PREFIX: &'static str = "fn main(){\n\t"; - const SUFFIX: &'static str = "\n}"; + const PREFIX: &str = "fn main(){\n\t"; + const SUFFIX: &str = "\n}"; let data = str::from_utf8(data).ok()?; 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> { impl<'t> TokenSource for TextTokenSource<'t> { fn current(&self) -> PToken { - return self.curr.0; + self.curr.0 } 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 { // `range` private afterwards let mut ptr = SyntaxNodePtr::new(self); ptr.range = TextRange::offset_len(ptr.range().start(), len); - return ptr.to_node(file.syntax()).to_owned(); + ptr.to_node(file.syntax()).to_owned() } 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 0x10FFFF { + if value > 0x0010_FFFF { EscapeError::OutOfRangeUnicodeEscape } else { EscapeError::LoneSurrogateUnicodeEscape -- cgit v1.2.3