From 600444b84d065a09c5c31b1abdae8a5880b66e54 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 18 Dec 2022 11:51:16 -0800 Subject: [PATCH 1/6] Point documentation links to docs.rs instead of docs.serde.rs --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d2c81eb..d7520d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.11.8" # remember to update html_root_url authors = ["David Tolnay "] categories = ["encoding", "no-std"] description = "Optimized handling of `&[u8]` and `Vec` for Serde" -documentation = "https://docs.serde.rs/serde_bytes/" +documentation = "https://docs.rs/serde_bytes" edition = "2018" keywords = ["serde", "serialization", "no_std", "bytes"] license = "MIT OR Apache-2.0" From 9d642150493953134679b491d0046aa03f7642dc Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 30 Dec 2022 12:00:51 -0800 Subject: [PATCH 2/6] Sync license text with rust-lang repos --- LICENSE-APACHE | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/LICENSE-APACHE b/LICENSE-APACHE index 16fe87b..1b5ec8b 100644 --- a/LICENSE-APACHE +++ b/LICENSE-APACHE @@ -174,28 +174,3 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. From df42fe93ce4095ae93d448316b33eb0d47dcb811 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 2 Jan 2023 21:40:15 -0800 Subject: [PATCH 3/6] Opt out -Zrustdoc-scrape-examples on docs.rs I'd like a chance to audit all the code that rustdoc is inserting into the docs. Currently I am skeptical that showing serde_bytes's internal usages of APIs is a net benefit to the public documentation. I am also skeptical that quite so many examples are needed, and that they should be featured so prominently in comparison to handwritten docs. Lastly I wish there were a way to turn this behavior off on a more granular basis. --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index d7520d0..09ec365 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,5 +24,8 @@ bincode = "1.0" serde_derive = "1.0" serde_test = "1.0" +[lib] +doc-scrape-examples = false + [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] From b38995ebac20b8672c8e356098e9d77ebbb4357c Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 4 Feb 2023 21:02:07 -0800 Subject: [PATCH 4/6] Bytes -> repr(transparent) repr(transparent) was stabilized in Rust 1.28, and serde_bytes now requires a minimum compiler of 1.31. --- src/bytes.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bytes.rs b/src/bytes.rs index 2cfa75e..3842989 100644 --- a/src/bytes.rs +++ b/src/bytes.rs @@ -37,7 +37,7 @@ use serde::ser::{Serialize, Serializer}; /// # } /// ``` #[derive(Eq, Ord)] -#[repr(C)] +#[repr(transparent)] pub struct Bytes { bytes: [u8], } From 459e7111362f3f8f323f0361871c40b43b0c2bd6 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 4 Feb 2023 21:00:03 -0800 Subject: [PATCH 5/6] Hide repr attribute from documentation --- src/bytes.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bytes.rs b/src/bytes.rs index 3842989..ad0902b 100644 --- a/src/bytes.rs +++ b/src/bytes.rs @@ -37,7 +37,7 @@ use serde::ser::{Serialize, Serializer}; /// # } /// ``` #[derive(Eq, Ord)] -#[repr(transparent)] +#[cfg_attr(not(doc), repr(transparent))] pub struct Bytes { bytes: [u8], } From c3c83935d3943224c17ab11a7796db8e2810b7dc Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 4 Feb 2023 21:06:57 -0800 Subject: [PATCH 6/6] Release 0.11.9 --- Cargo.toml | 2 +- src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 09ec365..241a337 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde_bytes" -version = "0.11.8" # remember to update html_root_url +version = "0.11.9" # remember to update html_root_url authors = ["David Tolnay "] categories = ["encoding", "no-std"] description = "Optimized handling of `&[u8]` and `Vec` for Serde" diff --git a/src/lib.rs b/src/lib.rs index 4ead3cb..871d6cb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,7 +27,7 @@ //! } //! ``` -#![doc(html_root_url = "https://docs.rs/serde_bytes/0.11.8")] +#![doc(html_root_url = "https://docs.rs/serde_bytes/0.11.9")] #![cfg_attr(not(feature = "std"), no_std)] #![deny(missing_docs)] #![allow(