diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-04-03 03:04:29 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-04-03 03:04:29 +0000 |
commit | 52d97342f340e36eba10ba479aefa903ac30a12c (patch) | |
tree | f115e489fc4c165ec9a575b2f69de53585b2f571 | |
parent | 4d6bf364320a1cff58854761d2f90a006342e316 (diff) | |
parent | 8b1f9f5665637b352708a21bd657b33a17e5fa75 (diff) | |
download | bstr-android12L-release.tar.gz |
Snap for 7256110 from 8b1f9f5665637b352708a21bd657b33a17e5fa75 to sc-v2-releaseandroid-vts-12.1_r9android-vts-12.1_r8android-vts-12.1_r7android-vts-12.1_r6android-vts-12.1_r5android-vts-12.1_r4android-vts-12.1_r3android-vts-12.1_r2android-vts-12.1_r10android-vts-12.1_r1android-platform-12.1.0_r9android-platform-12.1.0_r8android-platform-12.1.0_r7android-platform-12.1.0_r6android-platform-12.1.0_r5android-platform-12.1.0_r4android-platform-12.1.0_r3android-platform-12.1.0_r27android-platform-12.1.0_r26android-platform-12.1.0_r25android-platform-12.1.0_r24android-platform-12.1.0_r23android-platform-12.1.0_r22android-platform-12.1.0_r21android-platform-12.1.0_r20android-platform-12.1.0_r2android-platform-12.1.0_r19android-platform-12.1.0_r18android-platform-12.1.0_r17android-platform-12.1.0_r16android-platform-12.1.0_r15android-platform-12.1.0_r14android-platform-12.1.0_r13android-platform-12.1.0_r12android-platform-12.1.0_r11android-platform-12.1.0_r10android-platform-12.1.0_r1android-cts-12.1_r9android-cts-12.1_r8android-cts-12.1_r7android-cts-12.1_r6android-cts-12.1_r5android-cts-12.1_r4android-cts-12.1_r3android-cts-12.1_r2android-cts-12.1_r10android-cts-12.1_r1android-12.1.0_r6android-12.1.0_r5android-12.1.0_r4android-12.1.0_r3android-12.1.0_r27android-12.1.0_r2android-12.1.0_r1android12L-tests-releaseandroid12L-s1-releaseandroid12L-releaseandroid12L-platform-releaseandroid12L-gsi
Change-Id: I129a3d5e39bc12380ea1034b6a9b1263d28ac8d1
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Android.bp | 2 | ||||
-rw-r--r-- | Cargo.toml | 4 | ||||
-rw-r--r-- | Cargo.toml.orig | 4 | ||||
-rw-r--r-- | METADATA | 11 | ||||
-rw-r--r-- | src/impls.rs | 19 |
6 files changed, 28 insertions, 14 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 2ecf829..f1ec46c 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "7f0ad15d9628c0abec8cf6b7585539cae63e6d5b" + "sha1": "a444256ca7407fe180ee32534688549655b7a38e" } } @@ -60,7 +60,7 @@ rust_library { } // dependent_library ["feature_list"] -// byteorder-1.4.2 +// byteorder-1.4.3 // lazy_static-1.4.0 // memchr-2.3.4 "std,use_std" // regex-automata-0.1.9 @@ -12,7 +12,7 @@ [package] name = "bstr" -version = "0.2.14" +version = "0.2.15" authors = ["Andrew Gallant <jamslam@gmail.com>"] exclude = ["/.github"] description = "A string type that is not required to be valid UTF-8." @@ -46,7 +46,7 @@ version = "1.0.85" optional = true default-features = false [dev-dependencies.quickcheck] -version = "0.8.1" +version = "1" default-features = false [dev-dependencies.ucd-parse] diff --git a/Cargo.toml.orig b/Cargo.toml.orig index 63388bc..585da1b 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "bstr" -version = "0.2.14" #:version +version = "0.2.15" #:version authors = ["Andrew Gallant <jamslam@gmail.com>"] description = "A string type that is not required to be valid UTF-8." documentation = "https://docs.rs/bstr" @@ -33,7 +33,7 @@ regex-automata = { version = "0.1.5", default-features = false, optional = true serde = { version = "1.0.85", default-features = false, optional = true } [dev-dependencies] -quickcheck = { version = "0.8.1", default-features = false } +quickcheck = { version = "1", default-features = false } ucd-parse = "0.1.3" unicode-segmentation = "1.2.1" @@ -7,14 +7,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/bstr/bstr-0.2.14.crate" + value: "https://static.crates.io/crates/bstr/bstr-0.2.15.crate" } - version: "0.2.14" - # Dual-licensed, using the least restrictive per go/thirdpartylicenses#same. + version: "0.2.15" license_type: NOTICE last_upgrade_date { - year: 2020 - month: 12 - day: 21 + year: 2021 + month: 4 + day: 1 } } diff --git a/src/impls.rs b/src/impls.rs index c7d0be3..4cba48e 100644 --- a/src/impls.rs +++ b/src/impls.rs @@ -33,7 +33,7 @@ macro_rules! impl_partial_eq_cow { #[inline] fn eq(&self, other: &$lhs) -> bool { let this: &[u8] = (&**other).as_ref(); - PartialEq::eq(this, other.as_bytes()) + PartialEq::eq(this, self.as_bytes()) } } }; @@ -938,7 +938,7 @@ mod bstring_arbitrary { use quickcheck::{Arbitrary, Gen}; impl Arbitrary for BString { - fn arbitrary<G: Gen>(g: &mut G) -> BString { + fn arbitrary(g: &mut Gen) -> BString { BString::from(Vec::<u8>::arbitrary(g)) } @@ -967,3 +967,18 @@ fn test_debug() { B(&format!("{:?}", b"\xFF\xEF\xBF\xBD\xFF".as_bstr())).as_bstr(), ); } + +// See: https://github.com/BurntSushi/bstr/issues/82 +#[test] +fn test_cows_regression() { + use crate::ByteSlice; + use std::borrow::Cow; + + let c1 = Cow::from(b"hello bstr".as_bstr()); + let c2 = b"goodbye bstr".as_bstr(); + assert_ne!(c1, c2); + + let c3 = Cow::from("hello str"); + let c4 = "goodbye str"; + assert_ne!(c3, c4); +} |