Fix CI on main branch (#545)
Co-authored-by: Benjamin Große <ste3ls@gmail.com>
This commit is contained in:
13
flake.nix
13
flake.nix
@@ -30,16 +30,15 @@
|
||||
rustToolchain = fenix.packages.${system}.fromToolchainFile {
|
||||
file = ./rust-toolchain.toml;
|
||||
# When the file changes, this hash must be updated.
|
||||
sha256 = "sha256-Hn2uaQzRLidAWpfmRwSRdImifGUCAb9HeAqTYFXWeQk=";
|
||||
sha256 = "sha256-Qxt8XAuaUR2OMdKbN4u8dBJOhSHxS+uS06Wl9+flVEk=";
|
||||
};
|
||||
|
||||
# Nightly toolchain for rustfmt (pinned to current flake lock)
|
||||
# Note that the github CI uses "current nightly" for formatting, it 's not pinned.
|
||||
rustNightly = fenix.packages.${system}.latest.toolchain;
|
||||
rustNightlyFmt = fenix.packages.${system}.latest.rustfmt;
|
||||
rustNightly = fenix.packages.${system}.latest;
|
||||
|
||||
craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain;
|
||||
craneLibNightly = (crane.mkLib pkgs).overrideToolchain rustNightly;
|
||||
craneLibNightly = (crane.mkLib pkgs).overrideToolchain rustNightly.toolchain;
|
||||
|
||||
src = lib.fileset.toSource {
|
||||
root = ./.;
|
||||
@@ -97,11 +96,15 @@
|
||||
checks = self.checks.${system};
|
||||
|
||||
packages = with pkgs; [
|
||||
rustNightlyFmt
|
||||
cargo-tarpaulin
|
||||
cargo-watch
|
||||
sqlite
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
# Prepend nightly rustfmt to PATH.
|
||||
export PATH="${rustNightly.rustfmt}/bin:$PATH"
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
@@ -2049,7 +2049,7 @@ fn complete_msgbar(text: &EditRope, cursor: &mut Cursor, store: &ChatStore) -> V
|
||||
// Complete Emoji shortcodes.
|
||||
Some(':') => {
|
||||
let list = store.emojis.complete(&id[1..]);
|
||||
let iter = list.into_iter().take(200).map(|s| format!(":{}:", s));
|
||||
let iter = list.into_iter().take(200).map(|s| format!(":{s}:"));
|
||||
|
||||
return iter.collect();
|
||||
},
|
||||
@@ -2195,7 +2195,7 @@ pub mod tests {
|
||||
));
|
||||
|
||||
for i in 0..3 {
|
||||
let event_id = format!("$house_{}", i);
|
||||
let event_id = format!("$house_{i}");
|
||||
info.insert_reaction(MessageLikeEvent::Original(
|
||||
matrix_sdk::ruma::events::OriginalMessageLikeEvent {
|
||||
content: content.clone(),
|
||||
@@ -2214,7 +2214,7 @@ pub mod tests {
|
||||
));
|
||||
|
||||
for i in 0..2 {
|
||||
let event_id = format!("$smile_{}", i);
|
||||
let event_id = format!("$smile_{i}");
|
||||
info.insert_reaction(MessageLikeEvent::Original(
|
||||
matrix_sdk::ruma::events::OriginalMessageLikeEvent {
|
||||
content: content.clone(),
|
||||
@@ -2228,7 +2228,7 @@ pub mod tests {
|
||||
}
|
||||
|
||||
for i in 2..4 {
|
||||
let event_id = format!("$smile_{}", i);
|
||||
let event_id = format!("$smile_{i}");
|
||||
info.insert_reaction(MessageLikeEvent::Original(
|
||||
matrix_sdk::ruma::events::OriginalMessageLikeEvent {
|
||||
content: content.clone(),
|
||||
|
||||
@@ -932,10 +932,7 @@ impl ApplicationSettings {
|
||||
} else {
|
||||
loop {
|
||||
println!("\nNo profile specified. Available profiles:");
|
||||
profiles
|
||||
.keys()
|
||||
.enumerate()
|
||||
.for_each(|(i, name)| println!("{}: {}", i, name));
|
||||
profiles.keys().enumerate().for_each(|(i, name)| println!("{i}: {name}"));
|
||||
|
||||
print!("Select a number or 'q' to quit: ");
|
||||
let _ = std::io::stdout().flush();
|
||||
|
||||
@@ -121,11 +121,11 @@ pub fn body_cow_state(ev: &AnySyncStateEvent) -> Cow<'static, str> {
|
||||
|
||||
match (old_canon, new_canon) {
|
||||
(None, Some(canon)) => {
|
||||
format!("* updated the canonical alias for the room to: {}", canon)
|
||||
format!("* updated the canonical alias for the room to: {canon}")
|
||||
},
|
||||
(Some(old), Some(new)) => {
|
||||
if old != new {
|
||||
format!("* updated the canonical alias for the room to: {}", new)
|
||||
format!("* updated the canonical alias for the room to: {new}")
|
||||
} else {
|
||||
return Cow::Borrowed("* removed the canonical alias for the room");
|
||||
}
|
||||
@@ -187,10 +187,10 @@ pub fn body_cow_state(ev: &AnySyncStateEvent) -> Cow<'static, str> {
|
||||
|
||||
match change {
|
||||
MembershipChange::None => {
|
||||
format!("* did nothing to {}", state_key)
|
||||
format!("* did nothing to {state_key}")
|
||||
},
|
||||
MembershipChange::Error => {
|
||||
format!("* failed to calculate membership change to {}", state_key)
|
||||
format!("* failed to calculate membership change to {state_key}")
|
||||
},
|
||||
MembershipChange::Joined => {
|
||||
return Cow::Borrowed("* joined the room");
|
||||
@@ -199,19 +199,19 @@ pub fn body_cow_state(ev: &AnySyncStateEvent) -> Cow<'static, str> {
|
||||
return Cow::Borrowed("* left the room");
|
||||
},
|
||||
MembershipChange::Banned => {
|
||||
format!("* banned {} from the room", state_key)
|
||||
format!("* banned {state_key} from the room")
|
||||
},
|
||||
MembershipChange::Unbanned => {
|
||||
format!("* unbanned {} from the room", state_key)
|
||||
format!("* unbanned {state_key} from the room")
|
||||
},
|
||||
MembershipChange::Kicked => {
|
||||
format!("* kicked {} from the room", state_key)
|
||||
format!("* kicked {state_key} from the room")
|
||||
},
|
||||
MembershipChange::Invited => {
|
||||
format!("* invited {} to the room", state_key)
|
||||
format!("* invited {state_key} to the room")
|
||||
},
|
||||
MembershipChange::KickedAndBanned => {
|
||||
format!("* kicked and banned {} from the room", state_key)
|
||||
format!("* kicked and banned {state_key} from the room")
|
||||
},
|
||||
MembershipChange::InvitationAccepted => {
|
||||
return Cow::Borrowed("* accepted an invitation to join the room");
|
||||
@@ -220,26 +220,26 @@ pub fn body_cow_state(ev: &AnySyncStateEvent) -> Cow<'static, str> {
|
||||
return Cow::Borrowed("* rejected an invitation to join the room");
|
||||
},
|
||||
MembershipChange::InvitationRevoked => {
|
||||
format!("* revoked an invitation for {} to join the room", state_key)
|
||||
format!("* revoked an invitation for {state_key} to join the room")
|
||||
},
|
||||
MembershipChange::Knocked => {
|
||||
return Cow::Borrowed("* would like to join the room");
|
||||
},
|
||||
MembershipChange::KnockAccepted => {
|
||||
format!("* accepted the room knock from {}", state_key)
|
||||
format!("* accepted the room knock from {state_key}")
|
||||
},
|
||||
MembershipChange::KnockRetracted => {
|
||||
return Cow::Borrowed("* retracted their room knock");
|
||||
},
|
||||
MembershipChange::KnockDenied => {
|
||||
format!("* rejected the room knock from {}", state_key)
|
||||
format!("* rejected the room knock from {state_key}")
|
||||
},
|
||||
MembershipChange::ProfileChanged { displayname_change, avatar_url_change } => {
|
||||
match (displayname_change, avatar_url_change) {
|
||||
(Some(change), avatar_change) => {
|
||||
let mut m = match (change.old, change.new) {
|
||||
(None, Some(new)) => {
|
||||
format!("* set their display name to {:?}", new)
|
||||
format!("* set their display name to {new:?}")
|
||||
},
|
||||
(Some(old), Some(new)) => {
|
||||
format!("* changed their display name from {old} to {new}")
|
||||
@@ -280,7 +280,7 @@ pub fn body_cow_state(ev: &AnySyncStateEvent) -> Cow<'static, str> {
|
||||
}
|
||||
},
|
||||
ev => {
|
||||
format!("* made an unknown membership change to {}: {:?}", state_key, ev)
|
||||
format!("* made an unknown membership change to {state_key}: {ev:?}")
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -727,7 +727,7 @@ pub fn html_state(ev: &AnySyncStateEvent) -> StyleTree {
|
||||
ev => {
|
||||
let prefix =
|
||||
StyleTreeNode::Text("* made an unknown membership change to ".into());
|
||||
let suffix = StyleTreeNode::Text(format!(": {:?}", ev).into());
|
||||
let suffix = StyleTreeNode::Text(format!(": {ev:?}").into());
|
||||
vec![prefix, user_id, suffix]
|
||||
},
|
||||
}
|
||||
|
||||
@@ -273,9 +273,9 @@ impl ChatState {
|
||||
let mut filename_incr = filename.clone();
|
||||
for n in 1..=1000 {
|
||||
if let Some(ext) = ext.and_then(OsStr::to_str) {
|
||||
filename_incr.set_file_name(format!("{}-{}.{}", stem, n, ext));
|
||||
filename_incr.set_file_name(format!("{stem}-{n}.{ext}"));
|
||||
} else {
|
||||
filename_incr.set_file_name(format!("{}-{}", stem, n));
|
||||
filename_incr.set_file_name(format!("{stem}-{n}"));
|
||||
}
|
||||
|
||||
if !filename_incr.exists() {
|
||||
@@ -401,7 +401,7 @@ impl ChatState {
|
||||
};
|
||||
|
||||
if info.user_reactions_contains(&settings.profile.user_id, &event_id, &emoji) {
|
||||
let msg = format!("You’ve already reacted to this message with {}", emoji);
|
||||
let msg = format!("You’ve already reacted to this message with {emoji}");
|
||||
let err = UIError::Failure(msg);
|
||||
|
||||
return Err(err);
|
||||
|
||||
@@ -120,19 +120,19 @@ fn hist_visibility_mode(name: impl Into<String>) -> IambResult<HistoryVisibility
|
||||
/// that operations like sending and accepting invites, opening the members window, etc., all work
|
||||
/// similarly.
|
||||
pub enum RoomState {
|
||||
Chat(ChatState),
|
||||
Space(SpaceState),
|
||||
Chat(Box<ChatState>),
|
||||
Space(Box<SpaceState>),
|
||||
}
|
||||
|
||||
impl From<ChatState> for RoomState {
|
||||
fn from(chat: ChatState) -> Self {
|
||||
RoomState::Chat(chat)
|
||||
RoomState::Chat(Box::new(chat))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<SpaceState> for RoomState {
|
||||
fn from(space: SpaceState) -> Self {
|
||||
RoomState::Space(space)
|
||||
RoomState::Space(Box::new(space))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -776,8 +776,8 @@ impl WindowOps<IambInfo> for RoomState {
|
||||
|
||||
fn dup(&self, store: &mut ProgramStore) -> Self {
|
||||
match self {
|
||||
RoomState::Chat(chat) => RoomState::Chat(chat.dup(store)),
|
||||
RoomState::Space(space) => RoomState::Space(space.dup(store)),
|
||||
RoomState::Chat(chat) => RoomState::Chat(Box::new(chat.dup(store))),
|
||||
RoomState::Space(space) => RoomState::Space(Box::new(space.dup(store))),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user