File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -517,7 +517,7 @@ mod cgroups {
517517 use crate :: borrow:: Cow ;
518518 use crate :: ffi:: OsString ;
519519 use crate :: fs:: { File , exists} ;
520- use crate :: io:: { BufRead , BufReader , Read } ;
520+ use crate :: io:: { BufRead , Read } ;
521521 use crate :: os:: unix:: ffi:: OsStringExt ;
522522 use crate :: path:: { Path , PathBuf } ;
523523 use crate :: str:: from_utf8;
@@ -690,7 +690,7 @@ mod cgroups {
690690 /// If the cgroupfs is a bind mount then `group_path` is adjusted to skip
691691 /// over the already-included prefix
692692 fn find_mountpoint ( group_path : & Path ) -> Option < ( Cow < ' static , str > , & Path ) > {
693- let mut reader = BufReader :: new ( File :: open ( "/proc/self/mountinfo" ) . ok ( ) ?) ;
693+ let mut reader = File :: open_buffered ( "/proc/self/mountinfo" ) . ok ( ) ?;
694694 let mut line = String :: with_capacity ( 256 ) ;
695695 loop {
696696 line. clear ( ) ;
Original file line number Diff line number Diff line change 1818#![ doc( test( attr( deny( warnings) ) ) ) ]
1919#![ doc( rust_logo) ]
2020#![ feature( rustdoc_internals) ]
21+ #![ feature( file_buffered) ]
2122#![ feature( internal_output_capture) ]
2223#![ feature( staged_api) ]
2324#![ feature( process_exitcode_internals) ]
Original file line number Diff line number Diff line change 33use std:: collections:: HashMap ;
44use std:: fs:: File ;
55use std:: io:: prelude:: * ;
6- use std:: io:: { self , BufReader } ;
76use std:: path:: Path ;
8- use std:: { env, error, fmt} ;
7+ use std:: { env, error, fmt, io } ;
98
109use parm:: { Param , Variables , expand} ;
1110use parser:: compiled:: { msys_terminfo, parse} ;
@@ -102,8 +101,7 @@ impl TermInfo {
102101 }
103102 // Keep the metadata small
104103 fn _from_path ( path : & Path ) -> Result < TermInfo , Error > {
105- let file = File :: open ( path) . map_err ( Error :: IoError ) ?;
106- let mut reader = BufReader :: new ( file) ;
104+ let mut reader = File :: open_buffered ( path) . map_err ( Error :: IoError ) ?;
107105 parse ( & mut reader, false ) . map_err ( Error :: MalformedTerminfo )
108106 }
109107}
You can’t perform that action at this time.
0 commit comments