Add a dedicated Future for retrieving the metadata of a file (#385)

This commit is contained in:
Jake Goulding
2018-06-18 16:00:43 -07:00
committed by Carl Lerche
parent 85cf47de86
commit b2f77dcebe
3 changed files with 49 additions and 1 deletions
+3 -1
View File
@@ -41,7 +41,9 @@ fn read_write() {
let contents = contents.clone();
File::create(file_path)
.and_then(move |file| io::write_all(file, contents))
.and_then(|file| file.metadata())
.inspect(|&(_, ref metadata)| assert!(metadata.is_file()))
.and_then(move |(file, _)| io::write_all(file, contents))
.and_then(|(mut file, _)| {
poll_fn(move || file.poll_sync_all())
})