From b375725dd9a3e842232813567728ca8d268bfc0e Mon Sep 17 00:00:00 2001 From: Steve Sampson Date: Fri, 23 Sep 2022 19:01:56 -0300 Subject: [PATCH 1/4] add `Result` type alias for `std::result::Result` --- tonic/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tonic/src/lib.rs b/tonic/src/lib.rs index f126ada16..4c1ed3000 100644 --- a/tonic/src/lib.rs +++ b/tonic/src/lib.rs @@ -122,3 +122,5 @@ pub(crate) type Error = Box; #[cfg(feature = "codegen")] #[cfg_attr(docsrs, doc(cfg(feature = "codegen")))] pub mod codegen; + +pub type Result = std::result::Result; \ No newline at end of file From 09f11fde82bc5635ade5aa1a3569dfb55e87e036 Mon Sep 17 00:00:00 2001 From: Stephen Sampson <36173115+stphnsmpsn@users.noreply.github.com> Date: Fri, 23 Sep 2022 19:52:47 -0300 Subject: [PATCH 2/4] Allow user to override the error type Co-authored-by: David Pedersen --- tonic/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tonic/src/lib.rs b/tonic/src/lib.rs index 4c1ed3000..0f7e84e19 100644 --- a/tonic/src/lib.rs +++ b/tonic/src/lib.rs @@ -123,4 +123,4 @@ pub(crate) type Error = Box; #[cfg_attr(docsrs, doc(cfg(feature = "codegen")))] pub mod codegen; -pub type Result = std::result::Result; \ No newline at end of file +pub type Result = std::result::Result; \ No newline at end of file From cc27a87d21f7fafd41e28d583f12cd41db3586d6 Mon Sep 17 00:00:00 2001 From: Steve Sampson Date: Fri, 23 Sep 2022 19:55:51 -0300 Subject: [PATCH 3/4] add rustdoc for `tonic::Result` --- tonic/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tonic/src/lib.rs b/tonic/src/lib.rs index 0f7e84e19..b610017ab 100644 --- a/tonic/src/lib.rs +++ b/tonic/src/lib.rs @@ -123,4 +123,6 @@ pub(crate) type Error = Box; #[cfg_attr(docsrs, doc(cfg(feature = "codegen")))] pub mod codegen; +/// `Result` is a type that represents either success ([`Ok`]) or failure ([`Err`]). +/// By default, the Err value is of type [`Status`] but this can be overridden if desired. pub type Result = std::result::Result; \ No newline at end of file From 6982b5ac9d751218a20625323a9a5ea327dc9597 Mon Sep 17 00:00:00 2001 From: Steve Sampson Date: Sat, 24 Sep 2022 18:28:56 -0300 Subject: [PATCH 4/4] cargo fmt --- tonic/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tonic/src/lib.rs b/tonic/src/lib.rs index b610017ab..9ab6b6967 100644 --- a/tonic/src/lib.rs +++ b/tonic/src/lib.rs @@ -125,4 +125,4 @@ pub mod codegen; /// `Result` is a type that represents either success ([`Ok`]) or failure ([`Err`]). /// By default, the Err value is of type [`Status`] but this can be overridden if desired. -pub type Result = std::result::Result; \ No newline at end of file +pub type Result = std::result::Result;