Replace manual Default impl with std derive in tor-config

This commit is contained in:
Ian Jackson 2022-03-02 17:37:36 +00:00
parent 2becfcf894
commit e45a95f65a
1 changed files with 1 additions and 7 deletions

View File

@ -6,7 +6,7 @@ use std::sync::{Arc, RwLock};
///
/// Internally, this is just a `RwLock<Arc<T>>`; this type just defines some
/// convenience wrappers for it.
#[derive(Debug)]
#[derive(Debug, Default)]
pub struct MutCfg<T> {
/// The interior configuration object.
cfg: RwLock<Arc<T>>,
@ -55,12 +55,6 @@ impl<T> MutCfg<T> {
}
}
impl<T: Default> Default for MutCfg<T> {
fn default() -> Self {
MutCfg::new(T::default())
}
}
impl<T> From<T> for MutCfg<T> {
fn from(config: T) -> MutCfg<T> {
MutCfg::new(config)