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.
pub fn my_user(&self) -> &User {
pub fn current_user(&self) -> &User {
&self.0.user
}
}

View file

@ -7,15 +7,15 @@ use crate::{
use jni_toolbox::jni;
/// 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> {
super::tokio().block_on(Client::connect(config))
}
/// Gets the current [crate::api::User].
#[jni(package = "mp.code", class = "Client", ptr)]
fn get_user(client: &mut Client) -> crate::api::User {
client.user().clone()
#[jni(package = "mp.code", class = "Client")]
fn current_user(client: &mut Client) -> crate::api::User {
client.current_user().clone()
}
/// Join a [Workspace] and return a pointer to it.