diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..d0f263f --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,22 @@ +unstable_features = true +blank_lines_lower_bound = 1 +blank_lines_upper_bound = 3 +chain_width = 120 +wrap_comments = true +comment_width = 100 +edition = 2018 +enum_discrim_align_threshold = 16 +fn_params_layout = "Compressed" +fn_call_width = 100 +fn_single_line = true +format_code_in_doc_comments = true +ignore = ["extern/"] +max_width = 120 +merge_derives = true +merge_imports = true +normalize_doc_attributes = true +reorder_impl_items = true +tab_spaces = 2 +use_field_init_shorthand = true +use_try_shorthand = true +where_single_line = true \ No newline at end of file diff --git a/src/matrixbot.rs b/src/matrixbot.rs index 27aaaf0..864bee4 100644 --- a/src/matrixbot.rs +++ b/src/matrixbot.rs @@ -214,8 +214,12 @@ pub async fn login_and_sync( // since we called sync before we `sync_forever` we must pass that sync token to // `sync_forever` - let mut settings = SyncSettings::default().token(client.sync_token().await.unwrap()); + let settings = SyncSettings::default().token(client.sync_token().await.unwrap()); + Ok(()) +} + +async fn client_task(client: Client, settings: SyncSettings) -> Result<(), anyhow::Error> { let client_ref = &client; client .sync_forever(settings, async move |response| { @@ -304,6 +308,5 @@ pub async fn login_and_sync( } }) .await; - Ok(()) }