diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-12-21 06:12:36 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-12-21 06:12:36 +0000 |
commit | 1cbef27ff857803fbee123e6730b83e1ef154f6c (patch) | |
tree | 7d45ce377fb8f4c7019bb74381228b94f397110f /crates/ra_ide/src/syntax_highlighting.rs | |
parent | 6eab968c601637361e8fbd1ee93ded1b0d967bee (diff) | |
parent | 0d5d63a80ea08f2af439bcc72fff9b24d144c70d (diff) |
Merge #2625
2625: Clippy lints r=matklad a=kjeremy
Co-authored-by: kjeremy <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/syntax_highlighting.rs')
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting.rs | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index 657c7b21a..0228ee7e9 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs | |||
@@ -17,31 +17,31 @@ use crate::{ | |||
17 | }; | 17 | }; |
18 | 18 | ||
19 | pub mod tags { | 19 | pub mod tags { |
20 | pub(crate) const FIELD: &'static str = "field"; | 20 | pub(crate) const FIELD: &str = "field"; |
21 | pub(crate) const FUNCTION: &'static str = "function"; | 21 | pub(crate) const FUNCTION: &str = "function"; |
22 | pub(crate) const MODULE: &'static str = "module"; | 22 | pub(crate) const MODULE: &str = "module"; |
23 | pub(crate) const TYPE: &'static str = "type"; | 23 | pub(crate) const TYPE: &str = "type"; |
24 | pub(crate) const CONSTANT: &'static str = "constant"; | 24 | pub(crate) const CONSTANT: &str = "constant"; |
25 | pub(crate) const MACRO: &'static str = "macro"; | 25 | pub(crate) const MACRO: &str = "macro"; |
26 | pub(crate) const VARIABLE: &'static str = "variable"; | 26 | pub(crate) const VARIABLE: &str = "variable"; |
27 | pub(crate) const VARIABLE_MUT: &'static str = "variable.mut"; | 27 | pub(crate) const VARIABLE_MUT: &str = "variable.mut"; |
28 | pub(crate) const TEXT: &'static str = "text"; | 28 | pub(crate) const TEXT: &str = "text"; |
29 | 29 | ||
30 | pub(crate) const TYPE_BUILTIN: &'static str = "type.builtin"; | 30 | pub(crate) const TYPE_BUILTIN: &str = "type.builtin"; |
31 | pub(crate) const TYPE_SELF: &'static str = "type.self"; | 31 | pub(crate) const TYPE_SELF: &str = "type.self"; |
32 | pub(crate) const TYPE_PARAM: &'static str = "type.param"; | 32 | pub(crate) const TYPE_PARAM: &str = "type.param"; |
33 | pub(crate) const TYPE_LIFETIME: &'static str = "type.lifetime"; | 33 | pub(crate) const TYPE_LIFETIME: &str = "type.lifetime"; |
34 | 34 | ||
35 | pub(crate) const LITERAL_BYTE: &'static str = "literal.byte"; | 35 | pub(crate) const LITERAL_BYTE: &str = "literal.byte"; |
36 | pub(crate) const LITERAL_NUMERIC: &'static str = "literal.numeric"; | 36 | pub(crate) const LITERAL_NUMERIC: &str = "literal.numeric"; |
37 | pub(crate) const LITERAL_CHAR: &'static str = "literal.char"; | 37 | pub(crate) const LITERAL_CHAR: &str = "literal.char"; |
38 | pub(crate) const LITERAL_COMMENT: &'static str = "comment"; | 38 | pub(crate) const LITERAL_COMMENT: &str = "comment"; |
39 | pub(crate) const LITERAL_STRING: &'static str = "string"; | 39 | pub(crate) const LITERAL_STRING: &str = "string"; |
40 | pub(crate) const LITERAL_ATTRIBUTE: &'static str = "attribute"; | 40 | pub(crate) const LITERAL_ATTRIBUTE: &str = "attribute"; |
41 | 41 | ||
42 | pub(crate) const KEYWORD_UNSAFE: &'static str = "keyword.unsafe"; | 42 | pub(crate) const KEYWORD_UNSAFE: &str = "keyword.unsafe"; |
43 | pub(crate) const KEYWORD_CONTROL: &'static str = "keyword.control"; | 43 | pub(crate) const KEYWORD_CONTROL: &str = "keyword.control"; |
44 | pub(crate) const KEYWORD: &'static str = "keyword"; | 44 | pub(crate) const KEYWORD: &str = "keyword"; |
45 | } | 45 | } |
46 | 46 | ||
47 | #[derive(Debug)] | 47 | #[derive(Debug)] |
@@ -258,9 +258,7 @@ fn highlight_name(db: &RootDatabase, name_kind: NameKind) -> &'static str { | |||
258 | SelfType(_) => tags::TYPE_SELF, | 258 | SelfType(_) => tags::TYPE_SELF, |
259 | TypeParam(_) => tags::TYPE_PARAM, | 259 | TypeParam(_) => tags::TYPE_PARAM, |
260 | Local(local) => { | 260 | Local(local) => { |
261 | if local.is_mut(db) { | 261 | if local.is_mut(db) || local.ty(db).is_mutable_reference() { |
262 | tags::VARIABLE_MUT | ||
263 | } else if local.ty(db).is_mutable_reference() { | ||
264 | tags::VARIABLE_MUT | 262 | tags::VARIABLE_MUT |
265 | } else { | 263 | } else { |
266 | tags::VARIABLE | 264 | tags::VARIABLE |