Skip to content

Commit

Permalink
Renet: Impl Error for DisconnectReason (#152)
Browse files Browse the repository at this point in the history
Useful for integrations and abstractions.
  • Loading branch information
Shatur committed Feb 29, 2024
1 parent 957a0ce commit b22876c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion renetcode/src/client.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{fmt, net::SocketAddr, time::Duration};
use std::{error::Error, fmt, net::SocketAddr, time::Duration};

use crate::{
packet::Packet, replay_protection::ReplayProtection, token::ConnectToken, NetcodeError, NETCODE_CHALLENGE_TOKEN_BYTES,
Expand Down Expand Up @@ -85,6 +85,8 @@ impl fmt::Display for DisconnectReason {
}
}

impl Error for DisconnectReason {}

impl NetcodeClient {
pub fn new(current_time: Duration, authentication: ClientAuthentication) -> Result<Self, NetcodeError> {
let connect_token: ConnectToken = match authentication {
Expand Down

0 comments on commit b22876c

Please sign in to comment.