mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-01-28 15:06:01 -05:00
fix "cargo test" errors and warnings in a9f6479
This commit is contained in:
parent
a9f64798d6
commit
866a8cc4fc
@ -125,8 +125,8 @@ fn press_test(siv: &mut Cursive, t: db::StreamType) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if !c.username.is_empty() {
|
if !c.username.is_empty() {
|
||||||
url.set_username(&c.username);
|
let _ = url.set_username(&c.username);
|
||||||
url.set_password(Some(&c.password));
|
let _ = url.set_password(Some(&c.password));
|
||||||
}
|
}
|
||||||
siv.add_layer(views::Dialog::text(format!("Testing {} stream at {}. This may take a while \
|
siv.add_layer(views::Dialog::text(format!("Testing {} stream at {}. This may take a while \
|
||||||
on timeout or if you have a long key frame interval",
|
on timeout or if you have a long key frame interval",
|
||||||
|
@ -73,10 +73,10 @@ impl<'a, C, S> Streamer<'a, C, S> where C: 'a + Clocks + Clone, S: 'a + stream::
|
|||||||
let mut url = Url::parse(&s.rtsp_url)?;
|
let mut url = Url::parse(&s.rtsp_url)?;
|
||||||
let mut redacted_url = url.clone();
|
let mut redacted_url = url.clone();
|
||||||
if !c.username.is_empty() {
|
if !c.username.is_empty() {
|
||||||
url.set_username(&c.username);
|
url.set_username(&c.username).map_err(|_| format_err!("can't set username"))?;
|
||||||
redacted_url.set_username(&c.username);
|
redacted_url.set_username(&c.username).unwrap();
|
||||||
url.set_password(Some(&c.password));
|
url.set_password(Some(&c.password)).unwrap();
|
||||||
redacted_url.set_password(Some("redacted"));
|
redacted_url.set_password(Some("redacted")).unwrap();
|
||||||
}
|
}
|
||||||
Ok(Streamer {
|
Ok(Streamer {
|
||||||
shutdown: env.shutdown.clone(),
|
shutdown: env.shutdown.clone(),
|
||||||
@ -357,7 +357,7 @@ mod tests {
|
|||||||
let s = l.streams_by_id().get(&testutil::TEST_STREAM_ID).unwrap();
|
let s = l.streams_by_id().get(&testutil::TEST_STREAM_ID).unwrap();
|
||||||
let dir = db.dirs_by_stream_id.get(&testutil::TEST_STREAM_ID).unwrap().clone();
|
let dir = db.dirs_by_stream_id.get(&testutil::TEST_STREAM_ID).unwrap().clone();
|
||||||
stream = super::Streamer::new(&env, dir, db.syncer_channel.clone(),
|
stream = super::Streamer::new(&env, dir, db.syncer_channel.clone(),
|
||||||
testutil::TEST_STREAM_ID, camera, s, 0, 3);
|
testutil::TEST_STREAM_ID, camera, s, 0, 3).unwrap();
|
||||||
}
|
}
|
||||||
stream.run();
|
stream.run();
|
||||||
assert!(opener.streams.lock().is_empty());
|
assert!(opener.streams.lock().is_empty());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user