@@ -58,7 +58,7 @@ pub(crate) enum MatrixDriverRequestData {
5858
5959/// A handle to a pending `toWidget` request.
6060pub ( crate ) struct MatrixDriverRequestHandle < ' m , T > {
61- request_meta : Option < & ' m mut MatrixDriverRequestMeta > ,
61+ request_meta : & ' m mut MatrixDriverRequestMeta ,
6262 _phantom : PhantomData < fn ( ) -> T > ,
6363}
6464
6767 T : FromMatrixDriverResponse ,
6868{
6969 pub ( crate ) fn new ( request_meta : & ' m mut MatrixDriverRequestMeta ) -> Self {
70- Self { request_meta : Some ( request_meta ) , _phantom : PhantomData }
70+ Self { request_meta, _phantom : PhantomData }
7171 }
7272
7373 /// Setup a callback function that will be called once the matrix driver has
@@ -78,15 +78,13 @@ where
7878 + Send
7979 + ' static ,
8080 ) {
81- if let Some ( request_meta) = self . request_meta {
82- request_meta. response_fn = Some ( Box :: new ( move |response, machine| {
83- if let Some ( response_data) = response. map ( T :: from_response) . transpose ( ) {
84- response_handler ( response_data, machine)
85- } else {
86- Vec :: new ( )
87- }
88- } ) ) ;
89- }
81+ self . request_meta . response_fn = Some ( Box :: new ( move |response, machine| {
82+ if let Some ( response_data) = response. map ( T :: from_response) . transpose ( ) {
83+ response_handler ( response_data, machine)
84+ } else {
85+ Vec :: new ( )
86+ }
87+ } ) ) ;
9088 }
9189}
9290
0 commit comments