@@ -71,42 +71,42 @@ pub fn free_host<T>(ptr: *mut T) {
71
71
}
72
72
73
73
impl From < i32 > for AfError {
74
- fn from ( t : i32 ) -> AfError {
74
+ fn from ( t : i32 ) -> Self {
75
75
assert ! ( AfError :: SUCCESS as i32 <= t && t <= AfError :: ERR_UNKNOWN as i32 ) ;
76
76
unsafe { mem:: transmute ( t) }
77
77
}
78
78
}
79
79
80
80
impl From < u32 > for DType {
81
- fn from ( t : u32 ) -> DType {
81
+ fn from ( t : u32 ) -> Self {
82
82
assert ! ( DType :: F32 as u32 <= t && t <= DType :: U64 as u32 ) ;
83
83
unsafe { mem:: transmute ( t) }
84
84
}
85
85
}
86
86
87
87
impl From < u32 > for InterpType {
88
- fn from ( t : u32 ) -> InterpType {
88
+ fn from ( t : u32 ) -> Self {
89
89
assert ! ( InterpType :: NEAREST as u32 <= t && t <= InterpType :: BICUBIC_SPLINE as u32 ) ;
90
90
unsafe { mem:: transmute ( t) }
91
91
}
92
92
}
93
93
94
94
impl From < u32 > for ConvMode {
95
- fn from ( t : u32 ) -> ConvMode {
95
+ fn from ( t : u32 ) -> Self {
96
96
assert ! ( ConvMode :: DEFAULT as u32 <= t && t <= ConvMode :: EXPAND as u32 ) ;
97
97
unsafe { mem:: transmute ( t) }
98
98
}
99
99
}
100
100
101
101
impl From < u32 > for ConvDomain {
102
- fn from ( t : u32 ) -> ConvDomain {
102
+ fn from ( t : u32 ) -> Self {
103
103
assert ! ( ConvDomain :: AUTO as u32 <= t && t <= ConvDomain :: FREQUENCY as u32 ) ;
104
104
unsafe { mem:: transmute ( t) }
105
105
}
106
106
}
107
107
108
108
impl From < u32 > for MatchType {
109
- fn from ( t : u32 ) -> MatchType {
109
+ fn from ( t : u32 ) -> Self {
110
110
assert ! ( MatchType :: SAD as u32 <= t && t <= MatchType :: SHD as u32 ) ;
111
111
unsafe { mem:: transmute ( t) }
112
112
}
@@ -129,7 +129,7 @@ pub fn to_u32(t: MatProp) -> u32 {
129
129
}
130
130
131
131
impl From < u32 > for ColorMap {
132
- fn from ( t : u32 ) -> ColorMap {
132
+ fn from ( t : u32 ) -> Self {
133
133
assert ! ( ColorMap :: DEFAULT as u32 <= t && t <= ColorMap :: BLUE as u32 ) ;
134
134
unsafe { mem:: transmute ( t) }
135
135
}
0 commit comments