mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2024-12-24 22:25:55 -05:00
fix some warnings
This commit is contained in:
parent
eb97e618fd
commit
1ae61b4c64
@ -44,7 +44,7 @@ pub struct ConfigFile {
|
||||
#[serde(rename_all = "camelCase", untagged)]
|
||||
pub enum UiDir {
|
||||
FromFilesystem(PathBuf),
|
||||
Bundled(BundledUi),
|
||||
Bundled(#[allow(unused)] BundledUi),
|
||||
}
|
||||
|
||||
impl Default for UiDir {
|
||||
@ -116,5 +116,5 @@ pub enum AddressConfig {
|
||||
///
|
||||
/// See [systemd.socket(5) manual
|
||||
/// page](https://www.freedesktop.org/software/systemd/man/systemd.socket.html).
|
||||
Systemd(String),
|
||||
Systemd(#[cfg_attr(not(target_os = "linux"), allow(unused))] String),
|
||||
}
|
||||
|
@ -37,26 +37,6 @@ use tracing::Instrument;
|
||||
use url::form_urlencoded;
|
||||
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> {
|
||||
Response::builder()
|
||||
.status(status)
|
||||
|
Loading…
Reference in New Issue
Block a user