@@ -925,17 +925,18 @@ impl Client {
925
925
/// [`login_with_token`]: #method.login_with_token
926
926
/// [`restore_login`]: #method.restore_login
927
927
#[ cfg( all( feature = "sso_login" , not( target_arch = "wasm32" ) ) ) ]
928
+ #[ deny( clippy:: future_not_send) ]
928
929
pub async fn login_with_sso < C > (
929
930
& self ,
930
- use_sso_login_url : impl Fn ( String ) -> C ,
931
+ use_sso_login_url : impl FnOnce ( String ) -> C + Send ,
931
932
server_url : Option < & str > ,
932
933
server_response : Option < & str > ,
933
934
device_id : Option < & str > ,
934
935
initial_device_display_name : Option < & str > ,
935
936
idp_id : Option < & str > ,
936
937
) -> Result < login:: v3:: Response >
937
938
where
938
- C : Future < Output = Result < ( ) > > ,
939
+ C : Future < Output = Result < ( ) > > + Send ,
939
940
{
940
941
use std:: {
941
942
collections:: HashMap ,
@@ -951,7 +952,6 @@ impl Client {
951
952
/// The number of times the SSO server will try to bind to a random port
952
953
const SSO_SERVER_BIND_TRIES : u8 = 10 ;
953
954
954
- info ! ( "Logging in to {}" , self . homeserver( ) . await ) ;
955
955
let ( signal_tx, signal_rx) = tokio:: sync:: oneshot:: channel ( ) ;
956
956
let ( data_tx, data_rx) = tokio:: sync:: oneshot:: channel ( ) ;
957
957
let data_tx_mutex = Arc :: new ( std:: sync:: Mutex :: new ( Some ( data_tx) ) ) ;
@@ -992,10 +992,9 @@ impl Client {
992
992
let mut n = 0u8 ;
993
993
let mut port = 0u16 ;
994
994
let mut res = Err ( IoError :: new ( IoErrorKind :: Other , "" ) ) ;
995
- let mut rng = thread_rng ( ) ;
996
995
997
996
while res. is_err ( ) && n < SSO_SERVER_BIND_TRIES {
998
- port = rng . gen_range ( SSO_SERVER_BIND_RANGE ) ;
997
+ port = thread_rng ( ) . gen_range ( SSO_SERVER_BIND_RANGE ) ;
999
998
res = tokio:: net:: TcpListener :: bind ( ( host, port) ) . await ;
1000
999
n += 1 ;
1001
1000
}
@@ -1102,14 +1101,13 @@ impl Client {
1102
1101
/// [`get_sso_login_url`]: #method.get_sso_login_url
1103
1102
/// [`restore_login`]: #method.restore_login
1104
1103
#[ instrument( skip( token) ) ]
1104
+ #[ deny( clippy:: future_not_send) ]
1105
1105
pub async fn login_with_token (
1106
1106
& self ,
1107
1107
token : & str ,
1108
1108
device_id : Option < & str > ,
1109
1109
initial_device_display_name : Option < & str > ,
1110
1110
) -> Result < login:: v3:: Response > {
1111
- info ! ( "Logging in to {}" , self . homeserver( ) . await ) ;
1112
-
1113
1111
let request = assign ! (
1114
1112
login:: v3:: Request :: new(
1115
1113
login:: v3:: LoginInfo :: Token ( login:: v3:: Token :: new( token) ) ,
0 commit comments