diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-03-06 00:06:15 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-03-06 00:06:15 +0000 |
commit | 7e028c71662de3db935f857aa702d5fb0c36933a (patch) | |
tree | 619b140d4e933acdbc6d87f524856c1a682011ad | |
parent | e3ed216dff3e8c15d9f6b917e821e67fa65f0d95 (diff) | |
parent | de61eb3934f4b364865f66c12b1f5149e8f06958 (diff) | |
download | slab-android13-gsi.tar.gz |
Snap for 8261343 from de61eb3934f4b364865f66c12b1f5149e8f06958 to tm-releaseandroid-vts-13.0_r8android-vts-13.0_r7android-vts-13.0_r6android-vts-13.0_r5android-vts-13.0_r4android-vts-13.0_r3android-vts-13.0_r2android-vts-13.0_r1android-security-13.0.0_r9android-security-13.0.0_r8android-security-13.0.0_r7android-security-13.0.0_r6android-security-13.0.0_r5android-security-13.0.0_r4android-security-13.0.0_r3android-security-13.0.0_r2android-security-13.0.0_r17android-security-13.0.0_r16android-security-13.0.0_r15android-security-13.0.0_r14android-security-13.0.0_r13android-security-13.0.0_r12android-security-13.0.0_r11android-security-13.0.0_r10android-security-13.0.0_r1android-platform-13.0.0_r9android-platform-13.0.0_r8android-platform-13.0.0_r7android-platform-13.0.0_r6android-platform-13.0.0_r5android-platform-13.0.0_r4android-platform-13.0.0_r3android-platform-13.0.0_r2android-platform-13.0.0_r19android-platform-13.0.0_r18android-platform-13.0.0_r17android-platform-13.0.0_r16android-platform-13.0.0_r15android-platform-13.0.0_r14android-platform-13.0.0_r13android-platform-13.0.0_r12android-platform-13.0.0_r11android-platform-13.0.0_r10android-platform-13.0.0_r1android-cts-13.0_r8android-cts-13.0_r7android-cts-13.0_r6android-cts-13.0_r5android-cts-13.0_r4android-cts-13.0_r3android-cts-13.0_r2android-cts-13.0_r1android-13.0.0_r8android-13.0.0_r7android-13.0.0_r6android-13.0.0_r5android-13.0.0_r4android-13.0.0_r31android-13.0.0_r3android-13.0.0_r2android-13.0.0_r12android-13.0.0_r1android13-tests-releaseandroid13-security-releaseandroid13-s3-releaseandroid13-s2-releaseandroid13-s1-releaseandroid13-releaseandroid13-platform-releaseandroid13-gsi
Change-Id: Ibbf7f812109e14ea1407f5b81b4739e9c7ec19cf
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Android.bp | 4 | ||||
-rw-r--r-- | CHANGELOG.md | 6 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | Cargo.toml.orig | 2 | ||||
-rw-r--r-- | METADATA | 10 | ||||
-rw-r--r-- | src/lib.rs | 23 |
7 files changed, 34 insertions, 15 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 820133c..90db974 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "76d9ca4e0c0313c1eeafa691e11446906e2bb4a7" + "sha1": "c512385b1a70100c8597f0f519390c80e90c9529" } } @@ -23,7 +23,7 @@ rust_library { host_supported: true, crate_name: "slab", cargo_env_compat: true, - cargo_pkg_version: "0.4.4", + cargo_pkg_version: "0.4.5", srcs: ["src/lib.rs"], edition: "2018", features: [ @@ -44,7 +44,7 @@ rust_test { host_supported: true, crate_name: "slab", cargo_env_compat: true, - cargo_pkg_version: "0.4.4", + cargo_pkg_version: "0.4.5", srcs: ["tests/slab.rs"], test_suites: ["general-tests"], auto_gen_config: true, diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b5edd8..501a25c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.4.5 (October 13, 2021) + + * Add alternate debug output for listing items in the slab (#108) + * Fix typo in debug output of IntoIter (#109) + * Impl 'Clone' for 'Iter' (#110) + # 0.4.4 (August 06, 2021) * Fix panic in `FromIterator` impl (#102) @@ -12,7 +12,7 @@ [package] edition = "2018" name = "slab" -version = "0.4.4" +version = "0.4.5" authors = ["Carl Lerche <me@carllerche.com>"] exclude = ["/.*"] description = "Pre-allocated storage for a uniform data type" diff --git a/Cargo.toml.orig b/Cargo.toml.orig index b017ada..bc25be8 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -6,7 +6,7 @@ name = "slab" # - README.md # - Update CHANGELOG.md # - Create git tag -version = "0.4.4" +version = "0.4.5" authors = ["Carl Lerche <me@carllerche.com>"] edition = "2018" license = "MIT" @@ -7,13 +7,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/slab/slab-0.4.4.crate" + value: "https://static.crates.io/crates/slab/slab-0.4.5.crate" } - version: "0.4.4" + version: "0.4.5" license_type: NOTICE last_upgrade_date { - year: 2021 - month: 8 - day: 9 + year: 2022 + month: 3 + day: 1 } } @@ -186,6 +186,15 @@ pub struct Iter<'a, T> { len: usize, } +impl<'a, T> Clone for Iter<'a, T> { + fn clone(&self) -> Self { + Self { + entries: self.entries.clone(), + len: self.len, + } + } +} + /// A mutable iterator over the values stored in the `Slab` pub struct IterMut<'a, T> { entries: iter::Enumerate<slice::IterMut<'a, Entry<T>>>, @@ -1253,10 +1262,14 @@ where T: fmt::Debug, { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt.debug_struct("Slab") - .field("len", &self.len) - .field("cap", &self.capacity()) - .finish() + if fmt.alternate() { + fmt.debug_map().entries(self.iter()).finish() + } else { + fmt.debug_struct("Slab") + .field("len", &self.len) + .field("cap", &self.capacity()) + .finish() + } } } @@ -1265,7 +1278,7 @@ where T: fmt::Debug, { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt.debug_struct("Iter") + fmt.debug_struct("IntoIter") .field("remaining", &self.len) .finish() } |