mirror of https://github.com/fafhrd91/actix-web
clippy
This commit is contained in:
parent
d1efe02e92
commit
50738867af
|
@ -1,6 +1,6 @@
|
|||
[alias]
|
||||
chk = "check --workspace --all-features --tests --examples --bins"
|
||||
lint = "clippy --workspace --tests --examples"
|
||||
lint = "clippy --workspace --all-features --tests --examples --bins"
|
||||
ci-min = "hack check --workspace --no-default-features"
|
||||
ci-min-test = "hack check --workspace --no-default-features --tests --examples"
|
||||
ci-default = "check --workspace --bins --tests --examples"
|
||||
|
|
|
@ -104,6 +104,8 @@ impl ServiceConfig {
|
|||
}
|
||||
|
||||
/// Returns the local address that this server is bound to.
|
||||
///
|
||||
/// Returns `None` for connections via UDS (Unix Domain Socket).
|
||||
#[inline]
|
||||
pub fn local_addr(&self) -> Option<net::SocketAddr> {
|
||||
self.0.local_addr
|
||||
|
|
|
@ -65,10 +65,10 @@ fn first_header_value<'a>(req: &'a RequestHead, name: &'_ HeaderName) -> Option<
|
|||
/// [rfc7239-63]: https://datatracker.ietf.org/doc/html/rfc7239#section-6.3
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct ConnectionInfo {
|
||||
scheme: String,
|
||||
host: String,
|
||||
realip_remote_addr: Option<String>,
|
||||
scheme: String,
|
||||
remote_addr: Option<String>,
|
||||
realip_remote_addr: Option<String>,
|
||||
}
|
||||
|
||||
impl ConnectionInfo {
|
||||
|
@ -145,9 +145,9 @@ impl ConnectionInfo {
|
|||
let remote_addr = req.peer_addr.map(|addr| addr.to_string());
|
||||
|
||||
ConnectionInfo {
|
||||
remote_addr,
|
||||
scheme,
|
||||
host,
|
||||
scheme,
|
||||
remote_addr,
|
||||
realip_remote_addr,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -558,8 +558,8 @@ where
|
|||
Ok(self)
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
/// Start listening for incoming unix domain connections.
|
||||
#[cfg(unix)]
|
||||
pub fn bind_uds<A>(mut self, addr: A) -> io::Result<Self>
|
||||
where
|
||||
A: AsRef<std::path::Path>,
|
||||
|
@ -598,7 +598,6 @@ where
|
|||
.keep_alive(c.keep_alive)
|
||||
.client_timeout(c.client_timeout)
|
||||
.client_disconnect(c.client_shutdown)
|
||||
.local_addr(socket_addr)
|
||||
.finish(map_config(fac, move |_| config.clone())),
|
||||
)
|
||||
},
|
||||
|
|
|
@ -23,7 +23,7 @@ impl std::fmt::Display for MyError {
|
|||
|
||||
#[get("/test")]
|
||||
async fn test() -> Result<actix_web::HttpResponse, actix_web::error::Error> {
|
||||
return Err(MyError.into());
|
||||
Err(MyError.into())
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
|
|
Loading…
Reference in New Issue