提交 805a06ca 编写于 作者: N NODA, Kai

libstd: io::fs::File::stat() need not to take &mut self.

The same goes for sys::fs::FileDesc::fstat() on Windows.
Signed-off-by: NNODA, Kai <nodakai@gmail.com>
上级 207a5084
......@@ -237,7 +237,7 @@ pub fn eof(&self) -> bool {
}
/// 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()))
......
......@@ -131,7 +131,7 @@ pub fn truncate(&mut self, offset: i64) -> IoResult<()> {
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)),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册