mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-27 20:58:56 -05:00
update dependencies
* The mylog update fixes a couple bad bugs. * Otherwise, just keep up with the Rust ecosystem.
This commit is contained in:
@@ -54,7 +54,7 @@ Options:
|
||||
[default: /var/lib/moonfire-nvr/sample]
|
||||
"#;
|
||||
|
||||
#[derive(Debug, RustcDecodable)]
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct Args {
|
||||
flag_db_dir: String,
|
||||
flag_sample_file_dir: String,
|
||||
|
||||
@@ -211,9 +211,8 @@ fn edit_camera_dialog(db: &Arc<db::Database>, dir: &Arc<dir::SampleFileDir>, siv
|
||||
let dialog = if let Some(id) = *item {
|
||||
let l = db.lock();
|
||||
let camera = l.cameras_by_id().get(&id).expect("missing camera");
|
||||
dialog.find_id::<views::TextView>("uuid")
|
||||
.expect("missing TextView")
|
||||
.set_content(camera.uuid.to_string());
|
||||
dialog.find_id("uuid", |v: &mut views::TextView| v.set_content(camera.uuid.to_string()))
|
||||
.expect("missing TextView");
|
||||
let bytes = camera.sample_file_bytes;
|
||||
let name = camera.short_name.clone();
|
||||
for &(view_id, content) in &[("short_name", &camera.short_name),
|
||||
@@ -222,13 +221,12 @@ fn edit_camera_dialog(db: &Arc<db::Database>, dir: &Arc<dir::SampleFileDir>, siv
|
||||
("password", &camera.password),
|
||||
("main_rtsp_path", &camera.main_rtsp_path),
|
||||
("sub_rtsp_path", &camera.sub_rtsp_path)] {
|
||||
dialog.find_id::<views::EditView>(view_id)
|
||||
.expect("missing EditView")
|
||||
.set_content(content.to_string());
|
||||
dialog.find_id(view_id, |v: &mut views::EditView| v.set_content(content.to_string()))
|
||||
.expect("missing EditView");
|
||||
}
|
||||
dialog.find_id::<views::TextArea>("description")
|
||||
.expect("missing TextArea")
|
||||
.set_content(camera.description.to_string());
|
||||
dialog.find_id("description",
|
||||
|v: &mut views::TextArea| v.set_content(camera.description.to_string()))
|
||||
.expect("missing TextArea");
|
||||
dialog.title("Edit camera")
|
||||
.button("Edit", {
|
||||
let db = db.clone();
|
||||
|
||||
@@ -120,7 +120,7 @@ fn decode_size(encoded: &str) -> Result<i64, ()> {
|
||||
Ok(decoded)
|
||||
}
|
||||
|
||||
#[derive(Debug, RustcDecodable)]
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct Args {
|
||||
flag_db_dir: String,
|
||||
flag_sample_file_dir: String,
|
||||
|
||||
@@ -229,7 +229,7 @@ pub fn add_dialog(db: &Arc<db::Database>, dir: &Arc<dir::SampleFileDir>, siv: &m
|
||||
move |siv, _| press_change(&model, siv)
|
||||
})
|
||||
.fixed_width(25))
|
||||
.child(views::TextView::new("").with_id(&format!("{}_ok", id)).fixed_width(1)));
|
||||
.child(views::TextView::new("").with_id(format!("{}_ok", id)).fixed_width(1)));
|
||||
}
|
||||
let over = model.borrow().total_retain > model.borrow().fs_capacity;
|
||||
list.add_child(
|
||||
|
||||
@@ -46,7 +46,7 @@ Options:
|
||||
[default: /var/lib/moonfire-nvr/db]
|
||||
"#;
|
||||
|
||||
#[derive(Debug, RustcDecodable)]
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct Args {
|
||||
flag_db_dir: String,
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ mod run;
|
||||
mod ts;
|
||||
mod upgrade;
|
||||
|
||||
#[derive(Debug, RustcDecodable)]
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub enum Command {
|
||||
Check,
|
||||
Config,
|
||||
@@ -95,8 +95,8 @@ fn open_conn(db_dir: &str, mode: OpenMode) -> Result<(dir::Fd, rusqlite::Connect
|
||||
Ok((dir, conn))
|
||||
}
|
||||
|
||||
fn parse_args<T>(usage: &str) -> Result<T, Error> where T: ::rustc_serialize::Decodable {
|
||||
fn parse_args<'a, T>(usage: &str) -> Result<T, Error> where T: ::serde::Deserialize<'a> {
|
||||
Ok(docopt::Docopt::new(usage)
|
||||
.and_then(|d| d.decode())
|
||||
.and_then(|d| d.deserialize())
|
||||
.unwrap_or_else(|e| e.exit()))
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ Options:
|
||||
--read-only Forces read-only mode / disables recording.
|
||||
"#;
|
||||
|
||||
#[derive(Debug, RustcDecodable)]
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct Args {
|
||||
flag_db_dir: String,
|
||||
flag_sample_file_dir: String,
|
||||
|
||||
@@ -36,7 +36,7 @@ Usage: moonfire-nvr ts <ts>...
|
||||
moonfire-nvr ts --help
|
||||
"#;
|
||||
|
||||
#[derive(Debug, RustcDecodable)]
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct Args {
|
||||
arg_ts: Vec<String>,
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ const UPGRADERS: [fn(&rusqlite::Transaction) -> Result<(), Error>; 1] = [
|
||||
v0_to_v1::run,
|
||||
];
|
||||
|
||||
#[derive(Debug, RustcDecodable)]
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct Args {
|
||||
flag_db_dir: String,
|
||||
flag_sample_file_dir: String,
|
||||
|
||||
Reference in New Issue
Block a user