File tree 2 files changed +3
-30
lines changed
2 files changed +3
-30
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ encoding_rs = "0.8"
22
22
[dependencies ]
23
23
cssparser-macros = {path = " ./macros" , version = " 0.6" }
24
24
dtoa-short = " 0.3"
25
- itoa = " 0.4 "
25
+ itoa = " 1.0 "
26
26
matches = " 0.1"
27
27
phf = {version = " 0.10" , features = [" macros" ]}
28
28
serde = {version = " 1.0" , optional = true }
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ use dtoa_short::{self, Notation};
6
6
use itoa;
7
7
use matches:: matches;
8
8
use std:: fmt:: { self , Write } ;
9
- use std:: io;
10
9
use std:: str;
11
10
12
11
use super :: Token ;
@@ -342,34 +341,8 @@ macro_rules! impl_tocss_for_int {
342
341
where
343
342
W : fmt:: Write ,
344
343
{
345
- struct AssumeUtf8 <W : fmt:: Write >( W ) ;
346
-
347
- impl <W : fmt:: Write > io:: Write for AssumeUtf8 <W > {
348
- #[ inline]
349
- fn write_all( & mut self , buf: & [ u8 ] ) -> io:: Result <( ) > {
350
- // Safety: itoa only emits ASCII, which is also well-formed UTF-8.
351
- debug_assert!( buf. is_ascii( ) ) ;
352
- self . 0
353
- . write_str( unsafe { str :: from_utf8_unchecked( buf) } )
354
- . map_err( |_| io:: ErrorKind :: Other . into( ) )
355
- }
356
-
357
- #[ inline]
358
- fn write( & mut self , buf: & [ u8 ] ) -> io:: Result <usize > {
359
- self . write_all( buf) ?;
360
- Ok ( buf. len( ) )
361
- }
362
-
363
- #[ inline]
364
- fn flush( & mut self ) -> io:: Result <( ) > {
365
- Ok ( ( ) )
366
- }
367
- }
368
-
369
- match itoa:: write( AssumeUtf8 ( dest) , * self ) {
370
- Ok ( _) => Ok ( ( ) ) ,
371
- Err ( _) => Err ( fmt:: Error ) ,
372
- }
344
+ let mut buf = itoa:: Buffer :: new( ) ;
345
+ dest. write_str( buf. format( * self ) )
373
346
}
374
347
}
375
348
} ;
You can’t perform that action at this time.
0 commit comments