Bug 1785002 - Update serde_bytes to 0.11.7. r=emilio,supply-chain-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D154747
This commit is contained in:
Mike Hommey 2022-08-16 21:19:41 +00:00
Родитель e3a8442daf
Коммит a589398512
8 изменённых файлов: 22 добавлений и 35 удалений

4
Cargo.lock сгенерированный
Просмотреть файл

@ -4665,9 +4665,9 @@ dependencies = [
[[package]]
name = "serde_bytes"
version = "0.11.6"
version = "0.11.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "212e73464ebcde48d723aa02eb270ba62eff38a9b732df31f33f1b4e145f3a54"
checksum = "cfc50e8183eeeb6178dcb167ae34a8051d63535023ae38b5d8d12beae193d37b"
dependencies = [
"serde",
]

Просмотреть файл

@ -572,6 +572,11 @@ who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"
delta = "1.0.137 -> 1.0.143"
[[audits.serde_bytes]]
who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"
delta = "0.11.6 -> 0.11.7"
[[audits.serde_derive]]
who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"

Просмотреть файл

@ -1 +1 @@
{"files":{"Cargo.toml":"72b3777be98ec025b4333108dd1bf066aaa39fa20900811cbe48048cc1138853","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"d9abfa11044b0561c6d7395c95ce5b6a8b855af2190dae0f98b38d6978443cb3","src/bytebuf.rs":"4a03836f0e6cb04c9ea3db4880e1ab58d99ed9157a15470c54b60c332bbd8312","src/bytes.rs":"309c2fa21a215e6f5a0bd37ec68e6aadb25b6703bc439f2af8bc4bc96ef0df7e","src/de.rs":"25e714010582268b65752904eb738ebcd991d37f07eb4bceb957483814a025c9","src/lib.rs":"59e20a97642390252df05441a85a41decdf0bba253b29dc7d5d4176f9e1d6697","src/ser.rs":"be02fcc1fb228caf6ce6f564bee8041579bd23069d75659ac665ce8e82b2c05d","tests/test_derive.rs":"cb0182379436a61ff8d5f704a3473af29aaeadfc3e8ba3011e73b6fb6fac1e2e","tests/test_partialeq.rs":"3ff7ba1dfa9f5b0213cc53d072364a9a1f00399a758b34c02d90e77da1536d94","tests/test_serde.rs":"10c980110505d47c7b8a876dcb911154339aa52124b6f1de5636001bcf39b56d"},"package":"212e73464ebcde48d723aa02eb270ba62eff38a9b732df31f33f1b4e145f3a54"}
{"files":{"Cargo.toml":"315f9b7b94d3f2d95acc91c1cf462a5650ef4f175d246853f17d0a5ccdcd680d","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"d9abfa11044b0561c6d7395c95ce5b6a8b855af2190dae0f98b38d6978443cb3","src/bytebuf.rs":"4a03836f0e6cb04c9ea3db4880e1ab58d99ed9157a15470c54b60c332bbd8312","src/bytes.rs":"a1d9fbae0149d13753e277f54ef75d491312ddc8a62701c482cec5735dbf8bc9","src/de.rs":"4ca87484a7015be6104022dabfaa50bcb296e1d809edbf040122d75515dadab2","src/lib.rs":"dee4abc7a1ba4f934a4c0ce0b5dde078973de543d77859ad2671e79acfa5d483","src/ser.rs":"be02fcc1fb228caf6ce6f564bee8041579bd23069d75659ac665ce8e82b2c05d","tests/test_derive.rs":"ea246011c4b5008df6c5170640e806be8f553d0a7e7801254dadd156440c95bb","tests/test_partialeq.rs":"3ff7ba1dfa9f5b0213cc53d072364a9a1f00399a758b34c02d90e77da1536d94","tests/test_serde.rs":"10c980110505d47c7b8a876dcb911154339aa52124b6f1de5636001bcf39b56d"},"package":"cfc50e8183eeeb6178dcb167ae34a8051d63535023ae38b5d8d12beae193d37b"}

8
third_party/rust/serde_bytes/Cargo.toml поставляемый
Просмотреть файл

@ -13,7 +13,7 @@
edition = "2018"
rust-version = "1.31"
name = "serde_bytes"
version = "0.11.6"
version = "0.11.7"
authors = ["David Tolnay <dtolnay@gmail.com>"]
description = "Optimized handling of `&[u8]` and `Vec<u8>` for Serde"
documentation = "https://docs.serde.rs/serde_bytes/"
@ -22,8 +22,12 @@ keywords = [
"serde",
"serialization",
"no_std",
"bytes",
]
categories = [
"encoding",
"no-std",
]
categories = ["encoding"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/serde-rs/bytes"

29
third_party/rust/serde_bytes/src/bytes.rs поставляемый
Просмотреть файл

@ -12,7 +12,7 @@ use alloc::boxed::Box;
#[cfg(any(feature = "std", feature = "alloc"))]
use crate::ByteBuf;
use serde::de::{Deserialize, Deserializer, Error, Visitor};
use serde::de::{Deserialize, Deserializer};
use serde::ser::{Serialize, Serializer};
/// Wrapper around `[u8]` to serialize and deserialize efficiently.
@ -161,35 +161,12 @@ impl Serialize for Bytes {
}
}
struct BytesVisitor;
impl<'de> Visitor<'de> for BytesVisitor {
type Value = &'de Bytes;
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("a borrowed byte array")
}
fn visit_borrowed_bytes<E>(self, v: &'de [u8]) -> Result<Self::Value, E>
where
E: Error,
{
Ok(Bytes::new(v))
}
fn visit_borrowed_str<E>(self, v: &'de str) -> Result<Self::Value, E>
where
E: Error,
{
Ok(Bytes::new(v.as_bytes()))
}
}
impl<'a, 'de: 'a> Deserialize<'de> for &'a Bytes {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: Deserializer<'de>,
{
deserializer.deserialize_bytes(BytesVisitor)
// serde::Deserialize for &[u8] is already optimized, so simply forward to that.
Deserialize::deserialize(deserializer).map(Bytes::new)
}
}

5
third_party/rust/serde_bytes/src/de.rs поставляемый
Просмотреть файл

@ -38,7 +38,7 @@ impl<'de: 'a, 'a> Deserialize<'de> for &'a [u8] {
where
D: Deserializer<'de>,
{
// Via the serde::Deserialize impl for &[u8].
// serde::Deserialize for &[u8] is already optimized, so simply forward to that.
serde::Deserialize::deserialize(deserializer)
}
}
@ -58,7 +58,8 @@ impl<'de: 'a, 'a> Deserialize<'de> for &'a Bytes {
where
D: Deserializer<'de>,
{
Deserialize::deserialize(deserializer).map(Bytes::new)
// serde::Deserialize for &[u8] is already optimized, so simply forward to that.
serde::Deserialize::deserialize(deserializer).map(Bytes::new)
}
}

2
third_party/rust/serde_bytes/src/lib.rs поставляемый
Просмотреть файл

@ -27,7 +27,7 @@
//! }
//! ```
#![doc(html_root_url = "https://docs.rs/serde_bytes/0.11.6")]
#![doc(html_root_url = "https://docs.rs/serde_bytes/0.11.7")]
#![cfg_attr(not(feature = "std"), no_std)]
#![deny(missing_docs)]
#![allow(

Просмотреть файл

@ -1,4 +1,4 @@
#![allow(clippy::ref_option_ref)]
#![allow(clippy::derive_partial_eq_without_eq, clippy::ref_option_ref)]
use serde_bytes::{ByteBuf, Bytes};
use serde_derive::{Deserialize, Serialize};