From c4b15b5bf055026a55c9fe8627eada1a2cb7b26f Mon Sep 17 00:00:00 2001 From: bitfl0wer Date: Wed, 3 May 2023 17:29:32 +0200 Subject: [PATCH] change reference to be mutable --- src/api/types.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/types.rs b/src/api/types.rs index 1ab64b1..a070587 100644 --- a/src/api/types.rs +++ b/src/api/types.rs @@ -154,7 +154,7 @@ pub struct UserObject { #[derive(Debug)] pub struct User<'a> { pub logged_in: bool, - pub belongs_to: &'a Instance<'a>, + pub belongs_to: &'a mut Instance<'a>, token: String, pub rate_limits: Limits, pub settings: UserSettings, @@ -166,7 +166,7 @@ impl<'a> User<'a> { self.logged_in } - pub fn belongs_to(&self) -> &Instance { + pub fn belongs_to(&mut self) -> &mut Instance<'a> { self.belongs_to } @@ -184,7 +184,7 @@ impl<'a> User<'a> { pub fn new( logged_in: bool, - belongs_to: &'a Instance<'a>, + belongs_to: &'a mut Instance<'a>, token: String, rate_limits: Limits, settings: UserSettings,