pub fn append_current_dir(path: &Path, cwd: &Path) -> CargoResult<()> {
    debug!("appending {} <- {}", path.display(), cwd.display());
    let mut f = try!(OpenOptions::new().read(true).write(true).open(path));
    let mut contents = Vec::new();
    try!(f.read_to_end(&mut contents));
    try!(f.seek(SeekFrom::Start(0)));
    try!(f.write_all(try!(util::path2bytes(cwd))));
    try!(f.write_all(&[0]));
    try!(f.write_all(&contents));
    Ok(())
}
// The dep-info files emitted by the compiler all have their listed paths
// relative to whatever the current directory was at the time that the compiler
// was invoked. As the current directory may change over time, we need to record
// what that directory was at the beginning of the file so we can know about it
// next time.
The dep-info files emitted by the compiler all have their listed paths
relative to whatever the current directory was at the time that the compiler
was invoked. As the current directory may change over time, we need to record
what that directory was at the beginning of the file so we can know about it
next time.
The dep - info files emitted by the compiler all have their listed paths relative to whatever the current directory was at the time that the compiler was invoked . As the current directory may change over time we need to record what that directory was at the beginning of the file so we can know about it next time .
pub fn append_current_dir(path: &Path, cwd: &Path) -> CargoResult<()> {
    debug!("appending {} <- {}", path.display(), cwd.display());
    let mut f = try!(OpenOptions::new().read(true).write(true).open(path));
    let mut contents = Vec::new();
    try!(f.read_to_end(&mut contents));
    try!(f.seek(SeekFrom::Start(0)));
    try!(f.write_all(try!(util::path2bytes(cwd))));
    try!(f.write_all(&[0]));
    try!(f.write_all(&contents));
    Ok(())
}
pub fn append_current_dir ( path : & Path , cwd : & Path ) -> CargoResult < ( ) > { debug ! ( " " path display ( ) cwd display ( ) ) ; let mut f = try ! ( OpenOptions new ( ) read ( true ) write ( true ) open ( path ) ) ; let mut contents = Vec :: new ( ) ; try ! ( f read_to_end ( mut contents ) ) ; try ! ( f seek ( SeekFrom Start ( 0 ) ) ) ; try ! ( f write_all ( try ( util path2bytes ( cwd ) ) ) ) ; try ! ( f write_all ( [ 0 ] ) ) ; try ! ( f write_all ( contents ) ) ; Ok ( ( ) ) }
The dep-info files emitted by the compiler all have their listed paths
relative to whatever the current directory was at the time that the compiler
was invoked.
The dep - info files emitted by the compiler all have their listed paths relative to whatever the current directory was at the time that the compiler was invoked .
path
&Path
cwd
&Path
path
&Path
cwd
&Path