chore: Prepare for Rust edition bump to 2024 (without autofix) (#27791)

Successor to #27779 - in this PR I've applied changes manually, without
futzing with if let lifetimes at all.

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-03-31 20:10:36 +02:00 committed by GitHub
parent d51aa2ffb0
commit 0729d24d77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
162 changed files with 2333 additions and 1937 deletions

View file

@ -1561,10 +1561,10 @@ impl Buffer {
self.subscriptions.subscribe()
}
pub fn wait_for_edits(
pub fn wait_for_edits<It: IntoIterator<Item = clock::Lamport>>(
&mut self,
edit_ids: impl IntoIterator<Item = clock::Lamport>,
) -> impl 'static + Future<Output = Result<()>> {
edit_ids: It,
) -> impl 'static + Future<Output = Result<()>> + use<It> {
let mut futures = Vec::new();
for edit_id in edit_ids {
if !self.version.observed(edit_id) {
@ -1584,10 +1584,10 @@ impl Buffer {
}
}
pub fn wait_for_anchors(
pub fn wait_for_anchors<It: IntoIterator<Item = Anchor>>(
&mut self,
anchors: impl IntoIterator<Item = Anchor>,
) -> impl 'static + Future<Output = Result<()>> {
anchors: It,
) -> impl 'static + Future<Output = Result<()>> + use<It> {
let mut futures = Vec::new();
for anchor in anchors {
if !self.version.observed(anchor.timestamp)
@ -1613,7 +1613,10 @@ impl Buffer {
}
}
pub fn wait_for_version(&mut self, version: clock::Global) -> impl Future<Output = Result<()>> {
pub fn wait_for_version(
&mut self,
version: clock::Global,
) -> impl Future<Output = Result<()>> + use<> {
let mut rx = None;
if !self.snapshot.version.observed_all(&version) {
let channel = oneshot::channel();