mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-09-10 07:32:49 +02:00
fix warn by removing unused debug imports
delete more imports to quiet cargo
This commit is contained in:
parent
78ade5aa68
commit
25b0d43b9c
2 changed files with 6 additions and 9 deletions
|
@ -3,7 +3,7 @@ use std::{collections::BTreeMap, net::IpAddr, time::Instant};
|
||||||
use axum::extract::State;
|
use axum::extract::State;
|
||||||
use axum_client_ip::InsecureClientIp;
|
use axum_client_ip::InsecureClientIp;
|
||||||
use conduwuit::{
|
use conduwuit::{
|
||||||
Err, Error, Result, debug,
|
Err, Error, Result,
|
||||||
debug::INFO_SPAN_LEVEL,
|
debug::INFO_SPAN_LEVEL,
|
||||||
debug_warn, err, error, info,
|
debug_warn, err, error, info,
|
||||||
result::LogErr,
|
result::LogErr,
|
||||||
|
|
|
@ -5,10 +5,7 @@ use std::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use conduwuit::{
|
use conduwuit::{Err, Error, Result, debug, debug::INFO_SPAN_LEVEL, err, error::inspect_debug_log, implement, trace, utils::string::EMPTY, info};
|
||||||
Err, Error, Result, debug, debug::INFO_SPAN_LEVEL, err,
|
|
||||||
error::inspect_debug_log, implement, trace, utils::string::EMPTY, warn,
|
|
||||||
};
|
|
||||||
use http::{HeaderValue, header::AUTHORIZATION};
|
use http::{HeaderValue, header::AUTHORIZATION};
|
||||||
use ipaddress::IPAddress;
|
use ipaddress::IPAddress;
|
||||||
use reqwest::{Client, Method, Request, Response, Url};
|
use reqwest::{Client, Method, Request, Response, Url};
|
||||||
|
@ -197,9 +194,9 @@ fn handle_error(
|
||||||
) -> Result {
|
) -> Result {
|
||||||
if e.is_timeout() || e.is_connect() {
|
if e.is_timeout() || e.is_connect() {
|
||||||
e = e.without_url();
|
e = e.without_url();
|
||||||
warn!(?url, "network error while sending federation request: {e:?}");
|
trace!(?url, "network error while sending federation request: {e:?}");
|
||||||
} else if e.is_redirect() {
|
} else if e.is_redirect() {
|
||||||
warn!(
|
trace!(
|
||||||
method = ?method,
|
method = ?method,
|
||||||
url = ?url,
|
url = ?url,
|
||||||
final_url = ?e.url(),
|
final_url = ?e.url(),
|
||||||
|
@ -208,7 +205,7 @@ fn handle_error(
|
||||||
e,
|
e,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
warn!(?url, "failed to send federation request: {e:?}");
|
trace!(?url, "failed to send federation request: {e:?}");
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut nice_error = "Request failed".to_owned();
|
let mut nice_error = "Request failed".to_owned();
|
||||||
|
@ -217,7 +214,7 @@ fn handle_error(
|
||||||
write!(nice_error, ": {source:?}").expect("writing to string should not fail");
|
write!(nice_error, ": {source:?}").expect("writing to string should not fail");
|
||||||
src = source.source();
|
src = source.source();
|
||||||
}
|
}
|
||||||
warn!(nice_error, "Federation request error");
|
info!(nice_error, "Federation request error");
|
||||||
|
|
||||||
Err(e.into())
|
Err(e.into())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue