Fix clippy issues

This commit is contained in:
Jai A
2023-03-30 15:18:57 -07:00
parent 80e1ae4553
commit 4875ed4359
16 changed files with 114 additions and 87 deletions

View File

@@ -3,12 +3,14 @@ use async_tungstenite as ws;
use bincode::{Decode, Encode};
use chrono::{prelude::*, Duration};
use futures::prelude::*;
use once_cell::sync::*;
use lazy_static::lazy_static;
use serde::Deserialize;
use url::Url;
pub const HYDRA_URL: Lazy<Url> =
Lazy::new(|| Url::parse("https://hydra.modrinth.com").unwrap());
lazy_static! {
static ref HYDRA_URL: Url =
Url::parse("https://hydra.modrinth.com").unwrap();
}
// Socket messages
#[derive(Deserialize)]
@@ -65,7 +67,7 @@ pub struct HydraAuthFlow<S: AsyncRead + AsyncWrite + Unpin> {
impl HydraAuthFlow<ws::tokio::ConnectStream> {
pub async fn new() -> crate::Result<Self> {
let sock_url = wrap_ref_builder!(
it = HYDRA_URL =>
it = HYDRA_URL.clone() =>
{ it.set_scheme("wss").ok() }
);
let (socket, _) = ws::tokio::connect_async(sock_url.clone()).await?;