@@ -327,11 +327,11 @@ pub fn read_method<R: Reader>(stream: &mut R) -> HttpResult<method::Method> {
327
327
let mut buf = [ SP , ..16 ] ;
328
328
329
329
if !try!( read_until_space ( stream, & mut buf) ) {
330
- return Err ( HttpMethodError ) ;
330
+ return Err ( HttpMethodError ) ;
331
331
}
332
332
333
333
debug ! ( "method buf = {}" , buf[ ] . to_ascii( ) ) ;
334
-
334
+
335
335
let maybe_method = match buf[ 0 ..7 ] {
336
336
b"GET " => Some ( method:: Method :: Get ) ,
337
337
b"PUT " => Some ( method:: Method :: Put ) ,
@@ -349,7 +349,7 @@ pub fn read_method<R: Reader>(stream: &mut R) -> HttpResult<method::Method> {
349
349
350
350
match ( maybe_method, buf[ ] ) {
351
351
( Some ( method) , _) => Ok ( method) ,
352
- ( None , ext) if is_valid_method ( buf) => {
352
+ ( None , ext) if is_valid_method ( & buf) => {
353
353
use std:: str:: raw;
354
354
// We already checked that the buffer is ASCII
355
355
Ok ( method:: Method :: Extension ( unsafe { raw:: from_utf8 ( ext) } . trim ( ) . into_string ( ) ) )
@@ -629,7 +629,7 @@ mod tests {
629
629
fn mem ( s : & str ) -> MemReader {
630
630
MemReader :: new ( s. as_bytes ( ) . to_vec ( ) )
631
631
}
632
-
632
+
633
633
#[ test]
634
634
fn test_read_method ( ) {
635
635
fn read ( s : & str , m : method:: Method ) {
0 commit comments