diff --git a/.cargo/config.toml b/.cargo/config.toml index d5dbf656..883fccf4 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -28,6 +28,7 @@ rustflags = [ "-Wclippy::needless_borrow", "-Aclippy::new_without_default", "-Wclippy::nonstandard_macro_braces", + "-Wclippy::semicolon_if_nothing_returned", "-Wclippy::str_to_string", "-Wclippy::todo", "-Wclippy::unreadable_literal", diff --git a/crates/ruma-client-api/src/filter/url.rs b/crates/ruma-client-api/src/filter/url.rs index a6d0b21b..5e9c7f41 100644 --- a/crates/ruma-client-api/src/filter/url.rs +++ b/crates/ruma-client-api/src/filter/url.rs @@ -47,13 +47,13 @@ mod tests { #[test] fn serialize_filter_events_with_url() { let events_with_url = UrlFilter::EventsWithUrl; - assert_eq!(to_json_value(events_with_url).unwrap(), json!(true)) + assert_eq!(to_json_value(events_with_url).unwrap(), json!(true)); } #[test] fn serialize_filter_events_without_url() { let events_without_url = UrlFilter::EventsWithoutUrl; - assert_eq!(to_json_value(events_without_url).unwrap(), json!(false)) + assert_eq!(to_json_value(events_without_url).unwrap(), json!(false)); } #[test] diff --git a/crates/ruma-client-api/src/sync/sync_events.rs b/crates/ruma-client-api/src/sync/sync_events.rs index e9a405d1..b3032ad4 100644 --- a/crates/ruma-client-api/src/sync/sync_events.rs +++ b/crates/ruma-client-api/src/sync/sync_events.rs @@ -667,7 +667,7 @@ pub mod v3 { assert!(query.contains("since=s72594_4483_1934")); assert!(query.contains("full_state=true")); assert!(query.contains("set_presence=offline")); - assert!(query.contains("timeout=30000")) + assert!(query.contains("timeout=30000")); } } diff --git a/crates/ruma-common/src/directory.rs b/crates/ruma-common/src/directory.rs index c5bced55..1e6ecc1e 100644 --- a/crates/ruma-common/src/directory.rs +++ b/crates/ruma-common/src/directory.rs @@ -209,7 +209,7 @@ impl<'de> Visitor<'de> for RoomNetworkVisitor { } } "third_party_instance_id" => { - third_party_instance_id = value.as_str().map(|v| v.to_owned()) + third_party_instance_id = value.as_str().map(|v| v.to_owned()); } _ => {} }; diff --git a/crates/ruma-common/src/events/room/member.rs b/crates/ruma-common/src/events/room/member.rs index 8dbe0a47..ddb3b151 100644 --- a/crates/ruma-common/src/events/room/member.rs +++ b/crates/ruma-common/src/events/room/member.rs @@ -622,7 +622,7 @@ mod tests { && sender == "@alice:example.org" && state_key == "@alice:example.org" && unsigned.is_empty() - ) + ); } #[test] diff --git a/crates/ruma-common/src/events/secret/request.rs b/crates/ruma-common/src/events/secret/request.rs index 92634af8..388c4b8c 100644 --- a/crates/ruma-common/src/events/secret/request.rs +++ b/crates/ruma-common/src/events/secret/request.rs @@ -231,7 +231,7 @@ mod test { if secret == "org.example.some.secret".into() && requesting_device_id == "ABCDEFG" && request_id == "randomly_generated_id_9573" - ) + ); } #[test] @@ -251,7 +251,7 @@ mod test { } if requesting_device_id.as_str() == "ABCDEFG" && request_id == "randomly_generated_id_9573" - ) + ); } #[test] @@ -274,7 +274,7 @@ mod test { } if requesting_device_id == "XYZxyz" && request_id == "this_is_a_request_id" - ) + ); } #[test] @@ -295,6 +295,6 @@ mod test { if action == RequestAction::_Custom(PrivOwnedStr("my_custom_action".into())) && requesting_device_id == "XYZxyz" && request_id == "this_is_a_request_id" - ) + ); } } diff --git a/crates/ruma-common/src/events/secret_storage/key.rs b/crates/ruma-common/src/events/secret_storage/key.rs index 699489fa..2f1c4b43 100644 --- a/crates/ruma-common/src/events/secret_storage/key.rs +++ b/crates/ruma-common/src/events/secret_storage/key.rs @@ -147,7 +147,7 @@ mod tests { if name == *"my_key" && iv == Base64::parse("YWJjZGVmZ2hpamtsbW5vcA").unwrap() && mac == Base64::parse("aWRvbnRrbm93d2hhdGFtYWNsb29rc2xpa2U").unwrap() - ) + ); } #[test] @@ -216,7 +216,7 @@ mod tests { && salt == *"rocksalt" && iterations == uint!(8) && bits == uint!(256) - ) + ); } #[test] @@ -274,6 +274,6 @@ mod tests { && name == *"my_key" && iv == Base64::parse("YWJjZGVmZ2hpamtsbW5vcA").unwrap() && mac == Base64::parse("aWRvbnRrbm93d2hhdGFtYWNsb29rc2xpa2U").unwrap() - ) + ); } } diff --git a/crates/ruma-common/src/events/secret_storage/secret.rs b/crates/ruma-common/src/events/secret_storage/secret.rs index de1cc536..3c2a798e 100644 --- a/crates/ruma-common/src/events/secret_storage/secret.rs +++ b/crates/ruma-common/src/events/secret_storage/secret.rs @@ -102,7 +102,7 @@ mod tests { if iv == &Base64::parse("YWJjZGVmZ2hpamtsbW5vcA").unwrap() && ciphertext == &Base64::parse("dGhpc2lzZGVmaW5pdGVseWNpcGhlcnRleHQ").unwrap() && mac == &Base64::parse("aWRvbnRrbm93d2hhdGFtYWNsb29rc2xpa2U").unwrap() - ) + ); } } } diff --git a/crates/ruma-common/src/identifiers/client_secret.rs b/crates/ruma-common/src/identifiers/client_secret.rs index a714a3aa..c878f33a 100644 --- a/crates/ruma-common/src/identifiers/client_secret.rs +++ b/crates/ruma-common/src/identifiers/client_secret.rs @@ -34,6 +34,6 @@ mod tests { #[test] fn valid_secret() { - assert!(<&ClientSecret>::try_from("this_=_a_valid_secret_1337").is_ok()) + assert!(<&ClientSecret>::try_from("this_=_a_valid_secret_1337").is_ok()); } } diff --git a/crates/ruma-common/src/identifiers/event_id.rs b/crates/ruma-common/src/identifiers/event_id.rs index 67f9c31e..51176e5d 100644 --- a/crates/ruma-common/src/identifiers/event_id.rs +++ b/crates/ruma-common/src/identifiers/event_id.rs @@ -94,7 +94,7 @@ mod tests { <&EventId>::try_from("$acR1l0raoZnm60CBwAVgqbZqoO/mYU81xysh1u7XcJk") .expect("Failed to create EventId."), "$acR1l0raoZnm60CBwAVgqbZqoO/mYU81xysh1u7XcJk" - ) + ); } #[test] @@ -103,7 +103,7 @@ mod tests { <&EventId>::try_from("$Rqnc-F-dvnEYJTyHq_iKxU2bZ1CI92-kuZq3a5lr5Zg") .expect("Failed to create EventId."), "$Rqnc-F-dvnEYJTyHq_iKxU2bZ1CI92-kuZq3a5lr5Zg" - ) + ); } #[cfg(feature = "rand")] diff --git a/crates/ruma-common/src/identifiers/matrix_uri.rs b/crates/ruma-common/src/identifiers/matrix_uri.rs index 7a7302c9..6f9ebdce 100644 --- a/crates/ruma-common/src/identifiers/matrix_uri.rs +++ b/crates/ruma-common/src/identifiers/matrix_uri.rs @@ -738,7 +738,7 @@ mod tests { ) .unwrap_err(), MatrixToError::UnknownArgument.into() - ) + ); } #[test] diff --git a/crates/ruma-common/src/identifiers/voip_id.rs b/crates/ruma-common/src/identifiers/voip_id.rs index b3540baa..36c42ea8 100644 --- a/crates/ruma-common/src/identifiers/voip_id.rs +++ b/crates/ruma-common/src/identifiers/voip_id.rs @@ -33,6 +33,6 @@ mod tests { #[test] fn try_from() { - assert!(<&VoipId>::try_from("this_-_a_valid_secret_1337").is_ok()) + assert!(<&VoipId>::try_from("this_-_a_valid_secret_1337").is_ok()); } } diff --git a/crates/ruma-common/src/serde/canonical_json.rs b/crates/ruma-common/src/serde/canonical_json.rs index 97263da1..a6d94193 100644 --- a/crates/ruma-common/src/serde/canonical_json.rs +++ b/crates/ruma-common/src/serde/canonical_json.rs @@ -93,7 +93,7 @@ mod tests { assert_eq!( to_json_string(&json).unwrap(), r#"{"auth":{"mxid":"@john.doe:example.com","profile":{"display_name":"John Doe","three_pids":[{"address":"john.doe@example.org","medium":"email"},{"address":"123456789","medium":"msisdn"}]},"success":true}}"# - ) + ); } #[test] diff --git a/crates/ruma-common/src/serde/urlencoded/de/val_or_vec.rs b/crates/ruma-common/src/serde/urlencoded/de/val_or_vec.rs index 063493d6..62c5d001 100644 --- a/crates/ruma-common/src/serde/urlencoded/de/val_or_vec.rs +++ b/crates/ruma-common/src/serde/urlencoded/de/val_or_vec.rs @@ -30,7 +30,7 @@ impl ValOrVec { let existing_val = ptr::read(val); vec.push(existing_val); vec.push(new_val); - ptr::write(self, ValOrVec::Vec(vec)) + ptr::write(self, ValOrVec::Vec(vec)); } } ValOrVec::Vec(vec) => vec.push(new_val), diff --git a/crates/ruma-common/tests/events/call.rs b/crates/ruma-common/tests/events/call.rs index fa5184df..2d0b07bb 100644 --- a/crates/ruma-common/tests/events/call.rs +++ b/crates/ruma-common/tests/events/call.rs @@ -468,7 +468,7 @@ fn negotiate_event_deserialization() { assert_eq!(content.party_id, "9876"); assert_eq!(content.lifetime, uint!(30000)); assert_eq!(content.description.session_type, SessionDescriptionType::PrAnswer); - assert_eq!(content.description.sdp, "not a real sdp") + assert_eq!(content.description.sdp, "not a real sdp"); } #[test] diff --git a/crates/ruma-common/tests/events/redacted.rs b/crates/ruma-common/tests/events/redacted.rs index 59b1481d..3b12ef52 100644 --- a/crates/ruma-common/tests/events/redacted.rs +++ b/crates/ruma-common/tests/events/redacted.rs @@ -131,7 +131,7 @@ fn redacted_aliases_deserialize() { }), )) if event_id == event_id!("$h29iv0s8:example.com") && aliases.is_none() - ) + ); } #[test] @@ -156,7 +156,7 @@ fn redacted_deserialize_any_room() { }), )) if event_id == event_id!("$h29iv0s8:example.com") && room_id == room_id!("!roomid:room.com") - ) + ); } #[test] @@ -194,7 +194,7 @@ fn redacted_deserialize_any_room_sync() { .. }), )) if event_id == event_id!("$h29iv0s8:example.com") - ) + ); } #[test] @@ -226,7 +226,7 @@ fn redacted_state_event_deserialize() { )) if event_id == event_id!("$h29iv0s8:example.com") && unsigned.redacted_because.is_some() && creator == user_id!("@carl:example.com") - ) + ); } #[test] @@ -246,7 +246,7 @@ fn redacted_custom_event_serialize() { ); let x = from_json_value::(redacted).unwrap(); - assert_eq!(x.event_id(), event_id!("$h29iv0s8:example.com")) + assert_eq!(x.event_id(), event_id!("$h29iv0s8:example.com")); } /* #[test] diff --git a/crates/ruma-common/tests/serde/url_deserialize.rs b/crates/ruma-common/tests/serde/url_deserialize.rs index 1513639f..8d15b1ed 100644 --- a/crates/ruma-common/tests/serde/url_deserialize.rs +++ b/crates/ruma-common/tests/serde/url_deserialize.rs @@ -100,7 +100,7 @@ fn deserialize_list_of_str() { Err(error) if error.to_string().contains("unsupported") ); - assert_eq!(urlencoded::from_str("a=a&a=b"), Ok(vec![("a", vec!["a", "b"])])) + assert_eq!(urlencoded::from_str("a=a&a=b"), Ok(vec![("a", vec!["a", "b"])])); } #[test] diff --git a/crates/ruma-common/tests/serde/url_serialize.rs b/crates/ruma-common/tests/serde/url_serialize.rs index a79c9235..adbc12a5 100644 --- a/crates/ruma-common/tests/serde/url_serialize.rs +++ b/crates/ruma-common/tests/serde/url_serialize.rs @@ -92,7 +92,7 @@ fn serialize_nested_list() { assert_matches!( urlencoded::to_string(params), Err(Error::Custom(s)) if s.contains("unsupported") - ) + ); } #[test] diff --git a/crates/ruma-macros/src/api/api_metadata.rs b/crates/ruma-macros/src/api/api_metadata.rs index 0a7fc260..c84ecd61 100644 --- a/crates/ruma-macros/src/api/api_metadata.rs +++ b/crates/ruma-macros/src/api/api_metadata.rs @@ -329,6 +329,6 @@ impl Parse for EndpointPath { impl ToTokens for EndpointPath { fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) { - self.0.to_tokens(tokens) + self.0.to_tokens(tokens); } } diff --git a/crates/ruma-macros/src/api/request.rs b/crates/ruma-macros/src/api/request.rs index 92466dd7..8b2461c9 100644 --- a/crates/ruma-macros/src/api/request.rs +++ b/crates/ruma-macros/src/api/request.rs @@ -489,6 +489,6 @@ impl Parse for RequestField { impl ToTokens for RequestField { fn to_tokens(&self, tokens: &mut TokenStream) { - self.field().to_tokens(tokens) + self.field().to_tokens(tokens); } } diff --git a/crates/ruma-macros/src/api/response.rs b/crates/ruma-macros/src/api/response.rs index 131be0bd..c97becb2 100644 --- a/crates/ruma-macros/src/api/response.rs +++ b/crates/ruma-macros/src/api/response.rs @@ -256,7 +256,7 @@ impl Parse for ResponseField { impl ToTokens for ResponseField { fn to_tokens(&self, tokens: &mut TokenStream) { - self.field().to_tokens(tokens) + self.field().to_tokens(tokens); } } diff --git a/crates/ruma-macros/src/api/util.rs b/crates/ruma-macros/src/api/util.rs index 220992c1..5449d3f3 100644 --- a/crates/ruma-macros/src/api/util.rs +++ b/crates/ruma-macros/src/api/util.rs @@ -25,7 +25,7 @@ pub fn collect_lifetime_idents(lifetimes: &mut BTreeSet, ty: &Type) { } } - Visitor(lifetimes).visit_type(ty) + Visitor(lifetimes).visit_type(ty); } pub fn all_cfgs_expr(cfgs: &[Attribute]) -> Option { diff --git a/crates/ruma-macros/src/events/event_enum.rs b/crates/ruma-macros/src/events/event_enum.rs index 37c3c48b..cf091e3b 100644 --- a/crates/ruma-macros/src/events/event_enum.rs +++ b/crates/ruma-macros/src/events/event_enum.rs @@ -658,7 +658,7 @@ impl EventEnumVariant { } } if let Some(p) = prefix { - tokens.extend(quote! { #p :: }) + tokens.extend(quote! { #p :: }); } self.ident.to_tokens(&mut tokens); diff --git a/crates/ruma-macros/src/events/event_parse.rs b/crates/ruma-macros/src/events/event_parse.rs index 3ce278a0..b5dbc42d 100644 --- a/crates/ruma-macros/src/events/event_parse.rs +++ b/crates/ruma-macros/src/events/event_parse.rs @@ -256,7 +256,7 @@ impl Parse for EventEnumEntry { let alias = alias_attr.into_inner(); if alias.value().ends_with(".*") == has_suffix { - aliases.push(alias) + aliases.push(alias); } else { return Err(syn::Error::new_spanned( &attr_list, diff --git a/crates/ruma-macros/src/events/event_type.rs b/crates/ruma-macros/src/events/event_type.rs index baf81126..646a97ea 100644 --- a/crates/ruma-macros/src/events/event_type.rs +++ b/crates/ruma-macros/src/events/event_type.rs @@ -160,10 +160,10 @@ fn generate_enum( _s if _s.starts_with(#prefix) => { #ctor(::std::convert::From::from(_s.strip_prefix(#prefix).unwrap())) } - }) + }); } } else { - from_str_match_arms.extend(quote! { #(#attrs)* #(#ev_types)|* => #ctor, }) + from_str_match_arms.extend(quote! { #(#attrs)* #(#ev_types)|* => #ctor, }); } } diff --git a/crates/ruma-push-gateway-api/src/send_event_notification.rs b/crates/ruma-push-gateway-api/src/send_event_notification.rs index d8815050..eb4df7ee 100644 --- a/crates/ruma-push-gateway-api/src/send_event_notification.rs +++ b/crates/ruma-push-gateway-api/src/send_event_notification.rs @@ -453,7 +453,7 @@ pub mod v1 { ..Notification::default() }; - assert_eq!(expected, to_json_value(notice).unwrap()) + assert_eq!(expected, to_json_value(notice).unwrap()); } } } diff --git a/crates/ruma-signatures/src/functions.rs b/crates/ruma-signatures/src/functions.rs index 73f30538..c2b8d59b 100644 --- a/crates/ruma-signatures/src/functions.rs +++ b/crates/ruma-signatures/src/functions.rs @@ -783,7 +783,7 @@ pub fn redact_content_in_place( version: &RoomVersionId, event_type: impl AsRef, ) { - object_retain_keys(object, allowed_content_keys_for(event_type.as_ref(), version)) + object_retain_keys(object, allowed_content_keys_for(event_type.as_ref(), version)); } fn object_retain_keys(object: &mut CanonicalJsonObject, keys: &[&str]) { @@ -1065,8 +1065,8 @@ mod tests { let verification_result = verify_event(&public_key_map, &signed_event, &RoomVersionId::V9); - assert!(verification_result.is_err()) // Should be Err(VerificationError:: - // signature_not_found("domain-authorized"))); + // Should be Err(VerificationError::signature_not_found("domain-authorized"))); + assert!(verification_result.is_err()); } #[test] @@ -1152,7 +1152,9 @@ mod tests { if let Error::Verification(VerificationError::Signature(error)) = error_msg { // dalek doesn't expose InternalError :( // https://github.com/dalek-cryptography/ed25519-dalek/issues/174 - assert!(format!("{:?}", error).contains("Some(Verification equation was not satisfied)")) + assert!( + format!("{:?}", error).contains("Some(Verification equation was not satisfied)") + ); } else { panic!("Error was not VerificationError::Signature: {:?}", error_msg); }; diff --git a/crates/ruma-state-res/benches/state_res_bench.rs b/crates/ruma-state-res/benches/state_res_bench.rs index ff70b3a3..9ec4062c 100644 --- a/crates/ruma-state-res/benches/state_res_bench.rs +++ b/crates/ruma-state-res/benches/state_res_bench.rs @@ -53,7 +53,7 @@ fn lexico_topo_sort(c: &mut Criterion) { let _ = state_res::lexicographical_topological_sort(&graph, |_id| { Ok((int!(0), MilliSecondsSinceUnixEpoch(uint!(0)))) }); - }) + }); }); } @@ -81,7 +81,7 @@ fn resolution_shallow_auth_chain(c: &mut Criterion) { Ok(state) => state, Err(e) => panic!("{}", e), }; - }) + }); }); } @@ -139,7 +139,7 @@ fn resolve_deeper_event_set(c: &mut Criterion) { Ok(state) => state, Err(_) => panic!("resolution failed during benchmarking"), }; - }) + }); }); } diff --git a/crates/ruma-state-res/src/lib.rs b/crates/ruma-state-res/src/lib.rs index e62b2ed5..de3a1e7b 100644 --- a/crates/ruma-state-res/src/lib.rs +++ b/crates/ruma-state-res/src/lib.rs @@ -738,7 +738,7 @@ mod tests { "$END:foo" ], sorted_event_ids.iter().map(|id| id.to_string()).collect::>() - ) + ); } #[test] @@ -746,7 +746,7 @@ mod tests { for _ in 0..20 { // since we shuffle the eventIds before we sort them introducing randomness // seems like we should test this a few times - test_event_sort() + test_event_sort(); } } @@ -794,7 +794,7 @@ mod tests { let expected_state_ids = vec!["PA", "MA", "MB"].into_iter().map(event_id).collect::>(); - do_check(events, edges, expected_state_ids) + do_check(events, edges, expected_state_ids); } #[test] @@ -855,7 +855,7 @@ mod tests { let expected_state_ids = vec!["PA2", "T2"].into_iter().map(event_id).collect::>(); - do_check(events, edges, expected_state_ids) + do_check(events, edges, expected_state_ids); } #[test] @@ -902,7 +902,7 @@ mod tests { let expected_state_ids = vec!["T1", "MB", "PA"].into_iter().map(event_id).collect::>(); - do_check(events, edges, expected_state_ids) + do_check(events, edges, expected_state_ids); } #[test] @@ -934,7 +934,7 @@ mod tests { let expected_state_ids = vec![event_id("JR")]; - do_check(events, edges, expected_state_ids) + do_check(events, edges, expected_state_ids); } #[test] @@ -975,7 +975,7 @@ mod tests { let expected_state_ids = vec!["PC"].into_iter().map(event_id).collect::>(); - do_check(events, edges, expected_state_ids) + do_check(events, edges, expected_state_ids); } #[test] @@ -1052,7 +1052,7 @@ mod tests { let expected_state_ids = vec!["T4", "PA2"].into_iter().map(event_id).collect::>(); - do_check(events, edges, expected_state_ids) + do_check(events, edges, expected_state_ids); } #[test] @@ -1082,7 +1082,7 @@ mod tests { Err(e) => panic!("{}", e), }; - assert_eq!(expected, resolved) + assert_eq!(expected, resolved); } #[test] @@ -1109,7 +1109,7 @@ mod tests { .map(ToString::to_string) .map(|s| s.replace('$', "").replace(":foo", "")) .collect::>() - ) + ); } #[test] @@ -1202,9 +1202,9 @@ mod tests { for id in expected.iter().map(|i| event_id(i)) { // make sure our resolved events are equal to the expected list - assert!(resolved.values().any(|eid| eid == &id) || init.contains_key(&id), "{}", id) + assert!(resolved.values().any(|eid| eid == &id) || init.contains_key(&id), "{}", id); } - assert_eq!(expected.len(), resolved.len()) + assert_eq!(expected.len(), resolved.len()); } #[test] diff --git a/examples/joke_bot/src/main.rs b/examples/joke_bot/src/main.rs index d5b0198c..00686aab 100644 --- a/examples/joke_bot/src/main.rs +++ b/examples/joke_bot/src/main.rs @@ -50,7 +50,11 @@ async fn run() -> Result<(), Box> { }) .await { - eprintln!("Failed to persist access token to disk. Re-authentication will be required on the next startup: {}", err) + eprintln!( + "Failed to persist access token to disk. \ + Re-authentication will be required on the next startup: {}", + err + ); } client } else { @@ -91,14 +95,14 @@ async fn run() -> Result<(), Box> { if let Err(err) = handle_message(http_client, matrix_client, e, room_id, user_id).await { - eprintln!("failed to respond to message: {}", err) + eprintln!("failed to respond to message: {}", err); } } }); let invite_futures = response.rooms.invite.iter().map(|(room_id, _)| async move { if let Err(err) = handle_invitations(http_client, matrix_client, room_id).await { - eprintln!("failed to accept invitation for room {}: {}", &room_id, err) + eprintln!("failed to accept invitation for room {}: {}", &room_id, err); } }); @@ -240,10 +244,9 @@ async fn read_config() -> io::Result { "homeserver" => homeserver = Some(value.trim().to_owned()), // TODO: infer domain from `homeserver` "username" => { - username = - value.trim().to_owned().try_into().map_err(|e| { - format!("invalid Matrix user ID format for `username`: {}", e) - }) + username = value.trim().to_owned().try_into().map_err(|e| { + format!("invalid Matrix user ID format for `username`: {}", e) + }); } "password" => password = Some(value.trim().to_owned()), _ => {} @@ -256,7 +259,7 @@ async fn read_config() -> io::Result { (homeserver, username) => { let mut error = String::from("Invalid config specified:"); if homeserver.is_none() { - error.push_str("\n required field `homeserver` is missing") + error.push_str("\n required field `homeserver` is missing"); } if let Err(e) = username { error.push_str("\n ");