use struct constructor

This commit is contained in:
yggverse 2024-09-22 13:23:46 +03:00
parent 08db41b927
commit 80fecec656
2 changed files with 8 additions and 2 deletions

View File

@ -1,7 +1,7 @@
use std::sync::Arc;
pub struct Browser {
pub connection: Arc<sqlite::Connection>,
connection: Arc<sqlite::Connection>,
}
impl Browser {
@ -9,3 +9,9 @@ impl Browser {
fn save(&self) {}
fn restore(&self) {}
}
pub fn new(connection: Arc<sqlite::Connection>) -> Browser {
let this = Browser { connection };
this.init();
this
}

View File

@ -64,7 +64,7 @@ pub fn new(
// Done
Browser {
db: db::Browser { connection },
db: db::new(connection),
widget,
header,
main,