Skip to content

Commit bcbfbf9

Browse files
authored
Simplify Bytes implementation (#717)
* Simplify Bytes implementation * Drop BytesMut * New implementation for Bytes types
1 parent f7bd75e commit bcbfbf9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+537
-2447
lines changed

Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ ntex-tls = { path = "ntex-tls" }
3939
ntex-macros = { path = "ntex-macros" }
4040
ntex-util = { path = "ntex-util" }
4141

42+
ntex-h2 = { git = "https://github.com/ntex-rs/ntex-h2.git", branch = "bytes" }
43+
4244
[workspace.dependencies]
4345
ntex = "3.0.0-pre.11"
44-
ntex-bytes = "1.2.0"
45-
ntex-codec = "1.0.0"
46-
ntex-io = "3.3.2"
46+
ntex-bytes = "1.3.0"
47+
ntex-codec = "1.1.0"
48+
ntex-io = "3.4.0"
4749
ntex-net = "3.5.1"
4850
ntex-http = "1.0.0"
4951
ntex-router = "1.0.0"

ntex-bytes/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changes
22

3+
## [1.3.0] (2026-01-17)
4+
5+
* Replace BytesMut with BytesVec
6+
7+
* Bytes size reduced to 24 bytes
8+
39
## [1.2.0] (2026-01-04)
410

511
* Rename .split() to .take()

ntex-bytes/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ntex-bytes"
3-
version = "1.2.0"
3+
version = "1.3.0"
44
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
55
description = "Types and traits for working with bytes (bytes crate fork)"
66
documentation = "https://docs.rs/ntex-bytes"

ntex-bytes/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ To use `ntex-bytes`, first add this to your `Cargo.toml`:
1515

1616
```toml
1717
[dependencies]
18-
ntex-bytes = "0.1"
18+
ntex-bytes = "1"
1919
```
2020

2121
Next, add this to your crate:
@@ -30,7 +30,7 @@ Serde support is optional and disabled by default. To enable use the feature `se
3030

3131
```toml
3232
[dependencies]
33-
ntex-bytes = { version = "0.1", features = ["serde"] }
33+
ntex-bytes = { version = "1", features = ["serde"] }
3434
```
3535

3636
## License

ntex-bytes/src/buf/buf_mut.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ fn _assert_trait_object(_b: &dyn BufMut) {}
969969
#[allow(unused_allocation, warnings)]
970970
mod tests {
971971
use super::*;
972-
use crate::{BytesMut, BytesVec};
972+
use crate::BytesMut;
973973

974974
#[test]
975975
#[allow(clippy::needless_borrow)]
@@ -1013,7 +1013,7 @@ mod tests {
10131013
buf.put_u8(0x01);
10141014
assert_eq!(buf, b"\x01"[..]);
10151015

1016-
let mut buf = BytesVec::new();
1016+
let mut buf = BytesMut::new();
10171017
buf.put_u8(0x01);
10181018
assert_eq!(buf, b"\x01"[..]);
10191019

@@ -1025,7 +1025,7 @@ mod tests {
10251025
buf.put_i8(0x01);
10261026
assert_eq!(buf, b"\x01"[..]);
10271027

1028-
let mut buf = BytesVec::new();
1028+
let mut buf = BytesMut::new();
10291029
buf.put_i8(0x01);
10301030
assert_eq!(buf, b"\x01"[..]);
10311031

0 commit comments

Comments
 (0)