mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
use shared pointer for profile_id value
This commit is contained in:
parent
fa7080762e
commit
be30ec660f
3 changed files with 7 additions and 7 deletions
|
|
@ -83,13 +83,13 @@ impl Profile {
|
|||
let database = Rc::new(Database::new(connection.clone()));
|
||||
|
||||
// Get active profile or create new one
|
||||
let profile_id = match database.active() {
|
||||
let profile_id = Rc::new(match database.active() {
|
||||
Some(profile) => profile.id,
|
||||
None => match database.add(true, DateTime::now_local().unwrap(), None) {
|
||||
Ok(id) => id,
|
||||
Err(_) => todo!(),
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
// Result
|
||||
Self {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue