chore: my_user -> current_user

This commit is contained in:
əlemi 2024-10-15 22:21:19 +02:00
parent 9a4225cf0d
commit 3bf620d41a
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 5 additions and 5 deletions

View file

@ -203,7 +203,7 @@ impl Client {
} }
/// Get the currently logged in user. /// Get the currently logged in user.
pub fn my_user(&self) -> &User { pub fn current_user(&self) -> &User {
&self.0.user &self.0.user
} }
} }

View file

@ -7,15 +7,15 @@ use crate::{
use jni_toolbox::jni; use jni_toolbox::jni;
/// Connect using the given credentials to the default server, and return a [Client] to interact with it. /// Connect using the given credentials to the default server, and return a [Client] to interact with it.
#[jni(package = "mp.code", class = "Client", ptr)] #[jni(package = "mp.code", class = "Client")]
fn connect(config: Config) -> Result<Client, ConnectionError> { fn connect(config: Config) -> Result<Client, ConnectionError> {
super::tokio().block_on(Client::connect(config)) super::tokio().block_on(Client::connect(config))
} }
/// Gets the current [crate::api::User]. /// Gets the current [crate::api::User].
#[jni(package = "mp.code", class = "Client", ptr)] #[jni(package = "mp.code", class = "Client")]
fn get_user(client: &mut Client) -> crate::api::User { fn current_user(client: &mut Client) -> crate::api::User {
client.user().clone() client.current_user().clone()
} }
/// Join a [Workspace] and return a pointer to it. /// Join a [Workspace] and return a pointer to it.