close-err

Crates.ioclose-err
lib.rsclose-err
version1.0.2
sourcesrc
created_at2022-03-28 21:38:34.894523
updated_at2023-03-03 08:30:01.768701
descriptionAdd .close() to file-like types, for error handling
homepagehttps://github.com/bobrippling/close-err
repositoryhttps://github.com/bobrippling/close-err
max_upload_size
id558179
size3,697
Rob Pilling (bobrippling)

documentation

https://docs.rs/close-err

README

close-err - handle errors raised when closing file-like types

Exposes a close method on files (and similar types), to permit finer grained error handling.

Inspired by close-file, but more generic and works correctly on unix.

For example:

use std::{io, fs::File};

use close_err::Closable;

fn main() -> Result<(), io::Error> {
	let f = File::create("hi.txt")?;

	f.close()?;

	Ok(())
}
Commit count: 4

cargo fmt