From 4d37eaa2b01e6f09b6d7edded74f213a458d0aba Mon Sep 17 00:00:00 2001 From: Ririsoft Date: Thu, 4 Jan 2024 13:38:42 +0100 Subject: [PATCH] stabilize to 1.0.0 API is being used for 3 years and has proven to be solid. It is time for 1.0.0. Upgrade dependencies to major versions. --- Cargo.toml | 8 ++++---- README.md | 3 +-- src/lib.rs | 8 ++++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 506b94d..2fe9768 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "async-walkdir" -version = "0.2.0" +version = "1.0.0" authors = ["Ririsoft "] edition = "2018" description = "Asynchronous directory traversal for Rust." @@ -14,8 +14,8 @@ exclude = [ "/.github/*" ] readme = "README.md" [dependencies] -futures-lite = "1.2" -async-fs = "1.1" +futures-lite = "2.1.0" +async-fs = "2.1.0" [dev-dependencies] -tempfile = "3.1.0" \ No newline at end of file +tempfile = "3.9.0" \ No newline at end of file diff --git a/README.md b/README.md index 7ed19f4..9fedfeb 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ Asynchronous directory traversal for Rust. Based on [async-fs][2] and [blocking][3], it uses a thread pool to handle blocking IOs. Please refere to those crates for the rationale. -This crate is compatible with any async runtime based on [futures 0.3][4], -which includes [tokio][5], [async-std][6] and [smol][7]. +This crate is compatible with async runtimes [tokio][5], [async-std][6], [smol][7] and potentially any runtime based on [futures 0.3][4] We do not plan to be as feature full as [Walkdir][1] crate in the synchronous world, but do not hesitate to open an issue or a PR. diff --git a/src/lib.rs b/src/lib.rs index 76518ff..6c42cf9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -166,11 +166,11 @@ where move |state| async move { match state { State::Start((root, filter)) => match read_dir(root).await { - Err(e) => return Some((Err(e), State::Done)), - Ok(rd) => return walk(vec![rd], filter).await, + Err(e) => Some((Err(e), State::Done)), + Ok(rd) => walk(vec![rd], filter).await, }, - State::Walk((dirs, filter)) => return walk(dirs, filter).await, - State::Done => return None, + State::Walk((dirs, filter)) => walk(dirs, filter).await, + State::Done => None, } }, )