Skip to content

Commit b07027b

Browse files
committed
upgrade tonic 0.8
1 parent 201eaab commit b07027b

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ as a Rust trait.
2626

2727
# Required dependencies
2828
```toml
29-
tonic = "0.4"
30-
tonic-rpc = { version = "0.1", features = [ <enabled-codecs> ] }
29+
tonic = "0.8"
30+
tonic-rpc = { version = "0.2", features = [ <enabled-codecs> ] }
3131
```
3232

3333
# Example
@@ -96,7 +96,7 @@ E.g. To use the encode using `cbor`, use the attribute
9696
```
9797
and include
9898
```toml
99-
tonic-rpc = { version = "0.1", features = [ "cbor" ]}
99+
tonic-rpc = { version = "0.2", features = [ "cbor" ]}
100100
```
101101
in `Cargo.toml`.
102102

tonic-rpc-macro/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ proc-macro = true
1919
heck = "0.4"
2020
itertools = "0.10"
2121
syn = { version = "1.0", features = ["full"] }
22-
tonic-build = "0.7"
22+
tonic-build = "0.8"
2323
proc-macro2 = "1.0"
2424
quote = "1.0"

tonic-rpc-macro/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ macro_rules! method_impl {
7777
}
7878

7979
impl Method for $name {
80-
const CODEC_PATH: &'static str = $codec;
8180
type Comment = String;
8281

82+
fn codec_path(&self) -> &str {
83+
$codec
84+
}
8385
fn name(&self) -> &str {
8486
self.0.name()
8587
}
@@ -121,7 +123,6 @@ struct RustDefService<T> {
121123
macro_rules! service_impl {
122124
($name:ident, $codec:expr) => {
123125
impl Service for RustDefService<$name> {
124-
const CODEC_PATH: &'static str = $codec;
125126
type Comment = String;
126127
type Method = $name;
127128

tonic-rpc/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ messagepack = ["rmp-serde"]
2424
[dependencies]
2525
bytes = "1.0"
2626
serde = { version = "1.0", features = ["derive"] }
27-
tonic = "0.7"
27+
tonic = "0.8"
2828
tonic-rpc-macro = { version = "0.2", path = "../tonic-rpc-macro" }
2929

3030
# optional codecs
@@ -39,7 +39,7 @@ tokio = { version = "1.4", features = [ "full" ] }
3939
tokio-stream = { version = "0.1", features = [ "net" ] }
4040

4141
[build-dependencies]
42-
tonic-build = "0.7"
42+
tonic-build = "0.8"
4343

4444
# docs.rs-specific configuration
4545
[package.metadata.docs.rs]

tonic-rpc/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
//!
1212
//! # Required dependencies
1313
//! ```toml
14-
//! tonic = "0.4"
15-
//! tonic-rpc = { version = "0.1", features = [ <enabled-codecs> ] }
14+
//! tonic = "0.8"
15+
//! tonic-rpc = { version = "0.2", features = [ <enabled-codecs> ] }
1616
//! ```
1717
//!
1818
//! # Example
@@ -114,7 +114,7 @@
114114
//! ```
115115
//! and include
116116
//! ```toml
117-
//! tonic-rpc = { version = "0.1", features = [ "cbor" ]}
117+
//! tonic-rpc = { version = "0.2", features = [ "cbor" ]}
118118
//! ```
119119
//! in `Cargo.toml`.
120120
//!

0 commit comments

Comments
 (0)