@@ -155,46 +155,8 @@ impl<'de> Decode<'de> for ChannelsPdu {
155
155
/// [2.2.2.1.3]: https://learn.microsoft.com/pt-br/openspecs/windows_protocols/ms-rdprfx/4060f07e-9d73-454d-841e-131a93aca675
156
156
#[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
157
157
pub struct RfxChannel {
158
- pub width : RfxChannelWidth ,
159
- pub height : RfxChannelHeight ,
160
- }
161
-
162
- /// A 16-bit, signed integer within the range of 1 to 4096
163
- #[ derive( Debug , Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
164
- #[ repr( transparent) ]
165
- pub struct RfxChannelWidth ( i16 ) ;
166
-
167
- impl RfxChannelWidth {
168
- pub fn new ( value : i16 ) -> Self {
169
- Self ( value)
170
- }
171
-
172
- pub fn as_u16 ( self ) -> u16 {
173
- u16:: try_from ( self . 0 ) . expect ( "integer within the range of 1 to 4096" )
174
- }
175
-
176
- pub fn get ( self ) -> i16 {
177
- self . 0
178
- }
179
- }
180
-
181
- /// A 16-bit, signed integer within the range of 1 to 2048
182
- #[ derive( Debug , Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
183
- #[ repr( transparent) ]
184
- pub struct RfxChannelHeight ( i16 ) ;
185
-
186
- impl RfxChannelHeight {
187
- pub fn new ( value : i16 ) -> Self {
188
- Self ( value)
189
- }
190
-
191
- pub fn as_u16 ( self ) -> u16 {
192
- u16:: try_from ( self . 0 ) . expect ( "integer within the range of 1 to 2048" )
193
- }
194
-
195
- pub fn get ( self ) -> i16 {
196
- self . 0
197
- }
158
+ pub width : i16 ,
159
+ pub height : i16 ,
198
160
}
199
161
200
162
impl RfxChannel {
@@ -208,8 +170,8 @@ impl Encode for RfxChannel {
208
170
ensure_fixed_part_size ! ( in: dst) ;
209
171
210
172
dst. write_u8 ( CHANNEL_ID ) ;
211
- dst. write_i16 ( self . width . get ( ) ) ;
212
- dst. write_i16 ( self . height . get ( ) ) ;
173
+ dst. write_i16 ( self . width ) ;
174
+ dst. write_i16 ( self . height ) ;
213
175
214
176
Ok ( ( ) )
215
177
}
@@ -232,8 +194,8 @@ impl<'de> Decode<'de> for RfxChannel {
232
194
return Err ( invalid_field_err ! ( "channelId" , "Invalid channel ID" ) ) ;
233
195
}
234
196
235
- let width = RfxChannelWidth :: new ( src. read_i16 ( ) ) ;
236
- let height = RfxChannelHeight :: new ( src. read_i16 ( ) ) ;
197
+ let width = src. read_i16 ( ) ;
198
+ let height = src. read_i16 ( ) ;
237
199
238
200
Ok ( Self { width, height } )
239
201
}
0 commit comments