Skip to content

Commit d3e4a1a

Browse files
authored
Upgrade to ntex v3.0 (#33)
1 parent b92b86b commit d3e4a1a

File tree

10 files changed

+30
-20
lines changed

10 files changed

+30
-20
lines changed

examples/custom/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
name = "custom"
33
version = "1.0.0"
44
edition = "2024"
5-
rust-version = "1.85"
5+
rust-version = "1.88"
66

77
[[bin]]
88
name = "client"
99
path = "src/client.rs"
1010

1111
[dependencies]
12-
ntex = "3.0.0-pre.2"
13-
ntex-h2 = "3.0.0"
14-
ntex-grpc = "1.0.0"
12+
ntex = "3.0"
13+
ntex-h2 = "3.6"
14+
ntex-grpc = "1.0"
1515

1616
env_logger = "0.11"
1717
uuid = { version = "1", features = ["v4"] }
1818

1919
[dev-dependencies]
20-
ntex = { version = "3.0.0-pre.2", features = ["openssl", "tokio"] }
20+
ntex = { version = "3.0", features = ["openssl", "tokio"] }

examples/helloworld/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "helloworld"
33
version = "1.0.0"
44
edition = "2024"
5-
rust-version = "1.85"
5+
rust-version = "1.88"
66

77
[[bin]]
88
name = "client"
@@ -13,7 +13,7 @@ name = "server"
1313
path = "src/server.rs"
1414

1515
[dependencies]
16-
ntex = { version = "3.0.0-pre.9", features = ["tokio"] }
16+
ntex = { version = "3.0", features = ["tokio"] }
1717
ntex-grpc = "1"
1818
ntex-h2 = "3"
1919

@@ -23,4 +23,4 @@ env_logger = "0.11"
2323
num_cpus = "1"
2424

2525
[dev-dependencies]
26-
ntex = { version = "3.0.0-pre.9", features = ["openssl", "tokio"] }
26+
ntex = { version = "3.0", features = ["openssl", "tokio"] }

examples/helloworld/src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fn main() {
4141

4242
thread::spawn(move || {
4343
println!("Starting thread: {t}");
44-
let sys = System::new("client");
44+
let sys = System::new("client", ntex::rt::DefaultRuntime);
4545

4646
sys.block_on(async move {
4747
let h2client = h2::ClientBuilder::with_default(addr)

examples/helloworld/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ async fn main() -> std::io::Result<()> {
6666
let threads = parse_usize_default(matches.value_of("threads"), num_cpus::get());
6767

6868
// bind to socket
69-
Server::build()
69+
Server::builder()
7070
.bind("helloworld", format!("0.0.0.0:{port}"), async move |_| {
7171
// create service
7272
server::GrpcServer::new(GreeterServer)

ntex-grpc-codegen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ readme = "README.md"
1010
keywords = ["grpc"]
1111
categories = ["asynchronous", "network-programming"]
1212
edition = "2024"
13-
rust-version = "1.85"
13+
rust-version = "1.88"
1414

1515
[[bin]]
1616
name = "ntex-grpc"

ntex-grpc-derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repository = "https://github.com/ntex-rs/ntex-grpc"
77
readme = "README.md"
88
description = "A Protocol Buffers implementation for the Rust Language."
99
edition = "2024"
10-
rust-version = "1.85"
10+
rust-version = "1.88"
1111

1212
[lib]
1313
proc-macro = true

ntex-grpc/CHANGES.md

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

3+
## [1.3.0] - 2026-02-02
4+
5+
* Upgrade to ntex v3.0
6+
37
## [1.2.0] - 2025-12-22
48

59
* Add "CONTENT-TYPE" header to server response

ntex-grpc/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ntex-grpc"
3-
version = "1.2.0"
3+
version = "1.3.0"
44
license = "MIT OR Apache-2.0"
55
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
66
description = "GRPC Client/Server framework"
@@ -10,14 +10,14 @@ readme = "README.md"
1010
keywords = ["grpc"]
1111
categories = ["asynchronous", "network-programming"]
1212
edition = "2024"
13-
rust-version = "1.85"
13+
rust-version = "1.88"
1414

1515
[lib]
1616
name = "ntex_grpc"
1717
path = "src/lib.rs"
1818

1919
[dependencies]
20-
ntex-h2 = "3.2"
20+
ntex-h2 = "3.6"
2121
ntex-http = "1"
2222
ntex-io = "3"
2323
ntex-util = "3"
@@ -33,4 +33,4 @@ pin-project-lite = "0.2"
3333
[dev-dependencies]
3434
openssl = "0.10"
3535
env_logger = "0.11"
36-
ntex = { version = "3.0.0-pre.9", features = ["openssl", "neon"] }
36+
ntex = { version = "3.0", features = ["openssl", "neon"] }

ntex-grpc/src/server/service.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,13 @@ where
120120

121121
struct ControlService;
122122

123-
impl Service<h2::ControlMessage<h2::StreamError>> for ControlService {
124-
type Response = h2::ControlResult;
123+
impl Service<h2::Control<h2::StreamError>> for ControlService {
124+
type Response = h2::ControlAck;
125125
type Error = ();
126126

127127
async fn call(
128128
&self,
129-
msg: h2::ControlMessage<h2::StreamError>,
129+
msg: h2::Control<h2::StreamError>,
130130
_: ServiceCtx<'_, Self>,
131131
) -> Result<Self::Response, Self::Error> {
132132
log::trace!("Control message: {msg:?}");

ntex-grpc/src/types.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ pub trait NativeType: PartialEq + Default + Sized + fmt::Debug {
8585
DefaultValue::Value(d) => self == d,
8686
};
8787

88-
if default { 0 } else { self.encoded_len(tag) }
88+
if default {
89+
0
90+
} else {
91+
self.encoded_len(tag)
92+
}
8993
}
9094

9195
#[inline]
@@ -652,6 +656,7 @@ mod tests {
652656
Ok(msg)
653657
}
654658

659+
#[allow(clippy::identity_op)]
655660
#[inline]
656661
fn encoded_len(&self) -> usize {
657662
0 + NativeType::serialized_len(&self.f, 1, DefaultValue::Default)
@@ -661,6 +666,7 @@ mod tests {
661666
}
662667
}
663668

669+
#[allow(clippy::field_reassign_with_default)]
664670
#[test]
665671
fn test_hashmap_default_values() {
666672
let mut msg = TestMessage::default();

0 commit comments

Comments
 (0)