diff --git a/audio/claxon/src/claxondec/imp.rs b/audio/claxon/src/claxondec/imp.rs index 58f422d9..001559e3 100644 --- a/audio/claxon/src/claxondec/imp.rs +++ b/audio/claxon/src/claxondec/imp.rs @@ -209,12 +209,12 @@ impl ClaxonDec { indata: &[u8], ) -> Result { let streaminfo = claxon_streaminfo(indata).map_err(|e| { - gst::element_imp_error!(self, gst::StreamError::Decode, [e]); + gst::element_imp_error!(self, gst::StreamError::Decode, ["{e}"]); gst::FlowError::Error })?; let audio_info = gstaudioinfo(&streaminfo).map_err(|e| { - gst::element_imp_error!(self, gst::StreamError::Decode, [&e]); + gst::element_imp_error!(self, gst::StreamError::Decode, ["{e}"]); gst::FlowError::Error })?; diff --git a/audio/csound/src/filter/imp.rs b/audio/csound/src/filter/imp.rs index ea0fa465..6b7a181d 100644 --- a/audio/csound/src/filter/imp.rs +++ b/audio/csound/src/filter/imp.rs @@ -144,11 +144,11 @@ impl CsoundFilter { if let Some(ref location) = settings.location { csound .compile_csd(location) - .map_err(|e| error_msg!(gst::LibraryError::Failed, [e]))?; + .map_err(|e| error_msg!(gst::LibraryError::Failed, ["{e}"]))?; } else if let Some(ref text) = settings.csd_text { csound .compile_csd_text(text) - .map_err(|e| error_msg!(gst::LibraryError::Failed, [e]))?; + .map_err(|e| error_msg!(gst::LibraryError::Failed, ["{e}"]))?; } else { return Err(error_msg!( gst::LibraryError::Failed, @@ -470,7 +470,7 @@ impl BaseTransformImpl for CsoundFilter { csound.set_score_offset_seconds(settings.offset); if let Err(e) = csound.start() { - return Err(error_msg!(gst::LibraryError::Failed, [e])); + return Err(error_msg!(gst::LibraryError::Failed, ["{e}"])); } Ok(()) diff --git a/audio/spotify/src/spotifyaudiosrc/imp.rs b/audio/spotify/src/spotifyaudiosrc/imp.rs index 05f34243..99931387 100644 --- a/audio/spotify/src/spotifyaudiosrc/imp.rs +++ b/audio/spotify/src/spotifyaudiosrc/imp.rs @@ -324,9 +324,8 @@ impl PushSrcImpl for SpotifyAudioSrc { return Err(gst::FlowError::Flushing); } Ok(Err(err)) => { - let details = format!("{err:?}"); - gst::error!(CAT, imp: self, "failed to start: {}", details); - gst::element_imp_error!(self, gst::ResourceError::Settings, [&details]); + gst::error!(CAT, imp: self, "failed to start: {err:?}"); + gst::element_imp_error!(self, gst::ResourceError::Settings, ["{err:?}"]); return Err(gst::FlowError::Error); } Ok(Ok(_)) => {} diff --git a/generic/sodium/src/decrypter/imp.rs b/generic/sodium/src/decrypter/imp.rs index f01ee29b..6486f6d0 100644 --- a/generic/sodium/src/decrypter/imp.rs +++ b/generic/sodium/src/decrypter/imp.rs @@ -61,11 +61,10 @@ impl State { .ok_or_else(|| { gst::error_msg!( gst::ResourceError::NotFound, - [format!( + [ "Failed to set Sender's Key from property: {:?}", props.sender_key - ) - .as_ref()] + ] ) })?; @@ -76,11 +75,10 @@ impl State { .ok_or_else(|| { gst::error_msg!( gst::ResourceError::NotFound, - [format!( + [ "Failed to set Receiver's Key from property: {:?}", props.receiver_key - ) - .as_ref()] + ] ) })?; diff --git a/generic/sodium/src/encrypter/imp.rs b/generic/sodium/src/encrypter/imp.rs index ac1ea101..f5f72db8 100644 --- a/generic/sodium/src/encrypter/imp.rs +++ b/generic/sodium/src/encrypter/imp.rs @@ -76,11 +76,10 @@ impl State { .ok_or_else(|| { gst::error_msg!( gst::ResourceError::NotFound, - [format!( + [ "Failed to set Sender's Key from property: {:?}", props.sender_key - ) - .as_ref()] + ] ) })?; @@ -91,11 +90,10 @@ impl State { .ok_or_else(|| { gst::error_msg!( gst::ResourceError::NotFound, - [format!( + [ "Failed to set Receiver's Key from property: {:?}", props.receiver_key - ) - .as_ref()] + ] ) })?; diff --git a/net/webrtchttp/src/whepsrc/imp.rs b/net/webrtchttp/src/whepsrc/imp.rs index 2ee1ac93..e0752ac8 100644 --- a/net/webrtchttp/src/whepsrc/imp.rs +++ b/net/webrtchttp/src/whepsrc/imp.rs @@ -403,8 +403,8 @@ impl BinImpl for WhepSrc { impl WhepSrc { fn raise_error(&self, resource_error: gst::ResourceError, msg: String) { - gst::error_msg!(resource_error, [msg.as_str()]); - gst::element_imp_error!(self, resource_error, [msg.as_str()]); + gst::error_msg!(resource_error, ["{msg}"]); + gst::element_imp_error!(self, resource_error, ["{msg}"]); } fn handle_future_error(&self, err: WaitError) { diff --git a/net/webrtchttp/src/whipsink/imp.rs b/net/webrtchttp/src/whipsink/imp.rs index 4f30afa6..c1ac7c28 100644 --- a/net/webrtchttp/src/whipsink/imp.rs +++ b/net/webrtchttp/src/whipsink/imp.rs @@ -499,8 +499,8 @@ impl ObjectSubclass for WhipSink { impl WhipSink { fn raise_error(&self, resource_error: gst::ResourceError, msg: String) { - gst::error_msg!(resource_error, [msg.as_str()]); - gst::element_imp_error!(self, resource_error, [msg.as_str()]); + gst::error_msg!(resource_error, ["{msg}"]); + gst::element_imp_error!(self, resource_error, ["{msg}"]); } fn handle_future_error(&self, err: WaitError) { diff --git a/utils/uriplaylistbin/src/uriplaylistbin/imp.rs b/utils/uriplaylistbin/src/uriplaylistbin/imp.rs index 3b6ae3ec..620d5cb4 100644 --- a/utils/uriplaylistbin/src/uriplaylistbin/imp.rs +++ b/utils/uriplaylistbin/src/uriplaylistbin/imp.rs @@ -1623,14 +1623,13 @@ impl UriPlaylistBin { blocked.set_streaming(state.streams_topology.n_streams()); } } - let error_msg = error.to_string(); - gst::error!(CAT, imp: self, "{}", error_msg); + gst::error!(CAT, imp: self, "{error}"); match error { PlaylistError::PluginMissing { .. } => { - gst::element_imp_error!(self, gst::CoreError::MissingPlugin, [&error_msg]); + gst::element_imp_error!(self, gst::CoreError::MissingPlugin, ["{error}"]); } - PlaylistError::ItemFailed { item, .. } => { + PlaylistError::ItemFailed { ref item, .. } => { // remove failing uridecodebin let uridecodebin = item.uridecodebin(); uridecodebin.call_async(move |uridecodebin| { @@ -1644,7 +1643,7 @@ impl UriPlaylistBin { gst::element_imp_error!( self, gst::LibraryError::Failed, - [&error_msg], + ["{error}"], details: details.build() ); } diff --git a/video/closedcaption/src/ccdetect/imp.rs b/video/closedcaption/src/ccdetect/imp.rs index 1208a08c..39ea519f 100644 --- a/video/closedcaption/src/ccdetect/imp.rs +++ b/video/closedcaption/src/ccdetect/imp.rs @@ -363,8 +363,8 @@ impl BaseTransformImpl for CCDetect { let cc_packet = match self.detect(format, map.as_slice()) { Ok(v) => v, Err(e) => { - gst::warning!(CAT, imp: self, "{}", &e.to_string()); - gst::element_imp_warning!(self, gst::StreamError::Decode, [&e.to_string()]); + gst::warning!(CAT, imp: self, "{e}"); + gst::element_imp_warning!(self, gst::StreamError::Decode, ["{e}"]); CCPacketContents { cc608: false, cc708: false, diff --git a/video/closedcaption/src/cea608overlay/imp.rs b/video/closedcaption/src/cea608overlay/imp.rs index b6a78f7f..ce7988d3 100644 --- a/video/closedcaption/src/cea608overlay/imp.rs +++ b/video/closedcaption/src/cea608overlay/imp.rs @@ -419,8 +419,8 @@ impl Cea608Overlay { self.decode_cc_data(pad, &mut state, data, pts); } Err(e) => { - gst::warning!(CAT, "{}", &e.to_string()); - gst::element_imp_warning!(self, gst::StreamError::Decode, [&e.to_string()]); + gst::warning!(CAT, "{e}"); + gst::element_imp_warning!(self, gst::StreamError::Decode, ["{e}"]); } } } else if meta.caption_type() == gst_video::VideoCaptionType::Cea708Raw { diff --git a/video/gif/src/gifenc/imp.rs b/video/gif/src/gifenc/imp.rs index 67a19474..c813a809 100644 --- a/video/gif/src/gifenc/imp.rs +++ b/video/gif/src/gifenc/imp.rs @@ -380,7 +380,7 @@ impl VideoEncoderImpl for GifEnc { // encode new frame let context = state.context.as_mut().unwrap(); if let Err(e) = context.write_frame(&gif_frame) { - gst::element_imp_error!(self, gst::CoreError::Failed, [&e.to_string()]); + gst::element_imp_error!(self, gst::CoreError::Failed, ["{e}"]); return Err(gst::FlowError::Error); } } diff --git a/video/png/src/pngenc/imp.rs b/video/png/src/pngenc/imp.rs index fc022515..5adacbde 100644 --- a/video/png/src/pngenc/imp.rs +++ b/video/png/src/pngenc/imp.rs @@ -232,8 +232,8 @@ impl VideoEncoderImpl for PngEncoder { encoder.set_filter(png::FilterType::from(settings.filter)); let mut writer = encoder.write_header().map_err(|e| { - gst::error!(CAT, imp: self, "Failed to create encoder: {}", e); - gst::element_imp_error!(self, gst::CoreError::Failed, [&e.to_string()]); + gst::error!(CAT, imp: self, "Failed to create encoder: {e}"); + gst::element_imp_error!(self, gst::CoreError::Failed, ["{e}"]); gst::FlowError::Error })?; @@ -241,15 +241,15 @@ impl VideoEncoderImpl for PngEncoder { let input_buffer = frame.input_buffer().expect("frame without input buffer"); let input_map = input_buffer.map_readable().unwrap(); writer.write_image_data(&input_map).map_err(|e| { - gst::error!(CAT, imp: self, "Failed to write image data: {}", e); - gst::element_imp_error!(self, gst::CoreError::Failed, [&e.to_string()]); + gst::error!(CAT, imp: self, "Failed to write image data: {e}"); + gst::element_imp_error!(self, gst::CoreError::Failed, ["{e}"]); gst::FlowError::Error })?; } writer.finish().map_err(|e| { - gst::error!(CAT, imp: self, "Failed to finish encoder: {}", e); - gst::element_imp_error!(self, gst::CoreError::Failed, [&e.to_string()]); + gst::error!(CAT, imp: self, "Failed to finish encoder: {e}"); + gst::element_imp_error!(self, gst::CoreError::Failed, ["{e}"]); gst::FlowError::Error })?;