mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-28 05:04:15 -05:00
clean up some clippy warnings
This commit is contained in:
@@ -58,7 +58,7 @@ fn update_limits(model: &Model, siv: &mut Cursive) {
|
||||
fn edit_limit(model: &RefCell<Model>, siv: &mut Cursive, id: i32, content: &str) {
|
||||
debug!("on_edit called for id {}", id);
|
||||
let mut model = model.borrow_mut();
|
||||
let model: &mut Model = &mut *model;
|
||||
let model: &mut Model = &mut model;
|
||||
let stream = model.streams.get_mut(&id).unwrap();
|
||||
let new_value = decode_size(content).ok();
|
||||
let delta = new_value.unwrap_or(0) - stream.retain.unwrap_or(0);
|
||||
@@ -95,7 +95,7 @@ fn edit_limit(model: &RefCell<Model>, siv: &mut Cursive, id: i32, content: &str)
|
||||
|
||||
fn edit_record(model: &RefCell<Model>, id: i32, record: bool) {
|
||||
let mut model = model.borrow_mut();
|
||||
let model: &mut Model = &mut *model;
|
||||
let model: &mut Model = &mut model;
|
||||
let stream = model.streams.get_mut(&id).unwrap();
|
||||
stream.record = record;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ pub fn run(args: Args) -> Result<i32, Error> {
|
||||
permissions,
|
||||
)?;
|
||||
let mut encoded = [0u8; 64];
|
||||
base64::encode_config_slice(&sid, base64::STANDARD_NO_PAD, &mut encoded);
|
||||
base64::encode_config_slice(sid, base64::STANDARD_NO_PAD, &mut encoded);
|
||||
let encoded = std::str::from_utf8(&encoded[..]).expect("base64 is valid UTF-8");
|
||||
|
||||
if let Some(ref p) = args.curl_cookie_jar {
|
||||
|
||||
@@ -221,7 +221,7 @@ fn make_listener(addr: &config::AddressConfig) -> Result<Listener, Error> {
|
||||
|
||||
// Go through std::net::TcpListener to avoid needing async. That's there for DNS resolution,
|
||||
// but it's unnecessary when starting from a SocketAddr.
|
||||
let listener = std::net::TcpListener::bind(&sa)
|
||||
let listener = std::net::TcpListener::bind(sa)
|
||||
.with_context(|_| format!("unable to bind TCP socket {}", &sa))?;
|
||||
listener.set_nonblocking(true)?;
|
||||
Ok(Listener::Tcp(tokio::net::TcpListener::from_std(listener)?))
|
||||
@@ -375,7 +375,7 @@ async fn inner(
|
||||
.map(db::Permissions::from),
|
||||
trust_forward_hdrs: b.trust_forward_headers,
|
||||
time_zone_name: time_zone_name.clone(),
|
||||
privileged_unix_uid: b.own_uid_is_privileged.then(|| own_euid),
|
||||
privileged_unix_uid: b.own_uid_is_privileged.then_some(own_euid),
|
||||
})?);
|
||||
let make_svc = make_service_fn(move |conn: &crate::web::accept::Conn| {
|
||||
let conn_data = *conn.data();
|
||||
|
||||
Reference in New Issue
Block a user