cargo clippy fix
This commit is contained in:
@@ -44,7 +44,7 @@ impl AudioProcesser {
|
||||
pub fn encode(&mut self, frame: AudioFrame) -> Vec<OpusAudioFrame> {
|
||||
let mut samples: Vec<f32> = frame
|
||||
.data
|
||||
.chunks_exact(4)
|
||||
.as_chunks::<4>().0.iter()
|
||||
.map(|b| f32::from_le_bytes([b[0], b[1], b[2], b[3]]))
|
||||
.collect();
|
||||
|
||||
|
||||
@@ -162,16 +162,14 @@ async fn edit_stream_key(
|
||||
}
|
||||
}
|
||||
// Empty values are allowed (they clear the field).
|
||||
if let Some(custom_id) = payload.custom_id.as_deref() {
|
||||
if !custom_id.is_empty() && !valid_charset(custom_id) {
|
||||
if let Some(custom_id) = payload.custom_id.as_deref()
|
||||
&& !custom_id.is_empty() && !valid_charset(custom_id) {
|
||||
return Err(HttpError::BadRequest("invalid custom id".into()));
|
||||
}
|
||||
}
|
||||
if let Some(pwd) = payload.password.as_deref() {
|
||||
if !pwd.is_empty() && !valid_charset(pwd) {
|
||||
if let Some(pwd) = payload.password.as_deref()
|
||||
&& !pwd.is_empty() && !valid_charset(pwd) {
|
||||
return Err(HttpError::BadRequest("invalid password".into()));
|
||||
}
|
||||
}
|
||||
|
||||
let stream_key = stream_key::Entity::find_by_id(payload.id)
|
||||
.one(&state.db)
|
||||
|
||||
Reference in New Issue
Block a user