Skip to content

Commit

Permalink
clippy::uninlined_format_args
Browse files Browse the repository at this point in the history
  • Loading branch information
AlyoshaVasilieva committed Feb 8, 2023
1 parent e35524b commit 2286080
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/hello.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub(crate) async fn list_countries() -> Result<()> {
} else {
CountryCode::for_alpha2_caseless(&code)?
};
println!("{}: {}", code, country);
println!("{code}: {country}");
}
Ok(())
}
Expand Down
6 changes: 3 additions & 3 deletions src/hello_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub(crate) async fn setup_hola(opts: &Opts) -> Result<Proxy> {
let (bg, uuid) = hello::background_init(uuid).await?;
config.uuid = Some(uuid);
if bg.blocked || bg.permanent {
panic!("Blocked by Hola: {:?}", bg);
panic!("Blocked by Hola: {bg:?}");
}
let proxy_type = ProxyType::Direct;
let tunnels = hello::get_tunnels(&uuid, bg.key, &opts.country, proxy_type, 3).await?;
Expand All @@ -40,9 +40,9 @@ pub(crate) async fn setup_hola(opts: &Opts) -> Result<Proxy> {
tunnels.ip_list.choose(&mut common::get_rng()).expect("no tunnels found in hola response");
let port = proxy_type.get_port(&tunnels.port);
let proxy = if !hostname.is_empty() {
format!("https://{}:{}", hostname, port)
format!("https://{hostname}:{port}")
} else {
format!("http://{}:{}", ip, port)
format!("http://{ip}:{port}")
}; // does this check actually need to exist?
if !opts.discard_creds {
debug!(
Expand Down
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ impl IntoResponse for AppError {
fn into_response(self) -> Response<BoxBody> {
let (status, error_message) = match self {
AppError::Anyhow(e) => {
let message = format!("{:?}", e);
let message = format!("{e:?}");
let status = e
.downcast_ref::<reqwest::Error>()
.and_then(|e| e.status())
Expand Down Expand Up @@ -524,8 +524,8 @@ impl StreamID {
pub(crate) fn get_url(&self) -> String {
const BASE: &str = "https://usher.ttvnw.net/";
match &self {
Self::Live(channel) => format!("{}api/channel/hls/{}.m3u8", BASE, channel),
Self::VOD(id) => format!("{}vod/{}.m3u8", BASE, id),
Self::Live(channel) => format!("{BASE}api/channel/hls/{channel}.m3u8"),
Self::VOD(id) => format!("{BASE}vod/{id}.m3u8"),
}
}
pub(crate) fn data(&self) -> &str {
Expand All @@ -546,7 +546,7 @@ async fn handle_error(error: BoxError) -> impl IntoResponse {
);
}

(StatusCode::INTERNAL_SERVER_ERROR, Cow::from(format!("Unhandled internal error: {}", error)))
(StatusCode::INTERNAL_SERVER_ERROR, Cow::from(format!("Unhandled internal error: {error}")))
}

#[cfg(test)]
Expand Down

0 comments on commit 2286080

Please sign in to comment.