@@ -187,13 +187,14 @@ impl AuthorizationGrant {
187187 self . created_at - max_age
188188 }
189189
190- pub fn parse_login_hint ( & self , homeserver : BoxHomeserverConnection ) -> LoginHint {
190+ #[ must_use]
191+ pub fn parse_login_hint ( & self , homeserver : & BoxHomeserverConnection ) -> LoginHint {
191192 let Some ( login_hint) = & self . login_hint else {
192193 return LoginHint :: None ;
193194 } ;
194195
195196 // Return none if the format is incorrect
196- let Some ( ( prefix, value) ) = login_hint. split_once ( ":" ) else {
197+ let Some ( ( prefix, value) ) = login_hint. split_once ( ':' ) else {
197198 return LoginHint :: None ;
198199 } ;
199200
@@ -304,7 +305,7 @@ mod tests {
304305 ..AuthorizationGrant :: sample ( Utc :: now ( ) , & mut rng)
305306 } ;
306307
307- let hint = grant. parse_login_hint ( get_homeserver ( ) ) ;
308+ let hint = grant. parse_login_hint ( & get_homeserver ( ) ) ;
308309
309310 assert ! ( matches!( hint, LoginHint :: None ) ) ;
310311 }
@@ -319,7 +320,7 @@ mod tests {
319320 ..AuthorizationGrant :: sample ( Utc :: now ( ) , & mut rng)
320321 } ;
321322
322- let hint = grant. parse_login_hint ( get_homeserver ( ) ) ;
323+ let hint = grant. parse_login_hint ( & get_homeserver ( ) ) ;
323324
324325 assert ! ( matches!( hint, LoginHint :: MXID ( mxid) if mxid. localpart( ) == "example-user" ) ) ;
325326 }
@@ -334,7 +335,7 @@ mod tests {
334335 ..AuthorizationGrant :: sample ( Utc :: now ( ) , & mut rng)
335336 } ;
336337
337- let hint = grant. parse_login_hint ( get_homeserver ( ) ) ;
338+ let hint = grant. parse_login_hint ( & get_homeserver ( ) ) ;
338339
339340 assert ! ( matches!( hint, LoginHint :: None ) ) ;
340341 }
@@ -349,7 +350,7 @@ mod tests {
349350 ..AuthorizationGrant :: sample ( Utc :: now ( ) , & mut rng)
350351 } ;
351352
352- let hint = grant. parse_login_hint ( get_homeserver ( ) ) ;
353+ let hint = grant. parse_login_hint ( & get_homeserver ( ) ) ;
353354
354355 assert ! ( matches!( hint, LoginHint :: None ) ) ;
355356 }
@@ -364,7 +365,7 @@ mod tests {
364365 ..AuthorizationGrant :: sample ( Utc :: now ( ) , & mut rng)
365366 } ;
366367
367- let hint = grant. parse_login_hint ( get_homeserver ( ) ) ;
368+ let hint = grant. parse_login_hint ( & get_homeserver ( ) ) ;
368369
369370 assert ! ( matches!( hint, LoginHint :: None ) ) ;
370371 }
0 commit comments