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> {
316
316
/// # }
317
317
/// ```
318
318
#[ 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 ( ) )
321
321
}
322
322
323
323
impl File {
@@ -3039,7 +3039,7 @@ mod tests {
3039
3039
3040
3040
let tmpdir = tmpdir ( ) ;
3041
3041
3042
- check ! ( fs:: write( & tmpdir. join( "test" ) , & bytes) ) ;
3042
+ check ! ( fs:: write( & tmpdir. join( "test" ) , & bytes[ .. ] ) ) ;
3043
3043
let v = check ! ( fs:: read( & tmpdir. join( "test" ) ) ) ;
3044
3044
assert ! ( v == & bytes[ ..] ) ;
3045
3045
You can’t perform that action at this time.
0 commit comments