change reference to be mutable

This commit is contained in:
bitfl0wer 2023-05-03 17:29:32 +02:00
parent 98bf70ec5e
commit 809702bc1d
No known key found for this signature in database
GPG Key ID: 84BBB60DF895ABF2
1 changed files with 3 additions and 3 deletions

View File

@ -154,7 +154,7 @@ pub struct UserObject {
#[derive(Debug)] #[derive(Debug)]
pub struct User<'a> { pub struct User<'a> {
pub logged_in: bool, pub logged_in: bool,
pub belongs_to: &'a Instance<'a>, pub belongs_to: &'a mut Instance<'a>,
token: String, token: String,
pub rate_limits: Limits, pub rate_limits: Limits,
pub settings: UserSettings, pub settings: UserSettings,
@ -166,7 +166,7 @@ impl<'a> User<'a> {
self.logged_in self.logged_in
} }
pub fn belongs_to(&self) -> &Instance { pub fn belongs_to(&mut self) -> &mut Instance<'a> {
self.belongs_to self.belongs_to
} }
@ -184,7 +184,7 @@ impl<'a> User<'a> {
pub fn new( pub fn new(
logged_in: bool, logged_in: bool,
belongs_to: &'a Instance<'a>, belongs_to: &'a mut Instance<'a>,
token: String, token: String,
rate_limits: Limits, rate_limits: Limits,
settings: UserSettings, settings: UserSettings,