NetrexMC / RakNet

RakNet implementation in Rust
Apache License 2.0
44 stars 12 forks source link

Implement std::fmt::Display and std::error::Error for exposed error types #57

Closed lexika979 closed 7 months ago

lexika979 commented 7 months ago

This change allows users of raknet to use eyre and anyhow to propagate the errors upwards using the ? operator:

async fn smth() -> eyre::Result<()> {
    // These work now:
    let mut listener = Listener::bind("0.0.0.0:1234").await?;
    listener.start().await?;

    Ok(())
}
john-bv commented 7 months ago

Looks good, i'll look more in depth later today!