1 Commits

Author SHA1 Message Date
Ulyssa
b5d356e741 Bump MSRV to 1.89 2025-10-26 07:41:37 -07:00
11 changed files with 929 additions and 1150 deletions

1996
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
[package]
name = "iamb"
version = "0.0.11"
version = "0.0.11-alpha.1"
edition = "2018"
authors = ["Ulyssa <git@ulyssa.dev>"]
repository = "https://github.com/ulyssa/iamb"
@@ -11,7 +11,7 @@ license = "Apache-2.0"
exclude = [".github", "CONTRIBUTING.md"]
keywords = ["matrix", "chat", "tui", "vim"]
categories = ["command-line-utilities"]
rust-version = "1.88"
rust-version = "1.89"
build = "build.rs"
[features]

View File

@@ -62,7 +62,7 @@ cargo install --locked --path .
## Installation (via `crates.io`)
Install Rust (1.83.0 or above) and Cargo, and then run:
Install Rust (1.89.0 or above) and Cargo, and then run:
```
cargo install --locked iamb

View File

@@ -7,7 +7,6 @@
<url type="homepage">https://iamb.chat</url>
<releases>
<release version="0.0.11" date="2026-01-19"/>
<release version="0.0.10" date="2024-08-20"/>
<release version="0.0.9" date="2024-03-28"/>
</releases>

View File

@@ -30,15 +30,16 @@
rustToolchain = fenix.packages.${system}.fromToolchainFile {
file = ./rust-toolchain.toml;
# When the file changes, this hash must be updated.
sha256 = "sha256-Qxt8XAuaUR2OMdKbN4u8dBJOhSHxS+uS06Wl9+flVEk=";
sha256 = "sha256-Hn2uaQzRLidAWpfmRwSRdImifGUCAb9HeAqTYFXWeQk=";
};
# 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;
rustNightly = fenix.packages.${system}.latest.toolchain;
rustNightlyFmt = fenix.packages.${system}.latest.rustfmt;
craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain;
craneLibNightly = (crane.mkLib pkgs).overrideToolchain rustNightly.toolchain;
craneLibNightly = (crane.mkLib pkgs).overrideToolchain rustNightly;
src = lib.fileset.toSource {
root = ./.;
@@ -96,15 +97,11 @@
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"
'';
};
}
);

View File

@@ -1,3 +1,3 @@
[toolchain]
channel = "1.88"
channel = "1.89"
components = [ "clippy" ]

View File

@@ -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(),

View File

@@ -932,7 +932,10 @@ 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();

View File

@@ -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 {state_key} from the room")
format!("* banned {} from the room", state_key)
},
MembershipChange::Unbanned => {
format!("* unbanned {state_key} from the room")
format!("* unbanned {} from the room", state_key)
},
MembershipChange::Kicked => {
format!("* kicked {state_key} from the room")
format!("* kicked {} from the room", state_key)
},
MembershipChange::Invited => {
format!("* invited {state_key} to the room")
format!("* invited {} to the room", state_key)
},
MembershipChange::KickedAndBanned => {
format!("* kicked and banned {state_key} from the room")
format!("* kicked and banned {} from the room", state_key)
},
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 {state_key} to join the room")
format!("* revoked an invitation for {} to join the room", state_key)
},
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]
},
}

View File

@@ -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!("Youve already reacted to this message with {emoji}");
let msg = format!("Youve already reacted to this message with {}", emoji);
let err = UIError::Failure(msg);
return Err(err);

View File

@@ -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(Box<ChatState>),
Space(Box<SpaceState>),
Chat(ChatState),
Space(SpaceState),
}
impl From<ChatState> for RoomState {
fn from(chat: ChatState) -> Self {
RoomState::Chat(Box::new(chat))
RoomState::Chat(chat)
}
}
impl From<SpaceState> for RoomState {
fn from(space: SpaceState) -> Self {
RoomState::Space(Box::new(space))
RoomState::Space(space)
}
}
@@ -776,8 +776,8 @@ impl WindowOps<IambInfo> for RoomState {
fn dup(&self, store: &mut ProgramStore) -> Self {
match self {
RoomState::Chat(chat) => RoomState::Chat(Box::new(chat.dup(store))),
RoomState::Space(space) => RoomState::Space(Box::new(space.dup(store))),
RoomState::Chat(chat) => RoomState::Chat(chat.dup(store)),
RoomState::Space(space) => RoomState::Space(space.dup(store)),
}
}