File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -316,8 +316,8 @@ pub fn read_utf8<P: AsRef<Path>>(path: P) -> io::Result<String> {
316316/// # }
317317/// ```
318318#[ unstable( feature = "fs_read_write" , issue = /* FIXME */ "0" ) ]
319- pub fn write < P : AsRef < Path > > ( path : P , contents : & [ u8 ] ) -> io:: Result < ( ) > {
320- File :: create ( path) ?. write_all ( contents)
319+ pub fn write < P : AsRef < Path > , C : AsRef < [ u8 ] > > ( path : P , contents : C ) -> io:: Result < ( ) > {
320+ File :: create ( path) ?. write_all ( contents. as_ref ( ) )
321321}
322322
323323impl File {
@@ -3039,7 +3039,7 @@ mod tests {
30393039
30403040 let tmpdir = tmpdir ( ) ;
30413041
3042- check ! ( fs:: write( & tmpdir. join( "test" ) , & bytes) ) ;
3042+ check ! ( fs:: write( & tmpdir. join( "test" ) , & bytes[ .. ] ) ) ;
30433043 let v = check ! ( fs:: read( & tmpdir. join( "test" ) ) ) ;
30443044 assert ! ( v == & bytes[ ..] ) ;
30453045
You can’t perform that action at this time.
0 commit comments