chore: Update to 2021 edition (#1188)

This commit is contained in:
tottoto
2022-12-14 05:16:49 +09:00
committed by GitHub
parent 25ea473abd
commit bf22a740c3
37 changed files with 29 additions and 52 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ For IntelliJ IDEA users, please refer to [this](https://github.com/intellij-rust
### Rust Version
`tonic` currently works on Rust `1.60` and above as it requires support for the 2018 edition.
`tonic`'s MSRV is `1.60`.
```bash
$ rustup update
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
authors = ["Lucio Franco <luciofranco14@gmail.com>"]
edition = "2018"
edition = "2021"
license = "MIT"
name = "examples"
publish = false
+1 -1
View File
@@ -21,7 +21,7 @@ struct BlockingClient {
impl BlockingClient {
pub fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let rt = Builder::new_multi_thread().enable_all().build().unwrap();
-1
View File
@@ -1,4 +1,3 @@
use std::convert::TryFrom;
use tonic::{
transport::{Endpoint, Server, Uri},
Request, Response, Status,
-1
View File
@@ -5,7 +5,6 @@ pub mod hello_world {
}
use hello_world::{greeter_client::GreeterClient, HelloRequest};
use std::convert::TryFrom;
#[cfg(unix)]
use tokio::net::UnixStream;
use tonic::transport::{Endpoint, Uri};
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
authors = ["Lucio Franco <luciofranco14@gmail.com>"]
edition = "2018"
edition = "2021"
license = "MIT"
name = "interop"
publish = false
+1 -1
View File
@@ -1 +1 @@
edition = "2018"
edition = "2021"
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
authors = ["Yonathan Randolph <yonathan@gmail.com>"]
edition = "2018"
edition = "2021"
license = "MIT"
name = "ambiguous_methods"
publish = false
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
authors = ["Lucio Franco <luciofranco14@gmail.com>"]
edition = "2018"
edition = "2021"
license = "MIT"
name = "compression"
publish = false
-1
View File
@@ -3,7 +3,6 @@
use self::util::*;
use crate::util::mock_io_channel;
use futures::{Stream, StreamExt};
use std::convert::TryFrom;
use std::{
pin::Pin,
sync::{
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
authors = ["bouzuya <m@bouzuya.net>"]
edition = "2018"
edition = "2021"
license = "MIT"
name = "disable-comments"
publish = false
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
authors = ["Danny Hua <danny@42layers.io>"]
edition = "2018"
edition = "2021"
license = "MIT"
name = "my_application"
publish = false
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
authors = ["Danny Hua <danny@42layers.io>"]
edition = "2018"
edition = "2021"
license = "MIT"
name = "uuid1"
publish = false
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
authors = ["Lucio Franco <luciofranco14@gmail.com>"]
edition = "2018"
edition = "2021"
license = "MIT"
name = "included_service"
publish = false
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
authors = ["Lucio Franco <luciofranco14@gmail.com>"]
edition = "2018"
edition = "2021"
license = "MIT"
name = "integration-tests"
publish = false
@@ -51,8 +51,6 @@ async fn getting_connect_info() {
#[cfg(unix)]
pub mod unix {
use std::convert::TryFrom as _;
use futures_util::FutureExt;
use tokio::{
net::{UnixListener, UnixStream},
-1
View File
@@ -6,7 +6,6 @@ use integration_tests::pb::{
test_client, test_server, test_stream_client, test_stream_server, Input, InputStream, Output,
OutputStream,
};
use std::convert::TryFrom;
use std::error::Error;
use std::time::Duration;
use tokio::sync::oneshot;
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
authors = ["Lucio Franco <luciofranco14@gmail.com>"]
edition = "2018"
edition = "2021"
license = "MIT"
name = "root-crate-path"
publish = false
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
authors = ["Lucio Franco <luciofranco14@gmail.com>"]
edition = "2018"
edition = "2021"
license = "MIT"
name = "same_name"
publish = false
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
authors = ["Lucio Franco <luciofranco14@gmail.com>"]
edition = "2018"
edition = "2021"
license = "MIT"
name = "service_named_service"
publish = false
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
authors = ["Ben Sully <ben@bsull.io>"]
edition = "2018"
edition = "2021"
name = "stream_conflict"
publish = false
version = "0.1.0"
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
authors = ["Lucio Franco <luciofranco14@gmail.com>"]
edition = "2018"
edition = "2021"
license = "MIT"
name = "wellknown-compiled"
publish = false
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
authors = ["Lucio Franco <luciofranco14@gmail.com>"]
edition = "2018"
edition = "2021"
license = "MIT"
name = "wellknown"
publish = false
+1 -1
View File
@@ -5,7 +5,7 @@ description = """
Codegen module of `tonic` gRPC implementation.
"""
documentation = "https://docs.rs/tonic-build/0.8.4/tonic_build/"
edition = "2018"
edition = "2021"
homepage = "https://github.com/hyperium/tonic"
keywords = ["rpc", "grpc", "async", "codegen", "protobuf"]
license = "MIT"
+1 -1
View File
@@ -150,7 +150,7 @@ fn generate_connect(service_ident: &syn::Ident, enabled: bool) -> TokenStream {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
+1 -1
View File
@@ -5,7 +5,7 @@ description = """
Health Checking module of `tonic` gRPC implementation.
"""
documentation = "https://docs.rs/tonic-health/0.7.0/tonic-health/"
edition = "2018"
edition = "2021"
homepage = "https://github.com/hyperium/tonic"
keywords = ["rpc", "grpc", "async", "healthcheck"]
license = "MIT"
+1 -1
View File
@@ -7,7 +7,7 @@ categories = ["network-programming", "asynchronous"]
description = """
Server Reflection module of `tonic` gRPC implementation.
"""
edition = "2018"
edition = "2021"
homepage = "https://github.com/hyperium/tonic"
documentation = "https://docs.rs/tonic-reflection/0.5.0/tonic-reflection/"
keywords = ["rpc", "grpc", "async", "reflection"]
+1 -1
View File
@@ -5,7 +5,7 @@ description = """
A collection of useful protobuf types that can be used with `tonic`.
"""
documentation = "https://docs.rs/tonic-types/0.5.0/tonic-types/"
edition = "2018"
edition = "2021"
homepage = "https://github.com/hyperium/tonic"
keywords = ["rpc", "grpc", "protobuf"]
license = "MIT"
@@ -1,4 +1,4 @@
use std::{convert::TryFrom, time};
use std::time;
use prost::{DecodeError, Message};
use prost_types::Any;
+1 -1
View File
@@ -5,7 +5,7 @@ description = """
grpc-web protocol translation for tonic services.
"""
documentation = "https://docs.rs/tonic-web/0.4.0/tonic-web/"
edition = "2018"
edition = "2021"
homepage = "https://github.com/hyperium/tonic"
keywords = ["rpc", "grpc", "grpc-web"]
license = "MIT"
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
authors = ["Juan Alvarez <j@yabit.io>"]
edition = "2018"
edition = "2021"
name = "integration"
publish = false
version = "0.1.0"
+1 -1
View File
@@ -14,7 +14,7 @@ description = """
A gRPC over HTTP/2 implementation focused on high performance, interoperability, and flexibility.
"""
documentation = "https://docs.rs/tonic/0.8.2/tonic/"
edition = "2018"
edition = "2021"
homepage = "https://github.com/hyperium/tonic"
keywords = ["rpc", "grpc", "async", "futures", "protobuf"]
license = "MIT"
@@ -22,7 +22,7 @@ pub mod client {
#[doc = r" Attempt to create a new client by connecting to a given endpoint."]
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
-6
View File
@@ -7,7 +7,6 @@ use super::key::MetadataKey;
use bytes::Bytes;
use http::header::HeaderValue;
use std::convert::TryFrom;
use std::error::Error;
use std::hash::{Hash, Hasher};
use std::marker::PhantomData;
@@ -286,7 +285,6 @@ impl<VE: ValueEncoding> MetadataValue<VE> {
///
/// ```
/// # use tonic::metadata::*;
/// # use std::convert::TryFrom;
/// let val = AsciiMetadataValue::try_from(b"hello\xfa").unwrap();
/// assert_eq!(val, &b"hello\xfa"[..]);
/// ```
@@ -295,7 +293,6 @@ impl<VE: ValueEncoding> MetadataValue<VE> {
///
/// ```
/// # use tonic::metadata::*;
/// # use std::convert::TryFrom;
/// let val = AsciiMetadataValue::try_from(b"\n");
/// assert!(val.is_err());
/// ```
@@ -324,7 +321,6 @@ impl<'a, VE: ValueEncoding> TryFrom<&'a [u8]> for MetadataValue<VE> {
///
/// ```
/// # use tonic::metadata::*;
/// # use std::convert::TryFrom;
/// let val = AsciiMetadataValue::try_from(b"hello\xfa").unwrap();
/// assert_eq!(val, &b"hello\xfa"[..]);
/// ```
@@ -333,7 +329,6 @@ impl<'a, VE: ValueEncoding> TryFrom<&'a [u8]> for MetadataValue<VE> {
///
/// ```
/// # use tonic::metadata::*;
/// # use std::convert::TryFrom;
/// let val = AsciiMetadataValue::try_from(b"\n");
/// assert!(val.is_err());
/// ```
@@ -473,7 +468,6 @@ impl MetadataValue<Ascii> {
///
/// ```
/// # use tonic::metadata::*;
/// # use std::convert::TryFrom;
/// let val = AsciiMetadataValue::from_key::<Ascii>("accept".parse().unwrap());
/// assert_eq!(val, AsciiMetadataValue::try_from(b"accept").unwrap());
/// ```
+1 -8
View File
@@ -7,14 +7,7 @@ use crate::transport::service::TlsConnector;
use crate::transport::{service::SharedExec, Error, Executor};
use bytes::Bytes;
use http::{uri::Uri, HeaderValue};
use std::{
convert::{TryFrom, TryInto},
fmt,
future::Future,
pin::Pin,
str::FromStr,
time::Duration,
};
use std::{fmt, future::Future, pin::Pin, str::FromStr, time::Duration};
use tower::make::MakeConnection;
// use crate::transport::E
-2
View File
@@ -3,8 +3,6 @@ use super::io::BoxedIo;
#[cfg(feature = "tls")]
use super::tls::TlsConnector;
use http::Uri;
#[cfg(feature = "tls-roots-common")]
use std::convert::TryInto;
use std::fmt;
use std::task::{Context, Poll};
use tower::make::MakeConnection;
-2
View File
@@ -5,8 +5,6 @@ use crate::transport::{
};
#[cfg(feature = "tls-roots")]
use rustls_native_certs;
#[cfg(feature = "tls")]
use std::convert::TryInto;
use std::{fmt, sync::Arc};
use tokio::io::{AsyncRead, AsyncWrite};
#[cfg(feature = "tls")]