aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Vander Stoep <jeffv@google.com>2023-03-31 02:15:59 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-03-31 02:15:59 +0000
commitb450b48e938cdb778813eb4a26a35bbbe487d7d2 (patch)
treec9a3edffcf31edbc266dfd257edf3de1cebf443a
parent5d95b80dec2f81f503b56f58d153dbd7867dcc12 (diff)
parentfa6ed47d3161a18c23f337c80be63f898745fa60 (diff)
downloadwalkdir-b450b48e938cdb778813eb4a26a35bbbe487d7d2.tar.gz
Upgrade walkdir to 2.3.3 am: 53570cfb43 am: fa6ed47d31emu-33-dev
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/walkdir/+/2513597 Change-Id: I3737cd932e98f7b258a6073f1a93d037b369037f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--.cargo_vcs_info.json7
-rw-r--r--Android.bp2
-rw-r--r--Cargo.toml30
-rw-r--r--Cargo.toml.orig6
-rw-r--r--METADATA14
-rw-r--r--src/dent.rs37
-rw-r--r--src/error.rs11
-rw-r--r--src/lib.rs6
8 files changed, 48 insertions, 65 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 430f9d6..6fd8d24 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,6 @@
{
"git": {
- "sha1": "abf3a15887758e0af54ebca827c7b6f8b311cb45"
- }
-}
+ "sha1": "1547668537df06ebc4a708d2048e676e1de4fa91"
+ },
+ "path_in_vcs": ""
+} \ No newline at end of file
diff --git a/Android.bp b/Android.bp
index 9792d67..f22d6b6 100644
--- a/Android.bp
+++ b/Android.bp
@@ -42,7 +42,7 @@ rust_library {
host_supported: true,
crate_name: "walkdir",
cargo_env_compat: true,
- cargo_pkg_version: "2.3.2",
+ cargo_pkg_version: "2.3.3",
srcs: ["src/lib.rs"],
edition: "2018",
rustlibs: [
diff --git a/Cargo.toml b/Cargo.toml
index 49c6662..7db9263 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,37 +3,45 @@
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
-# to registry (e.g., crates.io) dependencies
+# to registry (e.g., crates.io) dependencies.
#
-# If you believe there's an error in this file please file an
-# issue against the rust-lang/cargo repository. If you're
-# editing this file be aware that the upstream Cargo.toml
-# will likely look very different (and much more reasonable)
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
[package]
edition = "2018"
name = "walkdir"
-version = "2.3.2"
+version = "2.3.3"
authors = ["Andrew Gallant <jamslam@gmail.com>"]
-exclude = ["/ci/*", "/.travis.yml", "/appveyor.yml"]
+exclude = [
+ "/ci/*",
+ "/.travis.yml",
+ "/appveyor.yml",
+]
description = "Recursively walk a directory."
homepage = "https://github.com/BurntSushi/walkdir"
documentation = "https://docs.rs/walkdir/"
readme = "README.md"
-keywords = ["directory", "recursive", "walk", "iterator"]
+keywords = [
+ "directory",
+ "recursive",
+ "walk",
+ "iterator",
+]
categories = ["filesystem"]
license = "Unlicense/MIT"
repository = "https://github.com/BurntSushi/walkdir"
+
[dependencies.same-file]
version = "1.0.1"
+
[dev-dependencies.doc-comment]
version = "0.3"
-[target."cfg(windows)".dependencies.winapi]
-version = "0.3"
-features = ["std", "winnt"]
[target."cfg(windows)".dependencies.winapi-util]
version = "0.1.1"
+
[badges.appveyor]
repository = "BurntSushi/walkdir"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index c71c2fe..0f4faa6 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,6 +1,6 @@
[package]
name = "walkdir"
-version = "2.3.2" #:version
+version = "2.3.3" #:version
authors = ["Andrew Gallant <jamslam@gmail.com>"]
description = "Recursively walk a directory."
documentation = "https://docs.rs/walkdir/"
@@ -23,10 +23,6 @@ members = ["walkdir-list"]
[dependencies]
same-file = "1.0.1"
-[target.'cfg(windows)'.dependencies.winapi]
-version = "0.3"
-features = ["std", "winnt"]
-
[target.'cfg(windows)'.dependencies.winapi-util]
version = "0.1.1"
diff --git a/METADATA b/METADATA
index 42088b4..e37eab0 100644
--- a/METADATA
+++ b/METADATA
@@ -1,3 +1,7 @@
+# This project was upgraded with external_updater.
+# Usage: tools/external_updater/updater.sh update rust/crates/walkdir
+# For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md
+
name: "walkdir"
description: "Recursively walk a directory."
third_party {
@@ -7,13 +11,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/walkdir/walkdir-2.3.2.crate"
+ value: "https://static.crates.io/crates/walkdir/walkdir-2.3.3.crate"
}
- version: "2.3.2"
+ version: "2.3.3"
license_type: NOTICE
last_upgrade_date {
- year: 2021
- month: 4
- day: 2
+ year: 2023
+ month: 3
+ day: 30
}
}
diff --git a/src/dent.rs b/src/dent.rs
index a28ed3d..adf54f7 100644
--- a/src/dent.rs
+++ b/src/dent.rs
@@ -177,18 +177,6 @@ impl DirEntry {
}
/// Returns true if and only if this entry points to a directory.
- ///
- /// This works around a bug in Rust's standard library:
- /// https://github.com/rust-lang/rust/issues/46484
- #[cfg(windows)]
- pub(crate) fn is_dir(&self) -> bool {
- use std::os::windows::fs::MetadataExt;
- use winapi::um::winnt::FILE_ATTRIBUTE_DIRECTORY;
- self.metadata.file_attributes() & FILE_ATTRIBUTE_DIRECTORY != 0
- }
-
- /// Returns true if and only if this entry points to a directory.
- #[cfg(not(windows))]
pub(crate) fn is_dir(&self) -> bool {
self.ty.is_dir()
}
@@ -205,13 +193,7 @@ impl DirEntry {
let md = ent
.metadata()
.map_err(|err| Error::from_path(depth, path.clone(), err))?;
- Ok(DirEntry {
- path: path,
- ty: ty,
- follow_link: false,
- depth: depth,
- metadata: md,
- })
+ Ok(DirEntry { path, ty, follow_link: false, depth, metadata: md })
}
#[cfg(unix)]
@@ -226,9 +208,9 @@ impl DirEntry {
.map_err(|err| Error::from_path(depth, ent.path(), err))?;
Ok(DirEntry {
path: ent.path(),
- ty: ty,
+ ty,
follow_link: false,
- depth: depth,
+ depth,
ino: ent.ino(),
})
}
@@ -241,12 +223,7 @@ impl DirEntry {
let ty = ent
.file_type()
.map_err(|err| Error::from_path(depth, ent.path(), err))?;
- Ok(DirEntry {
- path: ent.path(),
- ty: ty,
- follow_link: false,
- depth: depth,
- })
+ Ok(DirEntry { path: ent.path(), ty, follow_link: false, depth })
}
#[cfg(windows)]
@@ -266,7 +243,7 @@ impl DirEntry {
path: pb,
ty: md.file_type(),
follow_link: follow,
- depth: depth,
+ depth,
metadata: md,
})
}
@@ -290,7 +267,7 @@ impl DirEntry {
path: pb,
ty: md.file_type(),
follow_link: follow,
- depth: depth,
+ depth,
ino: md.ino(),
})
}
@@ -312,7 +289,7 @@ impl DirEntry {
path: pb,
ty: md.file_type(),
follow_link: follow,
- depth: depth,
+ depth,
})
}
}
diff --git a/src/error.rs b/src/error.rs
index 9e25a07..3342d9b 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -164,10 +164,7 @@ impl Error {
pb: PathBuf,
err: io::Error,
) -> Self {
- Error {
- depth: depth,
- inner: ErrorInner::Io { path: Some(pb), err: err },
- }
+ Error { depth, inner: ErrorInner::Io { path: Some(pb), err } }
}
pub(crate) fn from_entry(dent: &DirEntry, err: io::Error) -> Self {
@@ -175,13 +172,13 @@ impl Error {
depth: dent.depth(),
inner: ErrorInner::Io {
path: Some(dent.path().to_path_buf()),
- err: err,
+ err,
},
}
}
pub(crate) fn from_io(depth: usize, err: io::Error) -> Self {
- Error { depth: depth, inner: ErrorInner::Io { path: None, err: err } }
+ Error { depth, inner: ErrorInner::Io { path: None, err } }
}
pub(crate) fn from_loop(
@@ -190,7 +187,7 @@ impl Error {
child: &Path,
) -> Self {
Error {
- depth: depth,
+ depth,
inner: ErrorInner::Loop {
ancestor: ancestor.to_path_buf(),
child: child.to_path_buf(),
diff --git a/src/lib.rs b/src/lib.rs
index 929c565..4d41515 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -601,7 +601,7 @@ impl Ancestor {
#[cfg(windows)]
fn new(dent: &DirEntry) -> io::Result<Ancestor> {
let handle = Handle::from_path(dent.path())?;
- Ok(Ancestor { path: dent.path().to_path_buf(), handle: handle })
+ Ok(Ancestor { path: dent.path().to_path_buf(), handle })
}
/// Create a new ancestor from the given directory path.
@@ -811,7 +811,7 @@ impl IntoIter {
where
P: FnMut(&DirEntry) -> bool,
{
- FilterEntry { it: self, predicate: predicate }
+ FilterEntry { it: self, predicate }
}
fn handle_entry(
@@ -1109,7 +1109,7 @@ where
/// [`min_depth`]: struct.WalkDir.html#method.min_depth
/// [`max_depth`]: struct.WalkDir.html#method.max_depth
pub fn filter_entry(self, predicate: P) -> FilterEntry<Self, P> {
- FilterEntry { it: self, predicate: predicate }
+ FilterEntry { it: self, predicate }
}
/// Skips the current directory.