JavaScript is disabled, refresh for a better experience. ambee/giterated

ambee/giterated

Git repository hosting, collaboration, and discovery for the Fediverse.

Add settings

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨0448edb

⁨src/model/settings.rs⁩ - ⁨454⁩ bytes
Raw
1 use serde::{Deserialize, Serialize};
2
3 pub trait Setting: Serialize {
4 fn name(&self) -> &'static str;
5 }
6
7 #[derive(Debug, Serialize, Deserialize)]
8 pub struct UserBio(pub String);
9
10 impl Setting for UserBio {
11 fn name(&self) -> &'static str {
12 "Bio"
13 }
14 }
15
16 #[derive(Debug, Serialize, Deserialize)]
17 pub struct UserDisplayName(pub String);
18
19 impl Setting for UserDisplayName {
20 fn name(&self) -> &'static str {
21 "Display Name"
22 }
23 }
24