From 49c33461029f5c3a22e12e3d251319237d73b4a4 Mon Sep 17 00:00:00 2001 From: Erk Date: Wed, 25 May 2022 20:11:57 +0000 Subject: [PATCH] Update twilight support to twilight 0.11 (#132) * update twilight support to twilight 0.11 * rustfmt --- Cargo.toml | 4 ++-- examples/twilight/Cargo.toml | 8 ++++---- src/manager.rs | 6 +----- src/tracks/error.rs | 5 +++-- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ac63e4891..a502ff8ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -89,12 +89,12 @@ default-features = false [dependencies.twilight-gateway] optional = true -version = ">=0.9.0, <0.11.0" +version = "0.11.0" default-features = false [dependencies.twilight-model] optional = true -version = ">=0.9.0, <0.11.0" +version = "0.11.0" default-features = false [dependencies.typemap_rev] diff --git a/examples/twilight/Cargo.toml b/examples/twilight/Cargo.toml index 039b0e4cb..68e0a04d5 100644 --- a/examples/twilight/Cargo.toml +++ b/examples/twilight/Cargo.toml @@ -9,10 +9,10 @@ futures = "0.3" tracing = "0.1" tracing-subscriber = "0.2" tokio = { features = ["macros", "rt-multi-thread", "sync"], version = "1" } -twilight-gateway = "0.10" -twilight-http = "0.10" -twilight-model = "0.10" -twilight-standby = "0.10" +twilight-gateway = "0.11" +twilight-http = "0.11" +twilight-model = "0.11" +twilight-standby = "0.11" [dependencies.songbird] default-features = false diff --git a/src/manager.rs b/src/manager.rs index 819a62d98..6ebad0e87 100644 --- a/src/manager.rs +++ b/src/manager.rs @@ -105,11 +105,7 @@ impl Songbird { { Self { client_data: PRwLock::new(ClientData { - shard_count: cluster - .config() - .shard_scheme() - .total() - .unwrap_or_else(|| cluster.shards().len() as u64), + shard_count: cluster.config().shard_scheme().total(), initialised: true, user_id: user_id.into(), }), diff --git a/src/tracks/error.rs b/src/tracks/error.rs index 1acada94e..9cf3dc3fa 100644 --- a/src/tracks/error.rs +++ b/src/tracks/error.rs @@ -24,8 +24,9 @@ impl fmt::Display for TrackError { write!(f, "failed to operate on track (handle): ")?; match self { TrackError::Finished => write!(f, "track ended"), - TrackError::InvalidTrackEvent => - write!(f, "given event listener can't be fired on a track"), + TrackError::InvalidTrackEvent => { + write!(f, "given event listener can't be fired on a track") + }, TrackError::SeekUnsupported => write!(f, "track did not support seeking"), } }