From 26d096bd995605d619b121ab89729ec732b7c08a Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Tue, 30 Jul 2019 15:14:24 -0400 Subject: [PATCH] timeout: Add `Elapsed::new` and prepare 0.1.1 release (#308) * Add Elapsed::new * Prep tower-timeout 0.1.1 release --- tower-timeout/CHANGELOG.md | 4 ++++ tower-timeout/Cargo.toml | 4 ++-- tower-timeout/src/error.rs | 7 +++++++ tower-timeout/src/lib.rs | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tower-timeout/CHANGELOG.md b/tower-timeout/CHANGELOG.md index 24a6a34e..bc467dc5 100644 --- a/tower-timeout/CHANGELOG.md +++ b/tower-timeout/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.1.1 (July 30th, 2019) + +- Add `Elapsed::new` + # 0.1.0 (April 26, 2019) - Initial release diff --git a/tower-timeout/Cargo.toml b/tower-timeout/Cargo.toml index d2fcad52..f76a4f4d 100644 --- a/tower-timeout/Cargo.toml +++ b/tower-timeout/Cargo.toml @@ -8,13 +8,13 @@ name = "tower-timeout" # - README.md # - Update CHANGELOG.md. # - Create "v0.1.x" git tag. -version = "0.1.0" +version = "0.1.1" authors = ["Tower Maintainers "] license = "MIT" readme = "README.md" repository = "https://github.com/tower-rs/tower" homepage = "https://github.com/tower-rs/tower" -documentation = "https://docs.rs/tower-timeout/0.1.0" +documentation = "https://docs.rs/tower-timeout/0.1.1" description = """ Apply a timeout to requests, ensuring completion within a fixed time duration. """ diff --git a/tower-timeout/src/error.rs b/tower-timeout/src/error.rs index 21123c77..a647e271 100644 --- a/tower-timeout/src/error.rs +++ b/tower-timeout/src/error.rs @@ -8,6 +8,13 @@ pub(crate) type Error = Box; #[derive(Debug)] pub struct Elapsed(pub(super) ()); +impl Elapsed { + /// Construct a new elapsed error + pub fn new() -> Self { + Elapsed(()) + } +} + impl fmt::Display for Elapsed { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.pad("request timed out") diff --git a/tower-timeout/src/lib.rs b/tower-timeout/src/lib.rs index 1aa57cf9..f28de178 100644 --- a/tower-timeout/src/lib.rs +++ b/tower-timeout/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/tower-timeout/0.1.0")] +#![doc(html_root_url = "https://docs.rs/tower-timeout/0.1.1")] #![deny(missing_debug_implementations, missing_docs, rust_2018_idioms)] #![allow(elided_lifetimes_in_paths)] #![cfg_attr(test, deny(warnings))]