cargo fmt

...necessary to pass CI since changes to stable Rust's formatting.
This commit is contained in:
Scott Lamb 2023-09-30 16:15:02 -07:00
parent e103a709a0
commit b4eb573ca2
4 changed files with 21 additions and 6 deletions

View File

@ -2274,8 +2274,7 @@ pub(crate) fn check_schema_version(conn: &rusqlite::Connection) -> Result<(), Er
let Some(ver) = get_schema_version(conn)? else { let Some(ver) = get_schema_version(conn)? else {
bail!( bail!(
FailedPrecondition, FailedPrecondition,
msg( msg("no such table: version.\n\n\
"no such table: version.\n\n\
If you have created an empty database by hand, delete it and use `nvr init` \ If you have created an empty database by hand, delete it and use `nvr init` \
instead, as noted in the installation instructions: \ instead, as noted in the installation instructions: \
<https://github.com/scottlamb/moonfire-nvr/blob/master/guide/install.md>\n\n\ <https://github.com/scottlamb/moonfire-nvr/blob/master/guide/install.md>\n\n\

View File

@ -759,7 +759,10 @@ impl State {
if let Entry::Occupied(ref e) = e { if let Entry::Occupied(ref e) = e {
let (prev_time, prev_state) = *e.get(); let (prev_time, prev_state) = *e.get();
let Some(s) = signals_by_id.get_mut(&signal) else { 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); s.days.adjust(prev_time..time_90k, 0, prev_state);
} }

View File

@ -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 { let Some(sample_file_path) = sample_file_path.to_str() else {
bail!( bail!(
InvalidArgument, 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( tx.execute(

View File

@ -84,8 +84,18 @@ pub fn parse_extra_data(extradata: &[u8]) -> Result<VideoSampleEntryToInsert, Er
msg("SPS has invalid pixel dimensions: {:?}", e) 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 { let (Ok(width), Ok(height)) = (
bail!(InvalidArgument, msg("bad dimensions {}x{}", pixel_dimensions.0, pixel_dimensions.1)); 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); let mut sample_entry = Vec::with_capacity(256);