File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ impl PortIODeviceManager {
104
104
SerialEventsWrapper {
105
105
buffer_ready_event_fd : None ,
106
106
} ,
107
- SerialOut :: Sink ( std :: io :: sink ( ) ) ,
107
+ SerialOut :: Sink ,
108
108
) ,
109
109
input : None ,
110
110
} ) ) ;
@@ -114,7 +114,7 @@ impl PortIODeviceManager {
114
114
SerialEventsWrapper {
115
115
buffer_ready_event_fd : None ,
116
116
} ,
117
- SerialOut :: Sink ( std :: io :: sink ( ) ) ,
117
+ SerialOut :: Sink ,
118
118
) ,
119
119
input : None ,
120
120
} ) ) ;
@@ -249,7 +249,7 @@ mod tests {
249
249
SerialEventsWrapper {
250
250
buffer_ready_event_fd : None ,
251
251
} ,
252
- SerialOut :: Sink ( std :: io :: sink ( ) ) ,
252
+ SerialOut :: Sink ,
253
253
) ,
254
254
input : None ,
255
255
} ) ) ,
Original file line number Diff line number Diff line change @@ -555,7 +555,7 @@ pub(crate) mod tests {
555
555
#[ cfg( target_arch = "x86_64" ) ]
556
556
let legacy_devices = PortIODeviceManager :: new (
557
557
Arc :: new ( Mutex :: new (
558
- SerialDevice :: new ( None , SerialOut :: Sink ( std :: io :: sink ( ) ) ) . unwrap ( ) ,
558
+ SerialDevice :: new ( None , SerialOut :: Sink ) . unwrap ( ) ,
559
559
) ) ,
560
560
Arc :: new ( Mutex :: new (
561
561
I8042Device :: new ( EventFd :: new ( libc:: EFD_NONBLOCK ) . unwrap ( ) ) . unwrap ( ) ,
Original file line number Diff line number Diff line change @@ -127,19 +127,19 @@ impl SerialEvents for SerialEventsWrapper {
127
127
128
128
#[ derive( Debug ) ]
129
129
pub enum SerialOut {
130
- Sink ( std :: io :: Sink ) ,
130
+ Sink ,
131
131
Stdout ( std:: io:: Stdout ) ,
132
132
}
133
133
impl std:: io:: Write for SerialOut {
134
134
fn write ( & mut self , buf : & [ u8 ] ) -> std:: io:: Result < usize > {
135
135
match self {
136
- Self :: Sink ( sink ) => sink . write ( buf) ,
136
+ Self :: Sink => Ok ( buf. len ( ) ) ,
137
137
Self :: Stdout ( stdout) => stdout. write ( buf) ,
138
138
}
139
139
}
140
140
fn flush ( & mut self ) -> std:: io:: Result < ( ) > {
141
141
match self {
142
- Self :: Sink ( sink ) => sink . flush ( ) ,
142
+ Self :: Sink => Ok ( ( ) ) ,
143
143
Self :: Stdout ( stdout) => stdout. flush ( ) ,
144
144
}
145
145
}
@@ -407,7 +407,7 @@ mod tests {
407
407
SerialEventsWrapper {
408
408
buffer_ready_event_fd : None ,
409
409
} ,
410
- SerialOut :: Sink ( std :: io :: sink ( ) ) ,
410
+ SerialOut :: Sink ,
411
411
) ,
412
412
input : None :: < std:: io:: Stdin > ,
413
413
} ;
You can’t perform that action at this time.
0 commit comments