mirror of
https://github.com/mat-1/azalea.git
synced 2024-09-20 07:02:31 +00:00
oop fix another unwrap
This commit is contained in:
parent
f235c9d064
commit
65d8fdcb6c
2 changed files with 4 additions and 2 deletions
|
@ -14,7 +14,7 @@ pub mod ping;
|
||||||
mod player;
|
mod player;
|
||||||
|
|
||||||
pub use account::Account;
|
pub use account::Account;
|
||||||
pub use client::{Client, ClientInformation, Event};
|
pub use client::{Client, ClientInformation, Event, JoinError};
|
||||||
pub use movement::MoveDirection;
|
pub use movement::MoveDirection;
|
||||||
pub use player::Player;
|
pub use player::Player;
|
||||||
|
|
||||||
|
|
|
@ -123,6 +123,8 @@ where
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error("Invalid address")]
|
#[error("Invalid address")]
|
||||||
InvalidAddress,
|
InvalidAddress,
|
||||||
|
#[error("Join error: {0}")]
|
||||||
|
Join(#[from] azalea_client::JoinError),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Join a server and start handling events. This function will run forever until
|
/// Join a server and start handling events. This function will run forever until
|
||||||
|
@ -151,7 +153,7 @@ pub async fn start<
|
||||||
Err(_) => return Err(Error::InvalidAddress),
|
Err(_) => return Err(Error::InvalidAddress),
|
||||||
};
|
};
|
||||||
|
|
||||||
let (bot, mut rx) = Client::join(&options.account, address).await.unwrap();
|
let (bot, mut rx) = Client::join(&options.account, address).await?;
|
||||||
|
|
||||||
let state = options.state;
|
let state = options.state;
|
||||||
let bot_plugin = bot::Plugin::default();
|
let bot_plugin = bot::Plugin::default();
|
||||||
|
|
Loading…
Reference in a new issue