ystd 0.0.11

An opinionated and batteries included `std` mirror for convenient, correct code and pleasant error messages
Documentation
use crate::{error::ReportedError, io, prelude::*};

pub async fn current_dir() -> io::Result<Utf8PathBuf> {
	io::asyncify(|| {
		std::env::current_dir()
			.map_err(|io| {
				let io = Arc::new(io);
				io::Error {
					report: Report::new(io.clone()).wrap_err("ystd::env::current_dir()"),
					inner: Some(io),
				}
			})
			.and_then(|path| {
				Utf8PathBuf::try_from(path.clone())
					.wrap_reported_err(format!("ystd::env::current_dir -> {:?}", path))
					.map_err(ReportedError::erase_inner)
			})
	})
	.await
}