@@ -38,8 +38,8 @@ impl Name {
38
38
}
39
39
40
40
/// Shortcut to create inline plain text name
41
- const fn new_inline_ascii ( len : usize , text : & [ u8 ] ) -> Name {
42
- Name :: new_text ( SmolStr :: new_inline_from_ascii ( len, text) )
41
+ const fn new_inline_ascii ( text : & [ u8 ] ) -> Name {
42
+ Name :: new_text ( SmolStr :: new_inline_from_ascii ( text . len ( ) , text) )
43
43
}
44
44
45
45
/// Resolve a name from the text of token.
@@ -105,68 +105,70 @@ impl AsName for ra_db::Dependency {
105
105
}
106
106
107
107
// Primitives
108
- pub const ISIZE : Name = Name :: new_inline_ascii ( 5 , b"isize" ) ;
109
- pub const I8 : Name = Name :: new_inline_ascii ( 2 , b"i8" ) ;
110
- pub const I16 : Name = Name :: new_inline_ascii ( 3 , b"i16" ) ;
111
- pub const I32 : Name = Name :: new_inline_ascii ( 3 , b"i32" ) ;
112
- pub const I64 : Name = Name :: new_inline_ascii ( 3 , b"i64" ) ;
113
- pub const I128 : Name = Name :: new_inline_ascii ( 4 , b"i128" ) ;
114
- pub const USIZE : Name = Name :: new_inline_ascii ( 5 , b"usize" ) ;
115
- pub const U8 : Name = Name :: new_inline_ascii ( 2 , b"u8" ) ;
116
- pub const U16 : Name = Name :: new_inline_ascii ( 3 , b"u16" ) ;
117
- pub const U32 : Name = Name :: new_inline_ascii ( 3 , b"u32" ) ;
118
- pub const U64 : Name = Name :: new_inline_ascii ( 3 , b"u64" ) ;
119
- pub const U128 : Name = Name :: new_inline_ascii ( 4 , b"u128" ) ;
120
- pub const F32 : Name = Name :: new_inline_ascii ( 3 , b"f32" ) ;
121
- pub const F64 : Name = Name :: new_inline_ascii ( 3 , b"f64" ) ;
122
- pub const BOOL : Name = Name :: new_inline_ascii ( 4 , b"bool" ) ;
123
- pub const CHAR : Name = Name :: new_inline_ascii ( 4 , b"char" ) ;
124
- pub const STR : Name = Name :: new_inline_ascii ( 3 , b"str" ) ;
108
+ pub const ISIZE : Name = Name :: new_inline_ascii ( b"isize" ) ;
109
+ pub const I8 : Name = Name :: new_inline_ascii ( b"i8" ) ;
110
+ pub const I16 : Name = Name :: new_inline_ascii ( b"i16" ) ;
111
+ pub const I32 : Name = Name :: new_inline_ascii ( b"i32" ) ;
112
+ pub const I64 : Name = Name :: new_inline_ascii ( b"i64" ) ;
113
+ pub const I128 : Name = Name :: new_inline_ascii ( b"i128" ) ;
114
+ pub const USIZE : Name = Name :: new_inline_ascii ( b"usize" ) ;
115
+ pub const U8 : Name = Name :: new_inline_ascii ( b"u8" ) ;
116
+ pub const U16 : Name = Name :: new_inline_ascii ( b"u16" ) ;
117
+ pub const U32 : Name = Name :: new_inline_ascii ( b"u32" ) ;
118
+ pub const U64 : Name = Name :: new_inline_ascii ( b"u64" ) ;
119
+ pub const U128 : Name = Name :: new_inline_ascii ( b"u128" ) ;
120
+ pub const F32 : Name = Name :: new_inline_ascii ( b"f32" ) ;
121
+ pub const F64 : Name = Name :: new_inline_ascii ( b"f64" ) ;
122
+ pub const BOOL : Name = Name :: new_inline_ascii ( b"bool" ) ;
123
+ pub const CHAR : Name = Name :: new_inline_ascii ( b"char" ) ;
124
+ pub const STR : Name = Name :: new_inline_ascii ( b"str" ) ;
125
125
126
126
// Special names
127
- pub const SELF_PARAM : Name = Name :: new_inline_ascii ( 4 , b"self" ) ;
128
- pub const SELF_TYPE : Name = Name :: new_inline_ascii ( 4 , b"Self" ) ;
129
- pub const MACRO_RULES : Name = Name :: new_inline_ascii ( 11 , b"macro_rules" ) ;
127
+ pub const SELF_PARAM : Name = Name :: new_inline_ascii ( b"self" ) ;
128
+ pub const SELF_TYPE : Name = Name :: new_inline_ascii ( b"Self" ) ;
129
+ pub const MACRO_RULES : Name = Name :: new_inline_ascii ( b"macro_rules" ) ;
130
130
131
131
// Components of known path (value or mod name)
132
- pub const STD : Name = Name :: new_inline_ascii ( 3 , b"std" ) ;
133
- pub const ITER : Name = Name :: new_inline_ascii ( 4 , b"iter" ) ;
134
- pub const OPS : Name = Name :: new_inline_ascii ( 3 , b"ops" ) ;
135
- pub const FUTURE : Name = Name :: new_inline_ascii ( 6 , b"future" ) ;
136
- pub const RESULT : Name = Name :: new_inline_ascii ( 6 , b"result" ) ;
137
- pub const BOXED : Name = Name :: new_inline_ascii ( 5 , b"boxed" ) ;
132
+ pub const STD : Name = Name :: new_inline_ascii ( b"std" ) ;
133
+ pub const ITER : Name = Name :: new_inline_ascii ( b"iter" ) ;
134
+ pub const OPS : Name = Name :: new_inline_ascii ( b"ops" ) ;
135
+ pub const FUTURE : Name = Name :: new_inline_ascii ( b"future" ) ;
136
+ pub const RESULT : Name = Name :: new_inline_ascii ( b"result" ) ;
137
+ pub const BOXED : Name = Name :: new_inline_ascii ( b"boxed" ) ;
138
138
139
139
// Components of known path (type name)
140
- pub const INTO_ITERATOR_TYPE : Name = Name :: new_inline_ascii ( 12 , b"IntoIterator" ) ;
141
- pub const ITEM_TYPE : Name = Name :: new_inline_ascii ( 4 , b"Item" ) ;
142
- pub const TRY_TYPE : Name = Name :: new_inline_ascii ( 3 , b"Try" ) ;
143
- pub const OK_TYPE : Name = Name :: new_inline_ascii ( 2 , b"Ok" ) ;
144
- pub const FUTURE_TYPE : Name = Name :: new_inline_ascii ( 6 , b"Future" ) ;
145
- pub const RESULT_TYPE : Name = Name :: new_inline_ascii ( 6 , b"Result" ) ;
146
- pub const OUTPUT_TYPE : Name = Name :: new_inline_ascii ( 6 , b"Output" ) ;
147
- pub const TARGET_TYPE : Name = Name :: new_inline_ascii ( 6 , b"Target" ) ;
148
- pub const BOX_TYPE : Name = Name :: new_inline_ascii ( 3 , b"Box" ) ;
149
- pub const RANGE_FROM_TYPE : Name = Name :: new_inline_ascii ( 9 , b"RangeFrom" ) ;
150
- pub const RANGE_FULL_TYPE : Name = Name :: new_inline_ascii ( 9 , b"RangeFull" ) ;
151
- pub const RANGE_INCLUSIVE_TYPE : Name = Name :: new_inline_ascii ( 14 , b"RangeInclusive" ) ;
152
- pub const RANGE_TO_INCLUSIVE_TYPE : Name = Name :: new_inline_ascii ( 16 , b"RangeToInclusive" ) ;
153
- pub const RANGE_TO_TYPE : Name = Name :: new_inline_ascii ( 7 , b"RangeTo" ) ;
154
- pub const RANGE_TYPE : Name = Name :: new_inline_ascii ( 5 , b"Range" ) ;
140
+ pub const INTO_ITERATOR_TYPE : Name = Name :: new_inline_ascii ( b"IntoIterator" ) ;
141
+ pub const ITEM_TYPE : Name = Name :: new_inline_ascii ( b"Item" ) ;
142
+ pub const TRY_TYPE : Name = Name :: new_inline_ascii ( b"Try" ) ;
143
+ pub const OK_TYPE : Name = Name :: new_inline_ascii ( b"Ok" ) ;
144
+ pub const FUTURE_TYPE : Name = Name :: new_inline_ascii ( b"Future" ) ;
145
+ pub const RESULT_TYPE : Name = Name :: new_inline_ascii ( b"Result" ) ;
146
+ pub const OUTPUT_TYPE : Name = Name :: new_inline_ascii ( b"Output" ) ;
147
+ pub const TARGET_TYPE : Name = Name :: new_inline_ascii ( b"Target" ) ;
148
+ pub const BOX_TYPE : Name = Name :: new_inline_ascii ( b"Box" ) ;
149
+ pub const RANGE_FROM_TYPE : Name = Name :: new_inline_ascii ( b"RangeFrom" ) ;
150
+ pub const RANGE_FULL_TYPE : Name = Name :: new_inline_ascii ( b"RangeFull" ) ;
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 ( b"RangeToInclusive" ) ;
153
+ pub const RANGE_TO_TYPE : Name = Name :: new_inline_ascii ( b"RangeTo" ) ;
154
+ pub const RANGE_TYPE : Name = Name :: new_inline_ascii ( b"Range" ) ;
155
155
156
156
// Builtin Macros
157
- pub const FILE_MACRO : Name = Name :: new_inline_ascii ( 4 , b"file" ) ;
158
- pub const COLUMN_MACRO : Name = Name :: new_inline_ascii ( 6 , b"column" ) ;
159
- pub const COMPILE_ERROR_MACRO : Name = Name :: new_inline_ascii ( 13 , b"compile_error" ) ;
160
- pub const LINE_MACRO : Name = Name :: new_inline_ascii ( 4 , b"line" ) ;
161
- pub const STRINGIFY_MACRO : Name = Name :: new_inline_ascii ( 9 , b"stringify" ) ;
157
+ pub const FILE_MACRO : Name = Name :: new_inline_ascii ( b"file" ) ;
158
+ pub const COLUMN_MACRO : Name = Name :: new_inline_ascii ( b"column" ) ;
159
+ pub const COMPILE_ERROR_MACRO : Name = Name :: new_inline_ascii ( b"compile_error" ) ;
160
+ pub const LINE_MACRO : Name = Name :: new_inline_ascii ( b"line" ) ;
161
+ pub const STRINGIFY_MACRO : Name = Name :: new_inline_ascii ( b"stringify" ) ;
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 ( b"format_args_nl" ) ;
162
164
163
165
// Builtin derives
164
- pub const COPY_TRAIT : Name = Name :: new_inline_ascii ( 4 , b"Copy" ) ;
165
- pub const CLONE_TRAIT : Name = Name :: new_inline_ascii ( 5 , b"Clone" ) ;
166
- pub const DEFAULT_TRAIT : Name = Name :: new_inline_ascii ( 7 , b"Default" ) ;
167
- pub const DEBUG_TRAIT : Name = Name :: new_inline_ascii ( 5 , b"Debug" ) ;
168
- pub const HASH_TRAIT : Name = Name :: new_inline_ascii ( 4 , b"Hash" ) ;
169
- pub const ORD_TRAIT : Name = Name :: new_inline_ascii ( 3 , b"Ord" ) ;
170
- pub const PARTIAL_ORD_TRAIT : Name = Name :: new_inline_ascii ( 10 , b"PartialOrd" ) ;
171
- pub const EQ_TRAIT : Name = Name :: new_inline_ascii ( 2 , b"Eq" ) ;
172
- pub const PARTIAL_EQ_TRAIT : Name = Name :: new_inline_ascii ( 9 , b"PartialEq" ) ;
166
+ pub const COPY_TRAIT : Name = Name :: new_inline_ascii ( b"Copy" ) ;
167
+ pub const CLONE_TRAIT : Name = Name :: new_inline_ascii ( b"Clone" ) ;
168
+ pub const DEFAULT_TRAIT : Name = Name :: new_inline_ascii ( b"Default" ) ;
169
+ pub const DEBUG_TRAIT : Name = Name :: new_inline_ascii ( b"Debug" ) ;
170
+ pub const HASH_TRAIT : Name = Name :: new_inline_ascii ( b"Hash" ) ;
171
+ pub const ORD_TRAIT : Name = Name :: new_inline_ascii ( b"Ord" ) ;
172
+ pub const PARTIAL_ORD_TRAIT : Name = Name :: new_inline_ascii ( b"PartialOrd" ) ;
173
+ pub const EQ_TRAIT : Name = Name :: new_inline_ascii ( b"Eq" ) ;
174
+ pub const PARTIAL_EQ_TRAIT : Name = Name :: new_inline_ascii ( b"PartialEq" ) ;
0 commit comments