From 50952581de4c8cc77d27397ed233418deffc0b31 Mon Sep 17 00:00:00 2001 From: Joshua McQuistan Date: Sat, 28 Oct 2023 12:28:26 +0100 Subject: [PATCH] Clean up of UseStorageOptions default --- src/storage/use_storage.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/storage/use_storage.rs b/src/storage/use_storage.rs index cd2a26b..cd08b48 100644 --- a/src/storage/use_storage.rs +++ b/src/storage/use_storage.rs @@ -288,18 +288,13 @@ fn handle_error( result.or_else(|err| Err((on_error)(err))) } -impl + Default> Default for UseStorageOptions { +impl + Default> Default for UseStorageOptions { fn default() -> Self { - Self { - codec: C::default(), - on_error: Rc::new(|_err| ()), - listen_to_storage_changes: true, - default_value: MaybeRwSignal::default(), - } + Self::new(C::default()) } } -impl> UseStorageOptions { +impl> UseStorageOptions { pub(super) fn new(codec: C) -> Self { Self { codec,