- chore: ran cargo fix on the codebase
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
use crate::character::character_service_client::CharacterServiceClient;
|
||||
use crate::character::{CreateCharacterRequest, CreateCharacterResponse, DeleteCharacterRequest, DeleteCharacterResponse, GetCharacterListRequest, GetCharacterListResponse, GetCharacterRequest, GetCharacterResponse};
|
||||
use crate::character::{
|
||||
CreateCharacterRequest, CreateCharacterResponse, DeleteCharacterRequest,
|
||||
DeleteCharacterResponse, GetCharacterListRequest, GetCharacterListResponse,
|
||||
GetCharacterRequest, GetCharacterResponse,
|
||||
};
|
||||
use tonic::transport::Channel;
|
||||
use utils::null_string::NullTerminatedString;
|
||||
|
||||
@@ -14,7 +18,10 @@ impl CharacterClient {
|
||||
Ok(CharacterClient { client })
|
||||
}
|
||||
|
||||
pub async fn get_character_list(&mut self, user_id: &str) -> Result<GetCharacterListResponse, Box<dyn std::error::Error + Send + Sync>> {
|
||||
pub async fn get_character_list(
|
||||
&mut self,
|
||||
user_id: &str,
|
||||
) -> Result<GetCharacterListResponse, Box<dyn std::error::Error + Send + Sync>> {
|
||||
let request = GetCharacterListRequest {
|
||||
user_id: user_id.to_string(),
|
||||
};
|
||||
@@ -23,7 +30,15 @@ impl CharacterClient {
|
||||
Ok(response.into_inner())
|
||||
}
|
||||
|
||||
pub async fn create_character(&mut self, user_id: &str, name: NullTerminatedString, race: u8, face: u8, hair: u8, stone: u8) -> Result<CreateCharacterResponse, Box<dyn std::error::Error + Send + Sync>> {
|
||||
pub async fn create_character(
|
||||
&mut self,
|
||||
user_id: &str,
|
||||
name: NullTerminatedString,
|
||||
race: u8,
|
||||
face: u8,
|
||||
hair: u8,
|
||||
stone: u8,
|
||||
) -> Result<CreateCharacterResponse, Box<dyn std::error::Error + Send + Sync>> {
|
||||
let request = CreateCharacterRequest {
|
||||
user_id: user_id.to_string(),
|
||||
name: name.0,
|
||||
@@ -37,18 +52,27 @@ impl CharacterClient {
|
||||
Ok(response.into_inner())
|
||||
}
|
||||
|
||||
pub async fn delete_character(&mut self, user_id: &str, char_id: &str, delete_type: i32) -> Result<DeleteCharacterResponse, Box<dyn std::error::Error + Send + Sync>> {
|
||||
pub async fn delete_character(
|
||||
&mut self,
|
||||
user_id: &str,
|
||||
char_id: &str,
|
||||
delete_type: i32,
|
||||
) -> Result<DeleteCharacterResponse, Box<dyn std::error::Error + Send + Sync>> {
|
||||
let request = DeleteCharacterRequest {
|
||||
user_id: user_id.to_string(),
|
||||
char_id: char_id.to_string(),
|
||||
delete_type
|
||||
delete_type,
|
||||
};
|
||||
|
||||
let response = self.client.delete_character(request).await?;
|
||||
Ok(response.into_inner())
|
||||
}
|
||||
|
||||
pub async fn get_character(&mut self, user_id: &str, char_id: u8) -> Result<GetCharacterResponse, Box<dyn std::error::Error + Send + Sync>> {
|
||||
pub async fn get_character(
|
||||
&mut self,
|
||||
user_id: &str,
|
||||
char_id: u8,
|
||||
) -> Result<GetCharacterResponse, Box<dyn std::error::Error + Send + Sync>> {
|
||||
let request = GetCharacterRequest {
|
||||
user_id: user_id.to_string(),
|
||||
char_id: char_id.to_string(),
|
||||
|
||||
Reference in New Issue
Block a user