Skip to content

Commit

Permalink
Use the correct abstraction to build connection
Browse files Browse the repository at this point in the history
  • Loading branch information
udoprog committed Apr 18, 2023
1 parent 95a086a commit 8ac9448
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
20 changes: 1 addition & 19 deletions bot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,25 +106,7 @@ static SETTINGS_SCHEMA: &[u8] = include_bytes!("settings.yaml");
static AUTH_SCHEMA: &[u8] = include_bytes!("auth.yaml");

// Crates to enable logging for, by default.
static CRATES: &[&str] = &[
"bot_api",
"bot_auth",
"bot_bus",
"bot_chat",
"bot_common",
"bot_currency",
"bot_db",
"bot_emotes",
"bot_messagelog",
"bot_oauth2",
"bot_player",
"bot_settings",
"bot_storage",
"bot_template",
"bot_web",
"oxidize",
"panic",
];
static CRATES: &[&str] = &["bot_", "oxidize", "panic"];

pub mod cli;
mod module;
Expand Down
4 changes: 2 additions & 2 deletions crates/bot-api/src/twitch/pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use serde::{Deserialize, Serialize};
use tokio::sync::broadcast;
use tokio::time::{self, Interval, Sleep};
use tokio_tungstenite::tungstenite;
use tokio_tungstenite::tungstenite::handshake::client::Request;
use tokio_tungstenite::tungstenite::client::IntoClientRequest;
use tokio_tungstenite::tungstenite::http::Uri;
use tokio_tungstenite::{MaybeTlsStream, WebSocketStream};
use tracing::Instrument;
Expand Down Expand Up @@ -196,7 +196,7 @@ impl State {
let auth_token = streamer.client.token.read().map(|(t, _)| t);

let uri = str::parse::<Uri>(URL)?;
let req = Request::get(uri).body(())?;
let req = uri.into_client_request()?;
let (stream, _) = tokio_tungstenite::connect_async(req).await?;

let mut client = Client { stream };
Expand Down

0 comments on commit 8ac9448

Please sign in to comment.