@@ -34,8 +34,8 @@ impl<'pipe, 'interrupt, const N: usize> Dispatch<'pipe, 'interrupt, N> {
3434
3535 fn find_app < ' a , ' b > (
3636 command : Command ,
37- apps : & ' a mut [ & ' b mut dyn App < ' interrupt , N > ] ,
38- ) -> Option < & ' a mut & ' b mut dyn App < ' interrupt , N > > {
37+ apps : & ' a mut [ & ' b mut dyn App < ' interrupt > ] ,
38+ ) -> Option < & ' a mut & ' b mut dyn App < ' interrupt > > {
3939 apps. iter_mut ( )
4040 . find ( |app| app. commands ( ) . contains ( & command) )
4141 }
@@ -75,7 +75,7 @@ impl<'pipe, 'interrupt, const N: usize> Dispatch<'pipe, 'interrupt, N> {
7575 }
7676
7777 #[ inline( never) ]
78- fn call_app ( & mut self , app : & mut dyn App < ' interrupt , N > , command : Command , request : & Bytes < N > ) {
78+ fn call_app ( & mut self , app : & mut dyn App < ' interrupt > , command : Command , request : & [ u8 ] ) {
7979 let response_buffer = self
8080 . responder
8181 . response_mut ( )
@@ -106,18 +106,17 @@ impl<'pipe, 'interrupt, const N: usize> Dispatch<'pipe, 'interrupt, N> {
106106 }
107107
108108 #[ inline( never) ]
109- pub fn poll ( & mut self , apps : & mut [ & mut dyn App < ' interrupt , N > ] ) -> bool {
109+ pub fn poll ( & mut self , apps : & mut [ & mut dyn App < ' interrupt > ] ) -> bool {
110110 // We could call take_request directly, but for some reason this doubles stack usage.
111- let mut message_buffer = Bytes :: new ( ) ;
111+ let mut buffer = Bytes :: < N > :: new ( ) ;
112112 if let Ok ( ( command, message) ) = self . responder . request ( ) {
113113 // info_now!("cmd: {}", u8::from(command));
114114 // info_now!("cmd: {:?}", command);
115115
116- message_buffer. extend_from_slice ( message) . unwrap ( ) ;
117-
116+ buffer. extend_from_slice ( message) . unwrap ( ) ;
118117 if let Some ( app) = Self :: find_app ( * command, apps) {
119118 // match app.call(command, self.responder.response_mut().unwrap()) {
120- self . call_app ( * app, * command, & message_buffer ) ;
119+ self . call_app ( * app, * command, & buffer ) ;
121120 } else {
122121 self . reply_with_error ( Error :: InvalidCommand ) ;
123122 }
0 commit comments