Skip to content

Commit

Permalink
Update to edition 2018
Browse files Browse the repository at this point in the history
  • Loading branch information
rbtcollins committed Aug 15, 2020
1 parent 775feb1 commit 79d0b91
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
19 changes: 10 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
[package]
authors = ["Aaronepower <theaaronepower@gmail.com>"]
categories = ["filesystem"]
description = "A safe, reliable implementation of remove_dir_all for Windows"
edition = "2018"
include = [
"Cargo.toml",
"LICENCE-APACHE",
"LICENCE-MIT",
"src/**/*",
"README.md"
"Cargo.toml",
"LICENCE-APACHE",
"LICENCE-MIT",
"src/**/*",
"README.md",
]
keywords = ["utility", "filesystem", "remove_dir", "windows"]
license = "MIT/Apache-2.0"
name = "remove_dir_all"
readme = "README.md"
repository = "https://github.com/XAMPPRocky/remove_dir_all.git"
version = "0.5.3"
keywords = ["utility", "filesystem", "remove_dir", "windows"]
categories = ["filesystem"]

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["std", "errhandlingapi", "winerror", "fileapi", "winbase"]}
winapi = {version = "0.3", features = ["std", "errhandlingapi", "winerror", "fileapi", "winbase"]}

[dev-dependencies]
doc-comment = "0.3"
doc-comment = "0.3"
6 changes: 3 additions & 3 deletions src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub fn remove_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
}
}

fn remove_item(path: &Path, ctx: &mut RmdirContext) -> io::Result<()> {
fn remove_item(path: &Path, ctx: &mut RmdirContext<'_>) -> io::Result<()> {
if ctx.readonly {
// remove read-only permision
let mut permissions = path.metadata()?.permissions();
Expand Down Expand Up @@ -149,7 +149,7 @@ fn remove_item(path: &Path, ctx: &mut RmdirContext) -> io::Result<()> {
Ok(())
}

fn move_item(file: &File, ctx: &mut RmdirContext) -> io::Result<()> {
fn move_item(file: &File, ctx: &mut RmdirContext<'_>) -> io::Result<()> {
let mut tmpname = ctx.base_dir.join(format! {"rm-{}", ctx.counter});
ctx.counter += 1;

Expand Down Expand Up @@ -213,7 +213,7 @@ fn get_path(f: &File) -> io::Result<PathBuf> {
)
}

fn remove_dir_all_recursive(path: &Path, ctx: &mut RmdirContext) -> io::Result<()> {
fn remove_dir_all_recursive(path: &Path, ctx: &mut RmdirContext<'_>) -> io::Result<()> {
let dir_readonly = ctx.readonly;
for child in fs::read_dir(path)? {
let child = child?;
Expand Down
4 changes: 1 addition & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
#![deny(missing_debug_implementations)]
#![deny(missing_docs)]

#[cfg(windows)]
extern crate winapi;
#![deny(rust_2018_idioms)]

#[cfg(doctest)]
#[macro_use]
Expand Down

0 comments on commit 79d0b91

Please sign in to comment.