use optionals, remove undefined enums

This commit is contained in:
yggverse 2024-09-27 20:38:55 +03:00
parent 11b9dc94d3
commit b3c7545717
6 changed files with 52 additions and 47 deletions

View file

@ -1,24 +1,23 @@
use gtk::glib::GString;
pub enum Mime {
Undefined,
TextGemini,
TextPlain,
}
pub struct Meta {
pub title: GString,
pub description: GString,
pub mime: Mime,
pub title: Option<GString>,
pub description: Option<GString>,
pub mime: Option<Mime>,
pub progress_fraction: f32,
}
impl Meta {
pub fn new() -> Self {
Self {
title: GString::new(),
description: GString::new(),
mime: Mime::Undefined,
title: None,
description: None,
mime: None,
progress_fraction: 0.0,
}
}