16
16
#![ warn( unreachable_pub) ]
17
17
// tidy-alphabetical-end
18
18
19
- use std:: { iter, str, string} ;
20
-
21
19
pub use Alignment :: * ;
22
20
pub use Count :: * ;
23
21
pub use Piece :: * ;
@@ -205,11 +203,11 @@ pub enum Count<'a> {
205
203
}
206
204
207
205
pub struct ParseError {
208
- pub description : string :: String ,
209
- pub note : Option < string :: String > ,
210
- pub label : string :: String ,
206
+ pub description : String ,
207
+ pub note : Option < String > ,
208
+ pub label : String ,
211
209
pub span : InnerSpan ,
212
- pub secondary_label : Option < ( string :: String , InnerSpan ) > ,
210
+ pub secondary_label : Option < ( String , InnerSpan ) > ,
213
211
pub suggestion : Suggestion ,
214
212
}
215
213
@@ -225,7 +223,7 @@ pub enum Suggestion {
225
223
/// `format!("{foo:?#}")` -> `format!("{foo:#?}")`
226
224
/// `format!("{foo:?x}")` -> `format!("{foo:x?}")`
227
225
/// `format!("{foo:?X}")` -> `format!("{foo:X?}")`
228
- ReorderFormatParameter ( InnerSpan , string :: String ) ,
226
+ ReorderFormatParameter ( InnerSpan , String ) ,
229
227
}
230
228
231
229
/// The parser structure for interpreting the input format string. This is
@@ -237,7 +235,7 @@ pub enum Suggestion {
237
235
pub struct Parser < ' a > {
238
236
mode : ParseMode ,
239
237
input : & ' a str ,
240
- cur : iter:: Peekable < str:: CharIndices < ' a > > ,
238
+ cur : std :: iter:: Peekable < std :: str:: CharIndices < ' a > > ,
241
239
/// Error messages accumulated during parsing
242
240
pub errors : Vec < ParseError > ,
243
241
/// Current position of implicit positional argument pointer
@@ -336,7 +334,7 @@ impl<'a> Parser<'a> {
336
334
pub fn new (
337
335
s : & ' a str ,
338
336
style : Option < usize > ,
339
- snippet : Option < string :: String > ,
337
+ snippet : Option < String > ,
340
338
append_newline : bool ,
341
339
mode : ParseMode ,
342
340
) -> Parser < ' a > {
@@ -366,7 +364,7 @@ impl<'a> Parser<'a> {
366
364
/// Notifies of an error. The message doesn't actually need to be of type
367
365
/// String, but I think it does when this eventually uses conditions so it
368
366
/// might as well start using it now.
369
- fn err < S1 : Into < string :: String > , S2 : Into < string :: String > > (
367
+ fn err < S1 : Into < String > , S2 : Into < String > > (
370
368
& mut self ,
371
369
description : S1 ,
372
370
label : S2 ,
@@ -385,11 +383,7 @@ impl<'a> Parser<'a> {
385
383
/// Notifies of an error. The message doesn't actually need to be of type
386
384
/// String, but I think it does when this eventually uses conditions so it
387
385
/// might as well start using it now.
388
- fn err_with_note <
389
- S1 : Into < string:: String > ,
390
- S2 : Into < string:: String > ,
391
- S3 : Into < string:: String > ,
392
- > (
386
+ fn err_with_note < S1 : Into < String > , S2 : Into < String > , S3 : Into < String > > (
393
387
& mut self ,
394
388
description : S1 ,
395
389
label : S2 ,
@@ -974,7 +968,7 @@ impl<'a> Parser<'a> {
974
968
/// in order to properly synthesise the intra-string `Span`s for error diagnostics.
975
969
fn find_width_map_from_snippet (
976
970
input : & str ,
977
- snippet : Option < string :: String > ,
971
+ snippet : Option < String > ,
978
972
str_style : Option < usize > ,
979
973
) -> InputStringKind {
980
974
let snippet = match snippet {
@@ -1089,8 +1083,8 @@ fn find_width_map_from_snippet(
1089
1083
InputStringKind :: Literal { width_mappings }
1090
1084
}
1091
1085
1092
- fn unescape_string ( string : & str ) -> Option < string :: String > {
1093
- let mut buf = string :: String :: new ( ) ;
1086
+ fn unescape_string ( string : & str ) -> Option < String > {
1087
+ let mut buf = String :: new ( ) ;
1094
1088
let mut ok = true ;
1095
1089
unescape:: unescape_unicode ( string, unescape:: Mode :: Str , & mut |_, unescaped_char| {
1096
1090
match unescaped_char {
0 commit comments