profile: fix crash with ProfileState defaults

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2025-07-15 14:14:50 -07:00
parent e9ee1b5094
commit 6bf6af7f9e

View File

@@ -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))