Skip to content

Commit 7050fd4

Browse files
authored
Update ntex-bytes (#23)
1 parent 9c15df0 commit 7050fd4

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

.github/workflows/linux.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
fail-fast: false
99
matrix:
1010
version:
11-
- 1.85.0 # MSRV
11+
- 1.86.0 # MSRV
1212
- stable
1313
- nightly
1414

@@ -42,7 +42,7 @@ jobs:
4242
key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
4343

4444
- name: Cache cargo tarpaulin
45-
if: matrix.version == '1.85.0' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
45+
if: matrix.version == '1.86.0' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
4646
uses: actions/cache@v4
4747
with:
4848
path: ~/.cargo/bin
@@ -56,19 +56,19 @@ jobs:
5656
args: --all --all-features --no-fail-fast -- --nocapture
5757

5858
- name: Install tarpaulin
59-
if: matrix.version == '1.85.0' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
59+
if: matrix.version == '1.86.0' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
6060
continue-on-error: true
6161
run: |
6262
cargo install cargo-tarpaulin
6363
6464
- name: Generate coverage report
65-
if: matrix.version == '1.85.0' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
65+
if: matrix.version == '1.86.0' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
6666
continue-on-error: true
6767
run: |
6868
cargo tarpaulin --out Xml --all --all-features
6969
7070
- name: Upload to Codecov
71-
if: matrix.version == '1.85.0' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
71+
if: matrix.version == '1.86.0' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
7272
continue-on-error: true
7373
uses: codecov/codecov-action@v1
7474
with:

ntex-files/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ name = "ntex_files"
1818
path = "src/lib.rs"
1919

2020
[dependencies]
21-
ntex = "3.0.0-pre.6"
21+
ntex = "3.0.0-pre.10"
2222
ntex-http = "1"
2323
bitflags = "2"
2424
futures = "0.3"

ntex-identity/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ default = ["cookie-policy"]
2222
cookie-policy = ["cookie/secure", "ntex/cookie"]
2323

2424
[dependencies]
25-
ntex = "3.0.0-pre.9"
25+
ntex = "3.0.0-pre.10"
2626
futures = "0.3"
2727
serde = "1.0"
2828
serde_json = "1.0"

ntex-multipart/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ name = "ntex_multipart"
1717
path = "src/lib.rs"
1818

1919
[dependencies]
20-
ntex = "3.0.0-pre.6"
20+
ntex = "3.0.0-pre.10"
2121
derive_more = { version = "2", features = ["from", "display"] }
2222
httparse = "1.3"
2323
futures = "0.3"

ntex-multipart/src/server.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ impl InnerField {
507507
// check if we have enough data for boundary detection
508508
if cur + 4 > len {
509509
if cur > 0 {
510-
Poll::Ready(Some(Ok(payload.buf.split_to(cur).freeze())))
510+
Poll::Ready(Some(Ok(payload.buf.split_to_bytes(cur))))
511511
} else {
512512
Poll::Pending
513513
}
@@ -520,7 +520,7 @@ impl InnerField {
520520
{
521521
if cur != 0 {
522522
// return buffer
523-
Poll::Ready(Some(Ok(payload.buf.split_to(cur).freeze())))
523+
Poll::Ready(Some(Ok(payload.buf.split_to_bytes(cur))))
524524
} else {
525525
pos = cur + 1;
526526
continue;
@@ -532,7 +532,7 @@ impl InnerField {
532532
}
533533
}
534534
} else {
535-
Poll::Ready(Some(Ok(payload.buf.split().freeze())))
535+
Poll::Ready(Some(Ok(payload.buf.take_bytes())))
536536
};
537537
}
538538
}
@@ -692,13 +692,13 @@ impl PayloadBuffer {
692692
/// Read exact number of bytes
693693
#[cfg(test)]
694694
fn read_exact(&mut self, size: usize) -> Option<Bytes> {
695-
if size <= self.buf.len() { Some(self.buf.split_to(size).freeze()) } else { None }
695+
if size <= self.buf.len() { Some(self.buf.split_to_bytes(size)) } else { None }
696696
}
697697

698698
fn read_max(&mut self, size: u64) -> Result<Option<Bytes>, MultipartError> {
699699
if !self.buf.is_empty() {
700700
let size = std::cmp::min(self.buf.len() as u64, size) as usize;
701-
Ok(Some(self.buf.split_to(size).freeze()))
701+
Ok(Some(self.buf.split_to_bytes(size)))
702702
} else if self.eof {
703703
Err(MultipartError::Incomplete)
704704
} else {
@@ -709,7 +709,7 @@ impl PayloadBuffer {
709709
/// Read until specified ending
710710
pub fn read_until(&mut self, line: &[u8]) -> Result<Option<Bytes>, MultipartError> {
711711
let res = twoway::find_bytes(&self.buf, line)
712-
.map(|idx| self.buf.split_to(idx + line.len()).freeze());
712+
.map(|idx| self.buf.split_to_bytes(idx + line.len()));
713713

714714
if res.is_none() && self.eof { Err(MultipartError::Incomplete) } else { Ok(res) }
715715
}
@@ -722,7 +722,7 @@ impl PayloadBuffer {
722722
/// Read bytes until new line delimiter or eof
723723
pub fn readline_or_eof(&mut self) -> Result<Option<Bytes>, MultipartError> {
724724
match self.readline() {
725-
Err(MultipartError::Incomplete) if self.eof => Ok(Some(self.buf.split().freeze())),
725+
Err(MultipartError::Incomplete) if self.eof => Ok(Some(self.buf.take_bytes())),
726726
line => line,
727727
}
728728
}

ntex-session/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ default = ["cookie-session"]
2323
cookie-session = ["cookie/secure", "ntex/cookie"]
2424

2525
[dependencies]
26-
ntex = "3.0.0-pre.9"
26+
ntex = "3.0.0-pre.10"
2727
cookie = "0.18"
2828
derive_more = { version = "2", features = ["from", "display"] }
2929
futures = "0.3"

0 commit comments

Comments
 (0)