@@ -176,7 +176,7 @@ pub trait ReaderUtil {
176
176
fn read_bytes ( & self , len : uint ) -> ~[ u8 ] ;
177
177
178
178
/**
179
- * Reads up until a specific character or EOF.
179
+ * Reads up until a specific byte is seen or EOF.
180
180
*
181
181
* The `include` parameter specifies if the character should be included
182
182
* in the returned string.
@@ -185,7 +185,7 @@ pub trait ReaderUtil {
185
185
*
186
186
* None right now.
187
187
*/
188
- fn read_until ( & self , c : char , include : bool ) -> ~str ;
188
+ fn read_until ( & self , c : u8 , include : bool ) -> ~str ;
189
189
190
190
/**
191
191
* Reads up until the first '\n' or EOF.
@@ -577,7 +577,7 @@ impl<T:Reader> ReaderUtil for T {
577
577
bytes
578
578
}
579
579
580
- fn read_until ( & self , c : char , include : bool ) -> ~str {
580
+ fn read_until ( & self , c : u8 , include : bool ) -> ~str {
581
581
let mut bytes = ~[ ] ;
582
582
loop {
583
583
let ch = self . read_byte ( ) ;
@@ -593,7 +593,7 @@ impl<T:Reader> ReaderUtil for T {
593
593
}
594
594
595
595
fn read_line ( & self ) -> ~str {
596
- self . read_until ( '\n' , false )
596
+ self . read_until ( '\n' as u8 , false )
597
597
}
598
598
599
599
fn read_chars ( & self , n : uint ) -> ~[ char ] {
@@ -667,7 +667,7 @@ impl<T:Reader> ReaderUtil for T {
667
667
}
668
668
669
669
fn read_c_str ( & self ) -> ~str {
670
- self . read_until ( 0 as char , false )
670
+ self . read_until ( 0u8 , false )
671
671
}
672
672
673
673
fn read_whole_stream ( & self ) -> ~[ u8 ] {
@@ -693,7 +693,7 @@ impl<T:Reader> ReaderUtil for T {
693
693
// include the \n, so that we can distinguish an entirely empty
694
694
// line read after "...\n", and the trailing empty line in
695
695
// "...\n\n".
696
- let mut line = self . read_until ( '\n' , true ) ;
696
+ let mut line = self . read_until ( '\n' as u8 , true ) ;
697
697
698
698
// blank line at the end of the reader is ignored
699
699
if self . eof ( ) && line. is_empty ( ) { break ; }
0 commit comments