mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-23 12:01: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),
|
||||
}
|
||||
|
||||
impl Into<gst::FlowReturn> for FlowError {
|
||||
fn into(self) -> gst::FlowReturn {
|
||||
(&self).into()
|
||||
impl From<FlowError> for gst::FlowReturn {
|
||||
fn from(err: FlowError) -> Self {
|
||||
gst::FlowReturn::from(&err)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Into<gst::FlowReturn> for &'a FlowError {
|
||||
fn into(self) -> gst::FlowReturn {
|
||||
match *self {
|
||||
impl<'a> From<&'a FlowError> for gst::FlowReturn {
|
||||
fn from(err: &FlowError) -> gst::FlowReturn {
|
||||
match *err {
|
||||
FlowError::Flushing => gst::FlowReturn::Flushing,
|
||||
FlowError::Eos => gst::FlowReturn::Eos,
|
||||
FlowError::NotNegotiated(..) => gst::FlowReturn::NotNegotiated,
|
||||
|
|
Loading…
Reference in a new issue