From 18f5f3c2871966bdf66dfb93917e760a8540b65f Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Sat, 17 Sep 2022 10:34:41 +0800 Subject: [PATCH] refactor: Remove deprecated functions (#18) Signed-off-by: Xuanwo Signed-off-by: Xuanwo --- src/retry.rs | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/src/retry.rs b/src/retry.rs index eeb712d..fbfae5d 100644 --- a/src/retry.rs +++ b/src/retry.rs @@ -121,38 +121,7 @@ where /// Set the conditions for retrying. /// - /// If not specifed, we treat all errors as retryable. - /// - /// # Examples - /// - /// ```no_run - /// use backon::Retry; - /// use backon::ExponentialBackoff; - /// use anyhow::Result; - /// - /// async fn fetch() -> Result { - /// Ok(reqwest::get("https://www.rust-lang.org").await?.text().await?) - /// } - /// - /// #[tokio::main] - /// async fn main() -> Result<()> { - /// let retry = Retry::new(fetch, ExponentialBackoff::default()) - /// .with_error_fn(|e| e.to_string() == "EOF"); - /// let content = retry.await?; - /// println!("fetch succeeded: {}", content); - /// - /// Ok(()) - /// } - /// ``` - #[deprecated(since = "0.0.3", note = "please use `Retry::when` instead")] - pub fn with_error_fn(mut self, error_fn: fn(&E) -> bool) -> Self { - self.retryable = error_fn; - self - } - - /// Set the conditions for retrying. - /// - /// If not specifed, we treat all errors as retryable. + /// If not specified, we treat all errors as retryable. /// /// # Examples ///