Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump MSRV to 1.56 and Rust edition to 2021 #53

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ authors = ["Manuel Woelker <[email protected]>"]
description = "A virtual filesystem for Rust"
repository = "https://github.com/manuel-woelker/rust-vfs"
readme = "README.md"
edition = "2021"
rust-version = "1.56"
keywords = ["vfs", "virtual", "filesystem", "async"]
license = "Apache-2.0"
edition = "2021"

[badges]
travis-ci = { repository = "manuel-woelker/rust-vfs", branch = "master" }
Expand Down
4 changes: 1 addition & 3 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ impl From<VfsErrorKind> for VfsError {
let kind = match kind {
VfsErrorKind::IoError(io) => match io.kind() {
io::ErrorKind::NotFound => VfsErrorKind::FileNotFound,
// TODO: If MSRV changes to 1.53, enable this. Alternatively,
// if it's possible to #[cfg] just this line, try that
// io::ErrorKind::Unsupported => VfsErrorKind::NotSupported,
io::ErrorKind::Unsupported => VfsErrorKind::NotSupported,
_ => VfsErrorKind::IoError(io),
},
// Remaining kinda are passed through as-is
Expand Down
5 changes: 2 additions & 3 deletions src/impls/altroot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ impl AltrootFS {
}

impl AltrootFS {
#[allow(clippy::manual_strip)] // strip prefix manually for MSRV 1.32
fn path(&self, path: &str) -> VfsResult<VfsPath> {
if path.is_empty() {
return Ok(self.root.clone());
}
if path.starts_with('/') {
return self.root.join(&path[1..]);
if let Some(path) = path.strip_prefix('/') {
return self.root.join(path);
}
self.root.join(path)
}
Expand Down
2 changes: 1 addition & 1 deletion src/test_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ use super::*;
fn read_to_string_nonutf8() -> VfsResult<()> {
let root = create_root();
let path = root.join("foobar.txt")?;
path.create_file()?.write_all(&vec![0, 159, 146, 150])?;
path.create_file()?.write_all(&[0, 159, 146, 150])?;
let error_message = path.read_to_string().expect_err("read_to_string").to_string();
assert_eq!(
&error_message,
Expand Down
Loading