File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -37,12 +37,12 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
37
37
let sync_url = env:: args ( )
38
38
. nth ( 2 )
39
39
. unwrap_or_else ( || "ws://192.168.1.32:4984/demo/" . to_string ( ) ) ;
40
- let token: Option < String > = env:: args ( ) . nth ( 3 ) ;
41
40
42
- let auth = if let Some ( token) = token {
43
- ReplicatorAuthentication :: SessionToken ( token)
44
- } else {
45
- ReplicatorAuthentication :: None
41
+ let auth = match ( env:: args ( ) . nth ( 3 ) , env:: args ( ) . nth ( 4 ) ) {
42
+ ( None , None ) => ReplicatorAuthentication :: None ,
43
+ ( None , Some ( _) ) => unreachable ! ( ) ,
44
+ ( Some ( token) , None ) => ReplicatorAuthentication :: SessionToken ( token) ,
45
+ ( Some ( username) , Some ( password) ) => ReplicatorAuthentication :: Basic { username, password } ,
46
46
} ;
47
47
48
48
let ( db_thread, db_exec) = run_db_thread ( db_path, sync_url, auth) ;
You can’t perform that action at this time.
0 commit comments