Skip to content

Commit

Permalink
#3 merge with bytes/master v1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
HusseinAbdelhamid committed Jun 7, 2024
2 parents 4ba0531 + fa1daac commit 4b3bd43
Show file tree
Hide file tree
Showing 24 changed files with 1,354 additions and 488 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ jobs:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update stable
- name: Check formatting
run: cargo fmt --all -- --check
run: cargo fmt --all --check

# TODO
# # Apply clippy lints
# clippy:
# name: clippy
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/checkout@v4
# - name: Apply clippy lints
# run: cargo clippy --all-features

Expand All @@ -48,9 +48,9 @@ jobs:
name: minrust
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update 1.39.0 && rustup default 1.39.0
- uses: actions/checkout@v4
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Check
run: ci/test-stable.sh check

Expand All @@ -65,7 +65,7 @@ jobs:
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Rust
# --no-self-update is necessary because the windows environment cannot self-update rustup.exe.
run: rustup update stable --no-self-update
Expand All @@ -77,7 +77,7 @@ jobs:
name: nightly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update $nightly && rustup default $nightly
- name: Test
Expand All @@ -96,7 +96,7 @@ jobs:
- wasm32-unknown-unknown
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update stable
- name: cross build --target ${{ matrix.target }}
Expand Down Expand Up @@ -153,18 +153,19 @@ jobs:
name: tsan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update $nightly && rustup default $nightly
- name: Install rust-src
run: rustup component add rust-src
- name: ASAN / TSAN
run: ci/tsan.sh

miri:
name: miri
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Miri
run: ci/miri.sh

Expand All @@ -173,7 +174,7 @@ jobs:
name: loom
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update $nightly && rustup default $nightly
- name: Loom tests
Expand All @@ -192,7 +193,7 @@ jobs:
- loom
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update $nightly && rustup default $nightly
- name: Build documentation
Expand Down
63 changes: 63 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,66 @@
# 1.6.0 (March 22, 2024)

### Added

- Add `Bytes::is_unique` (#643)

### Documented

- Fix changelog typo (#628)
- Fix some spelling mistakes (#633)
- Typo fix (#637)
- Fix broken links (#639)
- Add security policy (#649)

### Internal changes

- Move comment to correct constant (#629)
- Various cleanup (#635)
- Simplify `UninitSlice::as_uninit_slice_mut()` logic (#644)
- Use `self.` instead of `Self::` (#642)
- `BytesMut`: Assert alignment of `Shared` (#652)
- Remove unnecessary namespace qualifier (#660)
- Remove an unnecessary else branch (#662)
- Remove unreachable else branch (#661)
- make parameter mut in `From<Vec>` (#667)
- Restore commented tests (#665)
- Use `sub` instead of `offset` (#668)
- Calculate original capacity only if necessary (#666)
- `set_vec_pos` does not need a second parameter (#672)
- `get_vec_pos`: use `&self` instead of `&mut self` (#670)
- Refactor `split_at`/`split_to` (#663)
- Use `Iterator` from the prelude (#673)
- `copy_to_bytes`: Add panic section to docs (#676)
- Remove redundant reserve call (#674)
- Use `ManuallyDrop` instead of `mem::forget` (#675)


# 1.5.0 (September 7, 2023)

### Added

- Add `UninitSlice::{new,uninit}` (#598, #599)
- Implement `BufMut` for `&mut [MaybeUninit<u8>]` (#597)

### Changed

- Mark `BytesMut::extend_from_slice` as inline (#595)

# 1.4.0 (January 31, 2023)

### Added

- Make `IntoIter` constructor public (#581)

### Fixed

- Avoid large reallocations when freezing `BytesMut` (#592)

### Documented

- Document which functions require `std` (#591)
- Fix duplicate "the the" typos (#585)

# 1.3.0 (November 20, 2022)

### Added
Expand Down
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ name = "bytes"
# When releasing to crates.io:
# - Update CHANGELOG.md.
# - Create "v1.x.y" git tag.
version = "1.3.0"
version = "1.6.0"
edition = "2018"
rust-version = "1.39"
license = "MIT"
authors = [
"Carl Lerche <[email protected]>",
Expand All @@ -15,7 +17,6 @@ repository = "https://github.com/tokio-rs/bytes"
readme = "README.md"
keywords = ["buffers", "zero-copy", "io"]
categories = ["network-programming", "data-structures"]
edition = "2018"

[features]
default = ["std"]
Expand All @@ -29,7 +30,7 @@ portable-atomic = "0.2.1"
serde_test = "1.0"

[target.'cfg(loom)'.dev-dependencies]
loom = "0.5"
loom = "0.7"

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
9 changes: 9 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Security Policy

Bytes is part of the Tokio project and uses the same security policy as [Tokio][tokio-security].

## Report a security issue

The process for reporting an issue is the same as for [Tokio][tokio-security]. This includes private reporting via [email protected].

[tokio-security]: https://github.com/tokio-rs/tokio/security/policy
6 changes: 3 additions & 3 deletions benches/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn clone_static(b: &mut Bencher) {

b.iter(|| {
for _ in 0..1024 {
test::black_box(&bytes.clone());
test::black_box(test::black_box(&bytes).clone());
}
})
}
Expand All @@ -58,7 +58,7 @@ fn clone_shared(b: &mut Bencher) {

b.iter(|| {
for _ in 0..1024 {
test::black_box(&bytes.clone());
test::black_box(test::black_box(&bytes).clone());
}
})
}
Expand All @@ -70,7 +70,7 @@ fn clone_arc_vec(b: &mut Bencher) {

b.iter(|| {
for _ in 0..1024 {
test::black_box(&bytes.clone());
test::black_box(test::black_box(&bytes).clone());
}
})
}
Expand Down
6 changes: 0 additions & 6 deletions ci/test-stable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@ set -ex

cmd="${1:-test}"

# Install cargo-hack for feature flag test
host=$(rustc -Vv | grep host | sed 's/host: //')
curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-$host.tar.gz | tar xzf - -C ~/.cargo/bin

# Run with each feature
# * --each-feature includes both default/no-default features
# * --optional-deps is needed for serde feature
cargo hack "${cmd}" --each-feature --optional-deps
# Run with all features
cargo "${cmd}" --all-features

cargo doc --no-deps --all-features

if [[ "${RUST_VERSION}" == "nightly"* ]]; then
# Check benchmarks
cargo check --benches
Expand Down
Loading

0 comments on commit 4b3bd43

Please sign in to comment.