Replace manual Default impl with std derive in tor-config
This commit is contained in:
parent
2becfcf894
commit
e45a95f65a
|
@ -6,7 +6,7 @@ use std::sync::{Arc, RwLock};
|
||||||
///
|
///
|
||||||
/// Internally, this is just a `RwLock<Arc<T>>`; this type just defines some
|
/// Internally, this is just a `RwLock<Arc<T>>`; this type just defines some
|
||||||
/// convenience wrappers for it.
|
/// convenience wrappers for it.
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Default)]
|
||||||
pub struct MutCfg<T> {
|
pub struct MutCfg<T> {
|
||||||
/// The interior configuration object.
|
/// The interior configuration object.
|
||||||
cfg: RwLock<Arc<T>>,
|
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> {
|
impl<T> From<T> for MutCfg<T> {
|
||||||
fn from(config: T) -> MutCfg<T> {
|
fn from(config: T) -> MutCfg<T> {
|
||||||
MutCfg::new(config)
|
MutCfg::new(config)
|
||||||
|
|
Loading…
Reference in New Issue