mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2024-12-25 06:35:56 -05:00
cargo fmt
...necessary to pass CI since changes to stable Rust's formatting.
This commit is contained in:
parent
e103a709a0
commit
b4eb573ca2
@ -2274,8 +2274,7 @@ pub(crate) fn check_schema_version(conn: &rusqlite::Connection) -> Result<(), Er
|
||||
let Some(ver) = get_schema_version(conn)? else {
|
||||
bail!(
|
||||
FailedPrecondition,
|
||||
msg(
|
||||
"no such table: version.\n\n\
|
||||
msg("no such table: version.\n\n\
|
||||
If you have created an empty database by hand, delete it and use `nvr init` \
|
||||
instead, as noted in the installation instructions: \
|
||||
<https://github.com/scottlamb/moonfire-nvr/blob/master/guide/install.md>\n\n\
|
||||
|
@ -759,7 +759,10 @@ impl State {
|
||||
if let Entry::Occupied(ref e) = e {
|
||||
let (prev_time, prev_state) = *e.get();
|
||||
let Some(s) = signals_by_id.get_mut(&signal) else {
|
||||
bail!(DataLoss, msg("time {time_90k} references invalid signal {signal}"));
|
||||
bail!(
|
||||
DataLoss,
|
||||
msg("time {time_90k} references invalid signal {signal}")
|
||||
);
|
||||
};
|
||||
s.days.adjust(prev_time..time_90k, 0, prev_state);
|
||||
}
|
||||
|
@ -107,7 +107,10 @@ pub fn run(args: &super::Args, tx: &rusqlite::Transaction) -> Result<(), Error>
|
||||
let Some(sample_file_path) = sample_file_path.to_str() else {
|
||||
bail!(
|
||||
InvalidArgument,
|
||||
msg("sample file dir {} is not a valid string", sample_file_path.display()),
|
||||
msg(
|
||||
"sample file dir {} is not a valid string",
|
||||
sample_file_path.display()
|
||||
),
|
||||
);
|
||||
};
|
||||
tx.execute(
|
||||
|
@ -84,8 +84,18 @@ pub fn parse_extra_data(extradata: &[u8]) -> Result<VideoSampleEntryToInsert, Er
|
||||
msg("SPS has invalid pixel dimensions: {:?}", e)
|
||||
)
|
||||
})?;
|
||||
let (Ok(width), Ok(height)) = (u16::try_from(pixel_dimensions.0), u16::try_from(pixel_dimensions.1)) else {
|
||||
bail!(InvalidArgument, msg("bad dimensions {}x{}", pixel_dimensions.0, pixel_dimensions.1));
|
||||
let (Ok(width), Ok(height)) = (
|
||||
u16::try_from(pixel_dimensions.0),
|
||||
u16::try_from(pixel_dimensions.1),
|
||||
) else {
|
||||
bail!(
|
||||
InvalidArgument,
|
||||
msg(
|
||||
"bad dimensions {}x{}",
|
||||
pixel_dimensions.0,
|
||||
pixel_dimensions.1
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
let mut sample_entry = Vec::with_capacity(256);
|
||||
|
Loading…
Reference in New Issue
Block a user