Commit 486c73b6 authored by Ian Jackson's avatar Ian Jackson
Browse files

Replace manual Clone impl with std derive in retry-error

This just clones the fields.  It is not clear to me why it was
written this way in be86df63
   Remove anyhow dependency from tor-retry, and rename it to retry-error

Previously, I think, RetryError wasn't Clone.
parent 90f86b47
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ use std::fmt::{Debug, Display, Error as FmtError, Formatter};
/// fails, use [`RetryError::push()`] to add a new error to the list
/// of errors.  If the operation fails too many times, you can use
/// RetryError as an [`Error`] itself.
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct RetryError<E> {
    /// The operation we were trying to do.
    doing: String,
@@ -191,16 +191,6 @@ impl Attempt {
    }
}

impl<E: Clone> Clone for RetryError<E> {
    fn clone(&self) -> RetryError<E> {
        RetryError {
            doing: self.doing.clone(),
            errors: self.errors.clone(),
            n_errors: self.n_errors,
        }
    }
}

impl<E, T> Extend<T> for RetryError<E>
where
    T: Into<E>,