Created
March 4, 2015 11:48
-
-
Save sbp/95ad1f2ba51ef6bd523c to your computer and use it in GitHub Desktop.
Fails: Get len of a file, using rustc 1.0.0-dev (built 2015-02-22)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io::prelude::*; | |
use std::fs::File; | |
use std::fs::Metadata; | |
fn main() { | |
fn len() -> std::io::Result<()> { | |
let mut f = try!(File::open("len.rs")); | |
println!("{}", f.metadata().len()); | |
Ok(()) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rustc len.rs | |
len.rs:8:37: 8:42 error: type `core::result::Result<std::fs::Metadata, std::io::error::Error>` does not implement any method in scope named `len` | |
len.rs:8 println!("{}", f.metadata().len()); | |
^~~~~ | |
error: aborting due to previous error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please comment here if you can fix this issue.