Library: Add compatibility for legacy Tokio 0.2 (#40)
Adds support to the library for tokio 0.2 backward-compatibility. This should hopefully benefit, and prevent lavalink-rs from being blocked on this feature. These can be reached using, e.g., `gateway-tokio-02`, `driver-tokio-02`, `serenity-rustls-tokio-02`, and `serenity-native-tokio-02` features. Naturally, this requires some jiggering about with features and the underlying CI, which has been taken care of. Twilight can't be handled in this way, as their last tokio 0.2 version uses the deprecated Discord Gateway v6.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
//! Newtypes around Discord IDs for library cross-compatibility.
|
||||
|
||||
#[cfg(feature = "driver")]
|
||||
#[cfg(feature = "driver-core")]
|
||||
use crate::model::id::{GuildId as DriverGuild, UserId as DriverUser};
|
||||
#[cfg(feature = "serenity")]
|
||||
use serenity::model::id::{
|
||||
@@ -73,7 +73,7 @@ impl From<SerenityGuild> for GuildId {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "driver")]
|
||||
#[cfg(feature = "driver-core")]
|
||||
impl From<GuildId> for DriverGuild {
|
||||
fn from(id: GuildId) -> Self {
|
||||
Self(id.0)
|
||||
@@ -106,7 +106,7 @@ impl From<SerenityUser> for UserId {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "driver")]
|
||||
#[cfg(feature = "driver-core")]
|
||||
impl From<UserId> for DriverUser {
|
||||
fn from(id: UserId) -> Self {
|
||||
Self(id.0)
|
||||
|
||||
Reference in New Issue
Block a user