Rust 1.95: rust-toolchain.toml, the workspace rust-version and the gateway image; the lints 1.95 adds

gpui-kit (every gpui-pre 0.3.x) calls std::hint::cold_path, stable since
1.95.0, so the client moves from 1.94 to 1.95 before the GPUI front end
can build (docs/design/gpui-spikes.md, "Rust 1.95 or newer"). rustc 1.95.0
(59807616e 2026-04-14), cargo 1.95.0, clippy and rustfmt of the same
release were used.

rust-toolchain.toml and the workspace's rust-version say 1.95;
crates/voelin-gateway/Dockerfile builds from rust:1.95-bookworm (cargo
refuses a 1.94 image once rust-version is 1.95). docs/building.md names
the Rust version for a local build; docs/ci.md says a channel change in
rust-toolchain.toml is all the runner needs (they named no version
before).

Clippy of 1.95 adds `collapsible_match` for an `if` that is a match arm's
only statement, `unnecessary_sort_by` and `manual_checked_ops`; they
flagged seven spots in four crates, none a behaviour change:
- voelin-media capture::forward: a let-else instead of a match whose arm
  holds one `if`;
- voelin-media ffmpeg::sys: `sort_by_key` with `Reverse` (two places);
- voelin-media studio:📷 `checked_div` for the frame interval;
- voelin-stream peer and session: the condition in a local before the
  `if` (a guard would carry a side effect: `remove`);
- voelinctl engine and session: the same.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Sonnet 5.5 committed 2026-10-27 06:00:40 +03:00
1 parent 296664ffa9
commit 5ce5c0db82
13 files changed
+35 -21

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@
# -e TSGW_QUERY_PASSWORD=… -p 7788:7788 tsgw
# Logs: docker logs -f tsgw (more: -e TSGW_LOG_LEVEL=debug; also to a file in
# the volume: -e TSGW_LOG_FILE=logs/tsgw.log). See docs/gateway-admin.md.
FROM rust:1.94-bookworm AS build
FROM rust:1.95-bookworm AS build
WORKDIR /src
RUN apt-get update && apt-get install -y --no-install-recommends cmake git libasound2-dev openssh-client && rm -rf /var/lib/apt/lists/*
# voelin-identity comes from the private VoelinProtocol repository, fetched
+7 -7
View File
@@ -279,14 +279,14 @@ impl FrameSink for QueueSink {
pub fn forward(mut frames: FrameReceiver<VideoFrame>, mut sink: Box<dyn FrameSink>) -> Result<()> {
std::thread::Builder::new().name("voelin-capture-forward".into()).spawn(move || {
loop {
match frames.recv_timeout(Duration::from_millis(100)) {
Some(frame) => {
if sink.wants(frame.timestamp) && !sink.frame(frame.view()) {
break;
}
let Some(frame) = frames.recv_timeout(Duration::from_millis(100)) else {
if frames.is_closed() {
break;
}
None if frames.is_closed() => break,
None => {}
continue;
};
if sink.wants(frame.timestamp) && !sink.frame(frame.view()) {
break;
}
}
})?;
+2 -2
View File
@@ -446,7 +446,7 @@ fn files_in(dir: &Path, base: &str) -> Vec<PathBuf> {
matches.then(|| (major_of(&name).unwrap_or(0), e.path()))
})
.collect();
found.sort_by(|a, b| b.0.cmp(&a.0));
found.sort_by_key(|entry| std::cmp::Reverse(entry.0));
found.into_iter().map(|(_, p)| p).collect()
}
@@ -466,7 +466,7 @@ fn ldconfig(base: &str) -> Vec<PathBuf> {
name.starts_with(&prefix).then(|| (major_of(name).unwrap_or(0), PathBuf::from(path)))
})
.collect();
found.sort_by(|a, b| b.0.cmp(&a.0));
found.sort_by_key(|entry| std::cmp::Reverse(entry.0));
found.into_iter().map(|(_, p)| p).collect()
}
+2 -2
View File
@@ -603,8 +603,8 @@ mod v4l2 {
// Seconds per frame; a stepwise range starts with its smallest
// interval, which is the highest rate.
let (num, den) = (entry.interval[0], entry.interval[1]);
if num > 0 {
best = best.max(den / num);
if let Some(rate) = den.checked_div(num) {
best = best.max(rate);
}
if entry.type_ != FRMIVAL_DISCRETE {
break;
+2 -1
View File
@@ -1075,7 +1075,8 @@ impl Task {
}
Event::IceConnectionStateChange(IceConnectionState::Disconnected) => return false,
Event::MediaAdded(m) => {
if !self.mids.iter().any(|(mid, _)| *mid == m.mid) {
let known = self.mids.iter().any(|(mid, _)| *mid == m.mid);
if !known {
self.mids.push((m.mid, m.kind));
}
}
+2 -1
View File
@@ -801,7 +801,8 @@ impl StreamerSession {
}
StreamNotification::JoinRequest { viewer, remove: true, .. }
| StreamNotification::ViewerLeft { viewer, .. } => {
if self.viewers.remove(&viewer.0).is_some() {
let was_viewer = self.viewers.remove(&viewer.0).is_some();
if was_viewer {
self.emit_viewers(out);
self.update_targets(out);
}