Commit 945e2cf079

945e2cf0791b68140303e03aacf4e7f5a0e160e4

parent: 01e3a863fd

Unsigned

Damir Jelić <poljar@termina.org.uk> · 2021-05-06 19:59 UTC

weechat-matrix: Fix some new clippy warnings

Layout: unified · split

Cargo.lock +4 −4
@@ -1023,7 +1023,7 @@ checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
1023[[package]] 1023[[package]]
1024name = "matrix-sdk" 1024name = "matrix-sdk"
1025version = "0.2.0" 1025version = "0.2.0"
1026source = "git+https://github.com/matrix-org/matrix-rust-sdk#d90e112c065857b96d4f024794589df24702cbad" 1026source = "git+https://github.com/matrix-org/matrix-rust-sdk#8dbbacfbe618c5301490984f4ba63c4633224264"
1027dependencies = [ 1027dependencies = [
1028 "backoff", 1028 "backoff",
1029 "bytes", 1029 "bytes",
@@ -1047,7 +1047,7 @@ dependencies = [
1047[[package]] 1047[[package]]
1048name = "matrix-sdk-base" 1048name = "matrix-sdk-base"
1049version = "0.2.0" 1049version = "0.2.0"
1050source = "git+https://github.com/matrix-org/matrix-rust-sdk#d90e112c065857b96d4f024794589df24702cbad" 1050source = "git+https://github.com/matrix-org/matrix-rust-sdk#8dbbacfbe618c5301490984f4ba63c4633224264"
1051dependencies = [ 1051dependencies = [
1052 "chacha20poly1305", 1052 "chacha20poly1305",
1053 "dashmap", 1053 "dashmap",
@@ -1070,7 +1070,7 @@ dependencies = [
1070[[package]] 1070[[package]]
1071name = "matrix-sdk-common" 1071name = "matrix-sdk-common"
1072version = "0.2.0" 1072version = "0.2.0"
1073source = "git+https://github.com/matrix-org/matrix-rust-sdk#d90e112c065857b96d4f024794589df24702cbad" 1073source = "git+https://github.com/matrix-org/matrix-rust-sdk#8dbbacfbe618c5301490984f4ba63c4633224264"
1074dependencies = [ 1074dependencies = [
1075 "async-trait", 1075 "async-trait",
1076 "futures", 1076 "futures",
@@ -1086,7 +1086,7 @@ dependencies = [
1086[[package]] 1086[[package]]
1087name = "matrix-sdk-crypto" 1087name = "matrix-sdk-crypto"
1088version = "0.2.0" 1088version = "0.2.0"
1089source = "git+https://github.com/matrix-org/matrix-rust-sdk#d90e112c065857b96d4f024794589df24702cbad" 1089source = "git+https://github.com/matrix-org/matrix-rust-sdk#8dbbacfbe618c5301490984f4ba63c4633224264"
1090dependencies = [ 1090dependencies = [
1091 "aes-ctr", 1091 "aes-ctr",
1092 "aes-gcm", 1092 "aes-gcm",
src/server.rs +3 −4
@@ -931,8 +931,7 @@ impl InnerServer {
931 }; 931 };
932 932
933 let fingerprint = if is_own_device { 933 let fingerprint = if is_own_device {
934 // TODO we need to be able to fetch this 934 c.client().ed25519_key().await
935 "TODO".to_owned()
936 } else { 935 } else {
937 c.client() 936 c.client()
938 .get_device(&own_user_id, &device_info.device_id) 937 .get_device(&own_user_id, &device_info.device_id)
@@ -942,8 +941,8 @@ impl InnerServer {
942 d.get_key(DeviceKeyAlgorithm::Ed25519).cloned() 941 d.get_key(DeviceKeyAlgorithm::Ed25519).cloned()
943 }) 942 })
944 .flatten() 943 .flatten()
945 .unwrap_or("-".to_owned()) 944 }
946 }; 945 .unwrap_or_else(|| "-".to_owned());
947 946
948 let fingerprint = fingerprint 947 let fingerprint = fingerprint
949 .chars() 948 .chars()
src/utils.rs +3 −5
@@ -22,11 +22,9 @@ impl Edit for MessageEventContent {
22 22
23 fn get_edit(&self) -> Option<(&EventId, &MessageEventContent)> { 23 fn get_edit(&self) -> Option<(&EventId, &MessageEventContent)> {
24 if let Some(Relation::Replacement(r)) = self.relates_to.as_ref() { 24 if let Some(Relation::Replacement(r)) = self.relates_to.as_ref() {
25 if let Some(content) = self.new_content.as_ref() { 25 self.new_content
26 Some((&r.event_id, &*content)) 26 .as_ref()
27 } else { 27 .map(|content| (&r.event_id, content.as_ref()))
28 None
29 }
30 } else { 28 } else {
31 None 29 None
32 } 30 }