File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -69,8 +69,7 @@ fn write(out: &Output, data: &[u8]) -> io::Result<usize> {
6969 // [1]: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1232
7070 // [2]: http://www.mail-archive.com/log4net-dev@logging.apache.org/msg00661.html
7171 const OUT_MAX : usize = 8192 ;
72- let data_len;
73- let utf16 = match str:: from_utf8 ( data) . ok ( ) {
72+ let ( utf16, data_len) = match str:: from_utf8 ( data) . ok ( ) {
7473 Some ( mut utf8) => {
7574 if utf8. len ( ) > OUT_MAX {
7675 let mut new_len = OUT_MAX ;
@@ -79,8 +78,7 @@ fn write(out: &Output, data: &[u8]) -> io::Result<usize> {
7978 }
8079 utf8 = & utf8[ ..new_len] ;
8180 }
82- data_len = utf8. len ( ) ;
83- utf8. encode_utf16 ( ) . collect :: < Vec < u16 > > ( )
81+ ( utf8. encode_utf16 ( ) . collect :: < Vec < u16 > > ( ) , utf8. len ( ) )
8482 }
8583 None => return Err ( invalid_encoding ( ) ) ,
8684 } ;
You can’t perform that action at this time.
0 commit comments