mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-17 16:54:18 +01:00
profile: fix crash with ProfileState defaults
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user