diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-04-03 03:04:23 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-04-03 03:04:23 +0000 |
commit | 35088cc33c813b3ca94d528bea1a5d444d4541c3 (patch) | |
tree | f115e489fc4c165ec9a575b2f69de53585b2f571 | |
parent | 1ee97b140767d08cf751ae38173fe20f4a7454e6 (diff) | |
parent | 8b1f9f5665637b352708a21bd657b33a17e5fa75 (diff) | |
download | bstr-35088cc33c813b3ca94d528bea1a5d444d4541c3.tar.gz |
Snap for 7256110 from 8b1f9f5665637b352708a21bd657b33a17e5fa75 to sc-releaseandroid-vts-12.0_r9android-vts-12.0_r8android-vts-12.0_r7android-vts-12.0_r6android-vts-12.0_r5android-vts-12.0_r4android-vts-12.0_r3android-vts-12.0_r2android-vts-12.0_r12android-vts-12.0_r11android-vts-12.0_r10android-vts-12.0_r1android-security-12.0.0_r60android-security-12.0.0_r59android-security-12.0.0_r58android-security-12.0.0_r57android-security-12.0.0_r56android-security-12.0.0_r55android-security-12.0.0_r54android-security-12.0.0_r53android-security-12.0.0_r52android-security-12.0.0_r51android-security-12.0.0_r50android-security-12.0.0_r49android-security-12.0.0_r48android-security-12.0.0_r47android-security-12.0.0_r46android-security-12.0.0_r45android-security-12.0.0_r44android-security-12.0.0_r43android-security-12.0.0_r42android-security-12.0.0_r41android-security-12.0.0_r40android-security-12.0.0_r39android-security-12.0.0_r38android-security-12.0.0_r37android-security-12.0.0_r36android-security-12.0.0_r35android-security-12.0.0_r34android-security-11.0.0_r71android-platform-12.0.0_r9android-platform-12.0.0_r8android-platform-12.0.0_r7android-platform-12.0.0_r6android-platform-12.0.0_r5android-platform-12.0.0_r4android-platform-12.0.0_r32android-platform-12.0.0_r31android-platform-12.0.0_r30android-platform-12.0.0_r3android-platform-12.0.0_r29android-platform-12.0.0_r28android-platform-12.0.0_r27android-platform-12.0.0_r26android-platform-12.0.0_r25android-platform-12.0.0_r24android-platform-12.0.0_r23android-platform-12.0.0_r22android-platform-12.0.0_r21android-platform-12.0.0_r20android-platform-12.0.0_r2android-platform-12.0.0_r19android-platform-12.0.0_r18android-platform-12.0.0_r17android-platform-12.0.0_r16android-platform-12.0.0_r15android-platform-12.0.0_r14android-platform-12.0.0_r13android-platform-12.0.0_r12android-platform-12.0.0_r11android-platform-12.0.0_r10android-platform-12.0.0_r1android-cts-12.0_r9android-cts-12.0_r8android-cts-12.0_r7android-cts-12.0_r6android-cts-12.0_r5android-cts-12.0_r4android-cts-12.0_r3android-cts-12.0_r2android-cts-12.0_r12android-cts-12.0_r11android-cts-12.0_r10android-cts-12.0_r1android-12.0.0_r9android-12.0.0_r8android-12.0.0_r34android-12.0.0_r33android-12.0.0_r31android-12.0.0_r30android-12.0.0_r3android-12.0.0_r25android-12.0.0_r2android-12.0.0_r11android-12.0.0_r10android-12.0.0_r1android12-tests-releaseandroid12-security-releaseandroid12-s5-releaseandroid12-s4-releaseandroid12-s3-releaseandroid12-s2-releaseandroid12-s1-releaseandroid12-releaseandroid12-platform-releaseandroid12-gsi
Change-Id: Ic7a624c572940b46363d7fb63117e2b9043b7926
-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); +} |