Fixed instance lifetime parameter

This commit is contained in:
kozabrada123 2023-05-05 22:46:00 +02:00
parent 22bfe1be07
commit a4fdf18106
4 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,7 @@ pub mod login {
use crate::errors::InstanceServerError; use crate::errors::InstanceServerError;
use crate::instance::Instance; use crate::instance::Instance;
impl Instance<'_> { impl<'a> Instance<'a> {
pub async fn login_account( pub async fn login_account(
&mut self, &mut self,
login_schema: &LoginSchema, login_schema: &LoginSchema,

View File

@ -8,7 +8,7 @@ pub mod register {
instance::{Instance, Token}, instance::{Instance, Token},
}; };
impl Instance<'_> { impl<'a> Instance<'a> {
/** /**
Registers a new user on the Spacebar server. Registers a new user on the Spacebar server.
# Arguments # Arguments

View File

@ -5,7 +5,7 @@ pub mod instance {
use crate::errors::InstanceServerError; use crate::errors::InstanceServerError;
use crate::{api::types::InstancePolicies, instance::Instance}; use crate::{api::types::InstancePolicies, instance::Instance};
impl Instance<'_> { impl<'a> Instance<'a> {
/** /**
Gets the instance policies schema. Gets the instance policies schema.
# Errors # Errors

View File

@ -20,7 +20,7 @@ pub struct Instance<'a> {
pub users: HashMap<Token, User>, pub users: HashMap<Token, User>,
} }
impl Instance<'_> { impl<'a> Instance<'a> {
/// Creates a new [`Instance`]. /// Creates a new [`Instance`].
/// # Arguments /// # Arguments
/// * `urls` - The [`URLBundle`] that contains all the URLs that are needed to connect to the Spacebar server. /// * `urls` - The [`URLBundle`] that contains all the URLs that are needed to connect to the Spacebar server.
@ -30,7 +30,7 @@ impl Instance<'_> {
pub async fn new( pub async fn new(
urls: URLBundle, urls: URLBundle,
requester: LimitedRequester, requester: LimitedRequester,
) -> Result<Instance<'static>, InstanceServerError> { ) -> Result<Instance<'a>, InstanceServerError> {
let users: HashMap<Token, User> = HashMap::new(); let users: HashMap<Token, User> = HashMap::new();
let mut instance = Instance { let mut instance = Instance {
urls: urls.clone(), urls: urls.clone(),