fix some warnings

This commit is contained in:
Scott Lamb 2024-05-30 18:19:03 -07:00
parent eb97e618fd
commit 1ae61b4c64
2 changed files with 2 additions and 22 deletions

View File

@ -44,7 +44,7 @@ pub struct ConfigFile {
#[serde(rename_all = "camelCase", untagged)] #[serde(rename_all = "camelCase", untagged)]
pub enum UiDir { pub enum UiDir {
FromFilesystem(PathBuf), FromFilesystem(PathBuf),
Bundled(BundledUi), Bundled(#[allow(unused)] BundledUi),
} }
impl Default for UiDir { impl Default for UiDir {
@ -116,5 +116,5 @@ pub enum AddressConfig {
/// ///
/// See [systemd.socket(5) manual /// See [systemd.socket(5) manual
/// page](https://www.freedesktop.org/software/systemd/man/systemd.socket.html). /// page](https://www.freedesktop.org/software/systemd/man/systemd.socket.html).
Systemd(String), Systemd(#[cfg_attr(not(target_os = "linux"), allow(unused))] String),
} }

View File

@ -37,26 +37,6 @@ use tracing::Instrument;
use url::form_urlencoded; use url::form_urlencoded;
use uuid::Uuid; use uuid::Uuid;
/// An HTTP error response.
/// This is a thin wrapper over the hyper response type; it doesn't even verify
/// that the response actually uses a non-2xx status code. Its purpose is to
/// allow automatic conversion from `base::Error`. Rust's orphan rule prevents
/// this crate from defining a direct conversion from `base::Error` to
/// `hyper::Response`.
struct HttpError(Response<Body>);
impl From<Response<Body>> for HttpError {
fn from(response: Response<Body>) -> Self {
HttpError(response)
}
}
impl From<base::Error> for HttpError {
fn from(err: base::Error) -> Self {
HttpError(from_base_error(&err))
}
}
fn plain_response<B: Into<Body>>(status: http::StatusCode, body: B) -> Response<Body> { fn plain_response<B: Into<Body>>(status: http::StatusCode, body: B) -> Response<Body> {
Response::builder() Response::builder()
.status(status) .status(status)