mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
Add a dedicated Future for retrieving the metadata of a file (#385)
This commit is contained in:
committed by
Carl Lerche
parent
85cf47de86
commit
b2f77dcebe
@@ -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())
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user