diff options
| author | NODA, Kai <nodakai@gmail.com> | 2014-11-25 22:12:24 +0800 |
|---|---|---|
| committer | NODA, Kai <nodakai@gmail.com> | 2014-12-04 11:19:55 +0800 |
| commit | 805a06ca6a4f0999e13508e6271e3589f2c4c1b2 (patch) | |
| tree | 6ddef978bfeb713ec41d7636ef2439bdf7b2ef29 /src/libstd | |
| parent | 207a5084110d106149f7aba96603abba5850fdcb (diff) | |
| download | rust-805a06ca6a4f0999e13508e6271e3589f2c4c1b2.tar.gz rust-805a06ca6a4f0999e13508e6271e3589f2c4c1b2.zip | |
libstd: io::fs::File::stat() need not to take &mut self.
The same goes for sys::fs::FileDesc::fstat() on Windows. Signed-off-by: NODA, Kai <nodakai@gmail.com>
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/fs.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/fs.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/io/fs.rs b/src/libstd/io/fs.rs index bd334f52628..d5f23694fc8 100644 --- a/src/libstd/io/fs.rs +++ b/src/libstd/io/fs.rs @@ -237,7 +237,7 @@ impl File { } /// Queries information about the underlying file. - pub fn stat(&mut self) -> IoResult<FileStat> { + pub fn stat(&self) -> IoResult<FileStat> { self.fd.fstat() .update_err("couldn't fstat file", |e| format!("{}; path={}", e, self.path.display())) diff --git a/src/libstd/sys/windows/fs.rs b/src/libstd/sys/windows/fs.rs index 9c4ffb926b5..9402c63dcf5 100644 --- a/src/libstd/sys/windows/fs.rs +++ b/src/libstd/sys/windows/fs.rs @@ -131,7 +131,7 @@ impl FileDesc { return ret; } - pub fn fstat(&mut self) -> IoResult<io::FileStat> { + pub fn fstat(&self) -> IoResult<io::FileStat> { let mut stat: libc::stat = unsafe { mem::zeroed() }; match unsafe { libc::fstat(self.fd(), &mut stat) } { 0 => Ok(mkstat(&stat)), |
