Files
notedeck/enostr/src/profile.rs
William Casarin 0171e6c970 clippy: fix clippy warnings
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-28 12:01:47 -08:00

39 lines
758 B
Rust

use serde_json::Value;
#[derive(Debug, Clone)]
pub struct Profile(Value);
impl Profile {
pub fn new(value: Value) -> Profile {
Profile(value)
}
pub fn name(&self) -> Option<&str> {
self.0["name"].as_str()
}
pub fn display_name(&self) -> Option<&str> {
self.0["display_name"].as_str()
}
pub fn lud06(&self) -> Option<&str> {
self.0["lud06"].as_str()
}
pub fn lud16(&self) -> Option<&str> {
self.0["lud16"].as_str()
}
pub fn about(&self) -> Option<&str> {
self.0["about"].as_str()
}
pub fn picture(&self) -> Option<&str> {
self.0["picture"].as_str()
}
pub fn website(&self) -> Option<&str> {
self.0["website"].as_str()
}
}