diff options
author | Florian Diebold <[email protected]> | 2019-12-06 09:59:10 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-12-06 20:25:22 +0000 |
commit | 3a5aa03e66f1b46218f152f1e3e3db3bb1bd8077 (patch) | |
tree | 00a2036f4c160c3b086541135fc389027b943ab2 | |
parent | c5ffb0dc815358712a42f9358cc3538f9a7b3014 (diff) |
Remove unnecessary len parameter for Name::new_inline_ascii
I assume it was previously required because `len` was not const, but that
doesn't seem to be a problem anymore.
-rw-r--r-- | crates/ra_hir_expand/src/name.rs | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/crates/ra_hir_expand/src/name.rs b/crates/ra_hir_expand/src/name.rs index 34edf2003..4f2f702c0 100644 --- a/crates/ra_hir_expand/src/name.rs +++ b/crates/ra_hir_expand/src/name.rs | |||
@@ -38,8 +38,8 @@ impl Name { | |||
38 | } | 38 | } |
39 | 39 | ||
40 | /// Shortcut to create inline plain text name | 40 | /// Shortcut to create inline plain text name |
41 | const fn new_inline_ascii(len: usize, text: &[u8]) -> Name { | 41 | const fn new_inline_ascii(text: &[u8]) -> Name { |
42 | Name::new_text(SmolStr::new_inline_from_ascii(len, text)) | 42 | Name::new_text(SmolStr::new_inline_from_ascii(text.len(), text)) |
43 | } | 43 | } |
44 | 44 | ||
45 | /// Resolve a name from the text of token. | 45 | /// Resolve a name from the text of token. |
@@ -105,70 +105,70 @@ impl AsName for ra_db::Dependency { | |||
105 | } | 105 | } |
106 | 106 | ||
107 | // Primitives | 107 | // Primitives |
108 | pub const ISIZE: Name = Name::new_inline_ascii(5, b"isize"); | 108 | pub const ISIZE: Name = Name::new_inline_ascii(b"isize"); |
109 | pub const I8: Name = Name::new_inline_ascii(2, b"i8"); | 109 | pub const I8: Name = Name::new_inline_ascii(b"i8"); |
110 | pub const I16: Name = Name::new_inline_ascii(3, b"i16"); | 110 | pub const I16: Name = Name::new_inline_ascii(b"i16"); |
111 | pub const I32: Name = Name::new_inline_ascii(3, b"i32"); | 111 | pub const I32: Name = Name::new_inline_ascii(b"i32"); |
112 | pub const I64: Name = Name::new_inline_ascii(3, b"i64"); | 112 | pub const I64: Name = Name::new_inline_ascii(b"i64"); |
113 | pub const I128: Name = Name::new_inline_ascii(4, b"i128"); | 113 | pub const I128: Name = Name::new_inline_ascii(b"i128"); |
114 | pub const USIZE: Name = Name::new_inline_ascii(5, b"usize"); | 114 | pub const USIZE: Name = Name::new_inline_ascii(b"usize"); |
115 | pub const U8: Name = Name::new_inline_ascii(2, b"u8"); | 115 | pub const U8: Name = Name::new_inline_ascii(b"u8"); |
116 | pub const U16: Name = Name::new_inline_ascii(3, b"u16"); | 116 | pub const U16: Name = Name::new_inline_ascii(b"u16"); |
117 | pub const U32: Name = Name::new_inline_ascii(3, b"u32"); | 117 | pub const U32: Name = Name::new_inline_ascii(b"u32"); |
118 | pub const U64: Name = Name::new_inline_ascii(3, b"u64"); | 118 | pub const U64: Name = Name::new_inline_ascii(b"u64"); |
119 | pub const U128: Name = Name::new_inline_ascii(4, b"u128"); | 119 | pub const U128: Name = Name::new_inline_ascii(b"u128"); |
120 | pub const F32: Name = Name::new_inline_ascii(3, b"f32"); | 120 | pub const F32: Name = Name::new_inline_ascii(b"f32"); |
121 | pub const F64: Name = Name::new_inline_ascii(3, b"f64"); | 121 | pub const F64: Name = Name::new_inline_ascii(b"f64"); |
122 | pub const BOOL: Name = Name::new_inline_ascii(4, b"bool"); | 122 | pub const BOOL: Name = Name::new_inline_ascii(b"bool"); |
123 | pub const CHAR: Name = Name::new_inline_ascii(4, b"char"); | 123 | pub const CHAR: Name = Name::new_inline_ascii(b"char"); |
124 | pub const STR: Name = Name::new_inline_ascii(3, b"str"); | 124 | pub const STR: Name = Name::new_inline_ascii(b"str"); |
125 | 125 | ||
126 | // Special names | 126 | // Special names |
127 | pub const SELF_PARAM: Name = Name::new_inline_ascii(4, b"self"); | 127 | pub const SELF_PARAM: Name = Name::new_inline_ascii(b"self"); |
128 | pub const SELF_TYPE: Name = Name::new_inline_ascii(4, b"Self"); | 128 | pub const SELF_TYPE: Name = Name::new_inline_ascii(b"Self"); |
129 | pub const MACRO_RULES: Name = Name::new_inline_ascii(11, b"macro_rules"); | 129 | pub const MACRO_RULES: Name = Name::new_inline_ascii(b"macro_rules"); |
130 | 130 | ||
131 | // Components of known path (value or mod name) | 131 | // Components of known path (value or mod name) |
132 | pub const STD: Name = Name::new_inline_ascii(3, b"std"); | 132 | pub const STD: Name = Name::new_inline_ascii(b"std"); |
133 | pub const ITER: Name = Name::new_inline_ascii(4, b"iter"); | 133 | pub const ITER: Name = Name::new_inline_ascii(b"iter"); |
134 | pub const OPS: Name = Name::new_inline_ascii(3, b"ops"); | 134 | pub const OPS: Name = Name::new_inline_ascii(b"ops"); |
135 | pub const FUTURE: Name = Name::new_inline_ascii(6, b"future"); | 135 | pub const FUTURE: Name = Name::new_inline_ascii(b"future"); |
136 | pub const RESULT: Name = Name::new_inline_ascii(6, b"result"); | 136 | pub const RESULT: Name = Name::new_inline_ascii(b"result"); |
137 | pub const BOXED: Name = Name::new_inline_ascii(5, b"boxed"); | 137 | pub const BOXED: Name = Name::new_inline_ascii(b"boxed"); |
138 | 138 | ||
139 | // Components of known path (type name) | 139 | // Components of known path (type name) |
140 | pub const INTO_ITERATOR_TYPE: Name = Name::new_inline_ascii(12, b"IntoIterator"); | 140 | pub const INTO_ITERATOR_TYPE: Name = Name::new_inline_ascii(b"IntoIterator"); |
141 | pub const ITEM_TYPE: Name = Name::new_inline_ascii(4, b"Item"); | 141 | pub const ITEM_TYPE: Name = Name::new_inline_ascii(b"Item"); |
142 | pub const TRY_TYPE: Name = Name::new_inline_ascii(3, b"Try"); | 142 | pub const TRY_TYPE: Name = Name::new_inline_ascii(b"Try"); |
143 | pub const OK_TYPE: Name = Name::new_inline_ascii(2, b"Ok"); | 143 | pub const OK_TYPE: Name = Name::new_inline_ascii(b"Ok"); |
144 | pub const FUTURE_TYPE: Name = Name::new_inline_ascii(6, b"Future"); | 144 | pub const FUTURE_TYPE: Name = Name::new_inline_ascii(b"Future"); |
145 | pub const RESULT_TYPE: Name = Name::new_inline_ascii(6, b"Result"); | 145 | pub const RESULT_TYPE: Name = Name::new_inline_ascii(b"Result"); |
146 | pub const OUTPUT_TYPE: Name = Name::new_inline_ascii(6, b"Output"); | 146 | pub const OUTPUT_TYPE: Name = Name::new_inline_ascii(b"Output"); |
147 | pub const TARGET_TYPE: Name = Name::new_inline_ascii(6, b"Target"); | 147 | pub const TARGET_TYPE: Name = Name::new_inline_ascii(b"Target"); |
148 | pub const BOX_TYPE: Name = Name::new_inline_ascii(3, b"Box"); | 148 | pub const BOX_TYPE: Name = Name::new_inline_ascii(b"Box"); |
149 | pub const RANGE_FROM_TYPE: Name = Name::new_inline_ascii(9, b"RangeFrom"); | 149 | pub const RANGE_FROM_TYPE: Name = Name::new_inline_ascii(b"RangeFrom"); |
150 | pub const RANGE_FULL_TYPE: Name = Name::new_inline_ascii(9, b"RangeFull"); | 150 | pub const RANGE_FULL_TYPE: Name = Name::new_inline_ascii(b"RangeFull"); |
151 | pub const RANGE_INCLUSIVE_TYPE: Name = Name::new_inline_ascii(14, b"RangeInclusive"); | 151 | pub const RANGE_INCLUSIVE_TYPE: Name = Name::new_inline_ascii(b"RangeInclusive"); |
152 | pub const RANGE_TO_INCLUSIVE_TYPE: Name = Name::new_inline_ascii(16, b"RangeToInclusive"); | 152 | pub const RANGE_TO_INCLUSIVE_TYPE: Name = Name::new_inline_ascii(b"RangeToInclusive"); |
153 | pub const RANGE_TO_TYPE: Name = Name::new_inline_ascii(7, b"RangeTo"); | 153 | pub const RANGE_TO_TYPE: Name = Name::new_inline_ascii(b"RangeTo"); |
154 | pub const RANGE_TYPE: Name = Name::new_inline_ascii(5, b"Range"); | 154 | pub const RANGE_TYPE: Name = Name::new_inline_ascii(b"Range"); |
155 | 155 | ||
156 | // Builtin Macros | 156 | // Builtin Macros |
157 | pub const FILE_MACRO: Name = Name::new_inline_ascii(4, b"file"); | 157 | pub const FILE_MACRO: Name = Name::new_inline_ascii(b"file"); |
158 | pub const COLUMN_MACRO: Name = Name::new_inline_ascii(6, b"column"); | 158 | pub const COLUMN_MACRO: Name = Name::new_inline_ascii(b"column"); |
159 | pub const COMPILE_ERROR_MACRO: Name = Name::new_inline_ascii(13, b"compile_error"); | 159 | pub const COMPILE_ERROR_MACRO: Name = Name::new_inline_ascii(b"compile_error"); |
160 | pub const LINE_MACRO: Name = Name::new_inline_ascii(4, b"line"); | 160 | pub const LINE_MACRO: Name = Name::new_inline_ascii(b"line"); |
161 | pub const STRINGIFY_MACRO: Name = Name::new_inline_ascii(9, b"stringify"); | 161 | pub const STRINGIFY_MACRO: Name = Name::new_inline_ascii(b"stringify"); |
162 | pub const FORMAT_ARGS_MACRO: Name = Name::new_inline_ascii(11, b"format_args"); | 162 | pub const FORMAT_ARGS_MACRO: Name = Name::new_inline_ascii(b"format_args"); |
163 | pub const FORMAT_ARGS_NL_MACRO: Name = Name::new_inline_ascii(14, b"format_args_nl"); | 163 | pub const FORMAT_ARGS_NL_MACRO: Name = Name::new_inline_ascii(b"format_args_nl"); |
164 | 164 | ||
165 | // Builtin derives | 165 | // Builtin derives |
166 | pub const COPY_TRAIT: Name = Name::new_inline_ascii(4, b"Copy"); | 166 | pub const COPY_TRAIT: Name = Name::new_inline_ascii(b"Copy"); |
167 | pub const CLONE_TRAIT: Name = Name::new_inline_ascii(5, b"Clone"); | 167 | pub const CLONE_TRAIT: Name = Name::new_inline_ascii(b"Clone"); |
168 | pub const DEFAULT_TRAIT: Name = Name::new_inline_ascii(7, b"Default"); | 168 | pub const DEFAULT_TRAIT: Name = Name::new_inline_ascii(b"Default"); |
169 | pub const DEBUG_TRAIT: Name = Name::new_inline_ascii(5, b"Debug"); | 169 | pub const DEBUG_TRAIT: Name = Name::new_inline_ascii(b"Debug"); |
170 | pub const HASH_TRAIT: Name = Name::new_inline_ascii(4, b"Hash"); | 170 | pub const HASH_TRAIT: Name = Name::new_inline_ascii(b"Hash"); |
171 | pub const ORD_TRAIT: Name = Name::new_inline_ascii(3, b"Ord"); | 171 | pub const ORD_TRAIT: Name = Name::new_inline_ascii(b"Ord"); |
172 | pub const PARTIAL_ORD_TRAIT: Name = Name::new_inline_ascii(10, b"PartialOrd"); | 172 | pub const PARTIAL_ORD_TRAIT: Name = Name::new_inline_ascii(b"PartialOrd"); |
173 | pub const EQ_TRAIT: Name = Name::new_inline_ascii(2, b"Eq"); | 173 | pub const EQ_TRAIT: Name = Name::new_inline_ascii(b"Eq"); |
174 | pub const PARTIAL_EQ_TRAIT: Name = Name::new_inline_ascii(9, b"PartialEq"); | 174 | pub const PARTIAL_EQ_TRAIT: Name = Name::new_inline_ascii(b"PartialEq"); |