Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Commit

Permalink
fixed clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
khodzha committed Dec 10, 2020
1 parent 7ef6fb3 commit 62437ee
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 20 deletions.
21 changes: 9 additions & 12 deletions src/app/endpoint/rtc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,15 @@ impl RequestHandler for CreateHandler {
let conn = context.get_conn()?;

conn.transaction::<_, diesel::result::Error, _>(|| {
match room.time() {
(start, Bound::Unbounded) => {
let new_time = (
*start,
Bound::Excluded(Utc::now() + Duration::hours(MAX_WEBINAR_DURATION)),
);

db::room::UpdateQuery::new(room.id())
.time(Some(new_time))
.execute(&conn)?;
}
_ => {}
if let (start, Bound::Unbounded) = room.time() {
let new_time = (
*start,
Bound::Excluded(Utc::now() + Duration::hours(MAX_WEBINAR_DURATION)),
);

db::room::UpdateQuery::new(room.id())
.time(Some(new_time))
.execute(&conn)?;
}
let rtc = db::rtc::InsertQuery::new(room.id()).execute(&conn)?;
Ok(rtc)
Expand Down
5 changes: 1 addition & 4 deletions src/app/endpoint/rtc_signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,7 @@ fn is_sdp_recvonly(jsep: &JsonValue) -> anyhow::Result<bool> {
let sendonly = item.get_attribute(SdpAttributeType::Sendonly).is_some();
let sendrecv = item.get_attribute(SdpAttributeType::Sendrecv).is_some();

match (recvonly, sendonly, sendrecv) {
(true, false, false) => true,
_ => false,
}
matches!((recvonly, sendonly, sendrecv), (true, false, false))
}))
}

Expand Down
8 changes: 4 additions & 4 deletions src/backend/janus/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,13 @@ async fn handle_response_impl<C: Context>(
};

// Ensure that all rtcs have a recording.
let rtc_ids_with_recs = recs
let mut rtc_ids_with_recs = recs
.iter()
.map(|rec| rec.rtc_id())
.collect::<Vec<Uuid>>();
.map(|rec| rec.rtc_id());

for rtc in rtcs {
if !rtc_ids_with_recs.contains(&rtc.id()) {
let id = rtc.id();
if !rtc_ids_with_recs.any(|v| v == id) {
let mut logger = context.logger().new(o!(
"room_id" => room.id().to_string(),
"rtc_id" => rtc.id().to_string(),
Expand Down

0 comments on commit 62437ee

Please sign in to comment.