mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-27 05:51:01 +00:00
Implement From instead of Into for FlowError -> FlowReturn
It is recommended to implement From as that is more flexible and includes an implicit Into instance.
This commit is contained in:
parent
c5c3726668
commit
20910b2415
1 changed files with 6 additions and 6 deletions
|
@ -50,15 +50,15 @@ pub enum FlowError {
|
||||||
Error(gst::ErrorMessage),
|
Error(gst::ErrorMessage),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<gst::FlowReturn> for FlowError {
|
impl From<FlowError> for gst::FlowReturn {
|
||||||
fn into(self) -> gst::FlowReturn {
|
fn from(err: FlowError) -> Self {
|
||||||
(&self).into()
|
gst::FlowReturn::from(&err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Into<gst::FlowReturn> for &'a FlowError {
|
impl<'a> From<&'a FlowError> for gst::FlowReturn {
|
||||||
fn into(self) -> gst::FlowReturn {
|
fn from(err: &FlowError) -> gst::FlowReturn {
|
||||||
match *self {
|
match *err {
|
||||||
FlowError::Flushing => gst::FlowReturn::Flushing,
|
FlowError::Flushing => gst::FlowReturn::Flushing,
|
||||||
FlowError::Eos => gst::FlowReturn::Eos,
|
FlowError::Eos => gst::FlowReturn::Eos,
|
||||||
FlowError::NotNegotiated(..) => gst::FlowReturn::NotNegotiated,
|
FlowError::NotNegotiated(..) => gst::FlowReturn::NotNegotiated,
|
||||||
|
|
Loading…
Reference in a new issue