Skip to content

Commit

Permalink
libstd: io::fs::File::stat() need not to take &mut self.
Browse files Browse the repository at this point in the history
The same goes for sys::fs::FileDesc::fstat() on Windows.

Signed-off-by: NODA, Kai <nodakai@gmail.com>
  • Loading branch information
nodakai committed Dec 4, 2014
1 parent 207a508 commit 805a06c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libstd/io/fs.rs
Expand Up @@ -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()))
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/sys/windows/fs.rs
Expand Up @@ -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)),
Expand Down

0 comments on commit 805a06c

Please sign in to comment.