Skip to content

Commit

Permalink
Merge pull request #31 from adamrk/upgrade-tonic-0.8
Browse files Browse the repository at this point in the history
upgrade tonic 0.8
  • Loading branch information
adamrk authored Sep 20, 2022
2 parents 201eaab + b07027b commit 1c8863d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ as a Rust trait.

# Required dependencies
```toml
tonic = "0.4"
tonic-rpc = { version = "0.1", features = [ <enabled-codecs> ] }
tonic = "0.8"
tonic-rpc = { version = "0.2", features = [ <enabled-codecs> ] }
```

# Example
Expand Down Expand Up @@ -96,7 +96,7 @@ E.g. To use the encode using `cbor`, use the attribute
```
and include
```toml
tonic-rpc = { version = "0.1", features = [ "cbor" ]}
tonic-rpc = { version = "0.2", features = [ "cbor" ]}
```
in `Cargo.toml`.

Expand Down
2 changes: 1 addition & 1 deletion tonic-rpc-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ proc-macro = true
heck = "0.4"
itertools = "0.10"
syn = { version = "1.0", features = ["full"] }
tonic-build = "0.7"
tonic-build = "0.8"
proc-macro2 = "1.0"
quote = "1.0"
5 changes: 3 additions & 2 deletions tonic-rpc-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ macro_rules! method_impl {
}

impl Method for $name {
const CODEC_PATH: &'static str = $codec;
type Comment = String;

fn codec_path(&self) -> &str {
$codec
}
fn name(&self) -> &str {
self.0.name()
}
Expand Down Expand Up @@ -121,7 +123,6 @@ struct RustDefService<T> {
macro_rules! service_impl {
($name:ident, $codec:expr) => {
impl Service for RustDefService<$name> {
const CODEC_PATH: &'static str = $codec;
type Comment = String;
type Method = $name;

Expand Down
4 changes: 2 additions & 2 deletions tonic-rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ messagepack = ["rmp-serde"]
[dependencies]
bytes = "1.0"
serde = { version = "1.0", features = ["derive"] }
tonic = "0.7"
tonic = "0.8"
tonic-rpc-macro = { version = "0.2", path = "../tonic-rpc-macro" }

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

[build-dependencies]
tonic-build = "0.7"
tonic-build = "0.8"

# docs.rs-specific configuration
[package.metadata.docs.rs]
Expand Down
6 changes: 3 additions & 3 deletions tonic-rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
//!
//! # Required dependencies
//! ```toml
//! tonic = "0.4"
//! tonic-rpc = { version = "0.1", features = [ <enabled-codecs> ] }
//! tonic = "0.8"
//! tonic-rpc = { version = "0.2", features = [ <enabled-codecs> ] }
//! ```
//!
//! # Example
Expand Down Expand Up @@ -114,7 +114,7 @@
//! ```
//! and include
//! ```toml
//! tonic-rpc = { version = "0.1", features = [ "cbor" ]}
//! tonic-rpc = { version = "0.2", features = [ "cbor" ]}
//! ```
//! in `Cargo.toml`.
//!
Expand Down

0 comments on commit 1c8863d

Please sign in to comment.