commit 6bf6af7f9e2a24b3a0fe758482d99eb2ef2a888c
parent e9ee1b50949084af3e93269782bf993566e7dac3
Author: William Casarin <jb55@jb55.com>
Date: Tue, 15 Jul 2025 14:14:50 -0700
profile: fix crash with ProfileState defaults
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/crates/enostr/src/profile.rs b/crates/enostr/src/profile.rs
@@ -1,8 +1,14 @@
use serde_json::{Map, Value};
-#[derive(Debug, Clone, Default)]
+#[derive(Debug, Clone)]
pub struct ProfileState(Value);
+impl Default for ProfileState {
+ fn default() -> Self {
+ ProfileState::new(Map::default())
+ }
+}
+
impl ProfileState {
pub fn new(value: Map<String, Value>) -> Self {
Self(Value::Object(value))