Commit a32149f604

a32149f60413736e797723582fca49c991b8edcd

parent: 3149f79d11

Unregistered key

vaw <git@nlih.de> · 2025-10-26 14:44 UTC
committer: <noreply@github.com>

Fix CI on main branch (#545)

Co-authored-by: Benjamin Große <ste3ls@gmail.com>

Layout: unified · split

flake.nix +8 −5
@@ -30,16 +30,15 @@
3030 rustToolchain = fenix.packages.${system}.fromToolchainFile {
3131 file = ./rust-toolchain.toml;
3232 # When the file changes, this hash must be updated.
33 sha256 = "sha256-Hn2uaQzRLidAWpfmRwSRdImifGUCAb9HeAqTYFXWeQk=";
33 sha256 = "sha256-Qxt8XAuaUR2OMdKbN4u8dBJOhSHxS+uS06Wl9+flVEk=";
3434 };
3535
3636 # Nightly toolchain for rustfmt (pinned to current flake lock)
3737 # Note that the github CI uses "current nightly" for formatting, it 's not pinned.
38 rustNightly = fenix.packages.${system}.latest.toolchain;
39 rustNightlyFmt = fenix.packages.${system}.latest.rustfmt;
38 rustNightly = fenix.packages.${system}.latest;
4039
4140 craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain;
42 craneLibNightly = (crane.mkLib pkgs).overrideToolchain rustNightly;
41 craneLibNightly = (crane.mkLib pkgs).overrideToolchain rustNightly.toolchain;
4342
4443 src = lib.fileset.toSource {
4544 root = ./.;
@@ -97,11 +96,15 @@
9796 checks = self.checks.${system};
9897
9998 packages = with pkgs; [
100 rustNightlyFmt
10199 cargo-tarpaulin
102100 cargo-watch
103101 sqlite
104102 ];
103
104 shellHook = ''
105 # Prepend nightly rustfmt to PATH.
106 export PATH="${rustNightly.rustfmt}/bin:$PATH"
107 '';
105108 };
106109 }
107110 );
src/base.rs +4 −4
@@ -2049,7 +2049,7 @@ fn complete_msgbar(text: &EditRope, cursor: &mut Cursor, store: &ChatStore) -> V
20492049 // Complete Emoji shortcodes.
20502050 Some(':') => {
20512051 let list = store.emojis.complete(&id[1..]);
2052 let iter = list.into_iter().take(200).map(|s| format!(":{}:", s));
2052 let iter = list.into_iter().take(200).map(|s| format!(":{s}:"));
20532053
20542054 return iter.collect();
20552055 },
@@ -2195,7 +2195,7 @@ pub mod tests {
21952195 ));
21962196
21972197 for i in 0..3 {
2198 let event_id = format!("$house_{}", i);
2198 let event_id = format!("$house_{i}");
21992199 info.insert_reaction(MessageLikeEvent::Original(
22002200 matrix_sdk::ruma::events::OriginalMessageLikeEvent {
22012201 content: content.clone(),
@@ -2214,7 +2214,7 @@ pub mod tests {
22142214 ));
22152215
22162216 for i in 0..2 {
2217 let event_id = format!("$smile_{}", i);
2217 let event_id = format!("$smile_{i}");
22182218 info.insert_reaction(MessageLikeEvent::Original(
22192219 matrix_sdk::ruma::events::OriginalMessageLikeEvent {
22202220 content: content.clone(),
@@ -2228,7 +2228,7 @@ pub mod tests {
22282228 }
22292229
22302230 for i in 2..4 {
2231 let event_id = format!("$smile_{}", i);
2231 let event_id = format!("$smile_{i}");
22322232 info.insert_reaction(MessageLikeEvent::Original(
22332233 matrix_sdk::ruma::events::OriginalMessageLikeEvent {
22342234 content: content.clone(),
src/config.rs +1 −4
@@ -932,10 +932,7 @@ impl ApplicationSettings {
932932 } else {
933933 loop {
934934 println!("\nNo profile specified. Available profiles:");
935 profiles
936 .keys()
937 .enumerate()
938 .for_each(|(i, name)| println!("{}: {}", i, name));
935 profiles.keys().enumerate().for_each(|(i, name)| println!("{i}: {name}"));
939936
940937 print!("Select a number or 'q' to quit: ");
941938 let _ = std::io::stdout().flush();
src/message/state.rs +15 −15
@@ -121,11 +121,11 @@ pub fn body_cow_state(ev: &AnySyncStateEvent) -> Cow<'static, str> {
121121
122122 match (old_canon, new_canon) {
123123 (None, Some(canon)) => {
124 format!("* updated the canonical alias for the room to: {}", canon)
124 format!("* updated the canonical alias for the room to: {canon}")
125125 },
126126 (Some(old), Some(new)) => {
127127 if old != new {
128 format!("* updated the canonical alias for the room to: {}", new)
128 format!("* updated the canonical alias for the room to: {new}")
129129 } else {
130130 return Cow::Borrowed("* removed the canonical alias for the room");
131131 }
@@ -187,10 +187,10 @@ pub fn body_cow_state(ev: &AnySyncStateEvent) -> Cow<'static, str> {
187187
188188 match change {
189189 MembershipChange::None => {
190 format!("* did nothing to {}", state_key)
190 format!("* did nothing to {state_key}")
191191 },
192192 MembershipChange::Error => {
193 format!("* failed to calculate membership change to {}", state_key)
193 format!("* failed to calculate membership change to {state_key}")
194194 },
195195 MembershipChange::Joined => {
196196 return Cow::Borrowed("* joined the room");
@@ -199,19 +199,19 @@ pub fn body_cow_state(ev: &AnySyncStateEvent) -> Cow<'static, str> {
199199 return Cow::Borrowed("* left the room");
200200 },
201201 MembershipChange::Banned => {
202 format!("* banned {} from the room", state_key)
202 format!("* banned {state_key} from the room")
203203 },
204204 MembershipChange::Unbanned => {
205 format!("* unbanned {} from the room", state_key)
205 format!("* unbanned {state_key} from the room")
206206 },
207207 MembershipChange::Kicked => {
208 format!("* kicked {} from the room", state_key)
208 format!("* kicked {state_key} from the room")
209209 },
210210 MembershipChange::Invited => {
211 format!("* invited {} to the room", state_key)
211 format!("* invited {state_key} to the room")
212212 },
213213 MembershipChange::KickedAndBanned => {
214 format!("* kicked and banned {} from the room", state_key)
214 format!("* kicked and banned {state_key} from the room")
215215 },
216216 MembershipChange::InvitationAccepted => {
217217 return Cow::Borrowed("* accepted an invitation to join the room");
@@ -220,26 +220,26 @@ pub fn body_cow_state(ev: &AnySyncStateEvent) -> Cow<'static, str> {
220220 return Cow::Borrowed("* rejected an invitation to join the room");
221221 },
222222 MembershipChange::InvitationRevoked => {
223 format!("* revoked an invitation for {} to join the room", state_key)
223 format!("* revoked an invitation for {state_key} to join the room")
224224 },
225225 MembershipChange::Knocked => {
226226 return Cow::Borrowed("* would like to join the room");
227227 },
228228 MembershipChange::KnockAccepted => {
229 format!("* accepted the room knock from {}", state_key)
229 format!("* accepted the room knock from {state_key}")
230230 },
231231 MembershipChange::KnockRetracted => {
232232 return Cow::Borrowed("* retracted their room knock");
233233 },
234234 MembershipChange::KnockDenied => {
235 format!("* rejected the room knock from {}", state_key)
235 format!("* rejected the room knock from {state_key}")
236236 },
237237 MembershipChange::ProfileChanged { displayname_change, avatar_url_change } => {
238238 match (displayname_change, avatar_url_change) {
239239 (Some(change), avatar_change) => {
240240 let mut m = match (change.old, change.new) {
241241 (None, Some(new)) => {
242 format!("* set their display name to {:?}", new)
242 format!("* set their display name to {new:?}")
243243 },
244244 (Some(old), Some(new)) => {
245245 format!("* changed their display name from {old} to {new}")
@@ -280,7 +280,7 @@ pub fn body_cow_state(ev: &AnySyncStateEvent) -> Cow<'static, str> {
280280 }
281281 },
282282 ev => {
283 format!("* made an unknown membership change to {}: {:?}", state_key, ev)
283 format!("* made an unknown membership change to {state_key}: {ev:?}")
284284 },
285285 }
286286 },
@@ -727,7 +727,7 @@ pub fn html_state(ev: &AnySyncStateEvent) -> StyleTree {
727727 ev => {
728728 let prefix =
729729 StyleTreeNode::Text("* made an unknown membership change to ".into());
730 let suffix = StyleTreeNode::Text(format!(": {:?}", ev).into());
730 let suffix = StyleTreeNode::Text(format!(": {ev:?}").into());
731731 vec![prefix, user_id, suffix]
732732 },
733733 }
src/windows/room/chat.rs +3 −3
@@ -273,9 +273,9 @@ impl ChatState {
273273 let mut filename_incr = filename.clone();
274274 for n in 1..=1000 {
275275 if let Some(ext) = ext.and_then(OsStr::to_str) {
276 filename_incr.set_file_name(format!("{}-{}.{}", stem, n, ext));
276 filename_incr.set_file_name(format!("{stem}-{n}.{ext}"));
277277 } else {
278 filename_incr.set_file_name(format!("{}-{}", stem, n));
278 filename_incr.set_file_name(format!("{stem}-{n}"));
279279 }
280280
281281 if !filename_incr.exists() {
@@ -401,7 +401,7 @@ impl ChatState {
401401 };
402402
403403 if info.user_reactions_contains(&settings.profile.user_id, &event_id, &emoji) {
404 let msg = format!("You’ve already reacted to this message with {}", emoji);
404 let msg = format!("You’ve already reacted to this message with {emoji}");
405405 let err = UIError::Failure(msg);
406406
407407 return Err(err);
src/windows/room/mod.rs +6 −6
@@ -120,19 +120,19 @@ fn hist_visibility_mode(name: impl Into<String>) -> IambResult<HistoryVisibility
120120/// that operations like sending and accepting invites, opening the members window, etc., all work
121121/// similarly.
122122pub enum RoomState {
123 Chat(ChatState),
124 Space(SpaceState),
123 Chat(Box<ChatState>),
124 Space(Box<SpaceState>),
125125}
126126
127127impl From<ChatState> for RoomState {
128128 fn from(chat: ChatState) -> Self {
129 RoomState::Chat(chat)
129 RoomState::Chat(Box::new(chat))
130130 }
131131}
132132
133133impl From<SpaceState> for RoomState {
134134 fn from(space: SpaceState) -> Self {
135 RoomState::Space(space)
135 RoomState::Space(Box::new(space))
136136 }
137137}
138138
@@ -776,8 +776,8 @@ impl WindowOps<IambInfo> for RoomState {
776776
777777 fn dup(&self, store: &mut ProgramStore) -> Self {
778778 match self {
779 RoomState::Chat(chat) => RoomState::Chat(chat.dup(store)),
780 RoomState::Space(space) => RoomState::Space(space.dup(store)),
779 RoomState::Chat(chat) => RoomState::Chat(Box::new(chat.dup(store))),
780 RoomState::Space(space) => RoomState::Space(Box::new(space.dup(store))),
781781 }
782782 }
783783