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 {
104104 SerialEventsWrapper {
105105 buffer_ready_event_fd : None ,
106106 } ,
107- SerialOut :: Sink ( std :: io :: sink ( ) ) ,
107+ SerialOut :: Sink ,
108108 ) ,
109109 input : None ,
110110 } ) ) ;
@@ -114,7 +114,7 @@ impl PortIODeviceManager {
114114 SerialEventsWrapper {
115115 buffer_ready_event_fd : None ,
116116 } ,
117- SerialOut :: Sink ( std :: io :: sink ( ) ) ,
117+ SerialOut :: Sink ,
118118 ) ,
119119 input : None ,
120120 } ) ) ;
@@ -249,7 +249,7 @@ mod tests {
249249 SerialEventsWrapper {
250250 buffer_ready_event_fd : None ,
251251 } ,
252- SerialOut :: Sink ( std :: io :: sink ( ) ) ,
252+ SerialOut :: Sink ,
253253 ) ,
254254 input : None ,
255255 } ) ) ,
Original file line number Diff line number Diff line change @@ -555,7 +555,7 @@ pub(crate) mod tests {
555555 #[ cfg( target_arch = "x86_64" ) ]
556556 let legacy_devices = PortIODeviceManager :: new (
557557 Arc :: new ( Mutex :: new (
558- SerialDevice :: new ( None , SerialOut :: Sink ( std :: io :: sink ( ) ) ) . unwrap ( ) ,
558+ SerialDevice :: new ( None , SerialOut :: Sink ) . unwrap ( ) ,
559559 ) ) ,
560560 Arc :: new ( Mutex :: new (
561561 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 {
127127
128128#[ derive( Debug ) ]
129129pub enum SerialOut {
130- Sink ( std :: io :: Sink ) ,
130+ Sink ,
131131 Stdout ( std:: io:: Stdout ) ,
132132}
133133impl std:: io:: Write for SerialOut {
134134 fn write ( & mut self , buf : & [ u8 ] ) -> std:: io:: Result < usize > {
135135 match self {
136- Self :: Sink ( sink ) => sink . write ( buf) ,
136+ Self :: Sink => Ok ( buf. len ( ) ) ,
137137 Self :: Stdout ( stdout) => stdout. write ( buf) ,
138138 }
139139 }
140140 fn flush ( & mut self ) -> std:: io:: Result < ( ) > {
141141 match self {
142- Self :: Sink ( sink ) => sink . flush ( ) ,
142+ Self :: Sink => Ok ( ( ) ) ,
143143 Self :: Stdout ( stdout) => stdout. flush ( ) ,
144144 }
145145 }
@@ -407,7 +407,7 @@ mod tests {
407407 SerialEventsWrapper {
408408 buffer_ready_event_fd : None ,
409409 } ,
410- SerialOut :: Sink ( std :: io :: sink ( ) ) ,
410+ SerialOut :: Sink ,
411411 ) ,
412412 input : None :: < std:: io:: Stdin > ,
413413 } ;
You can’t perform that action at this time.
0 commit comments