chore: Fix warnings for Rust 1.89 (#32378)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-06-09 13:11:57 +02:00 committed by GitHub
parent 4ff41ba62e
commit 72bcb0beb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 102 additions and 95 deletions

View file

@ -64,7 +64,7 @@ pub struct AppCell {
impl AppCell {
#[doc(hidden)]
#[track_caller]
pub fn borrow(&self) -> AppRef {
pub fn borrow(&self) -> AppRef<'_> {
if option_env!("TRACK_THREAD_BORROWS").is_some() {
let thread_id = std::thread::current().id();
eprintln!("borrowed {thread_id:?}");
@ -74,7 +74,7 @@ impl AppCell {
#[doc(hidden)]
#[track_caller]
pub fn borrow_mut(&self) -> AppRefMut {
pub fn borrow_mut(&self) -> AppRefMut<'_> {
if option_env!("TRACK_THREAD_BORROWS").is_some() {
let thread_id = std::thread::current().id();
eprintln!("borrowed {thread_id:?}");
@ -84,7 +84,7 @@ impl AppCell {
#[doc(hidden)]
#[track_caller]
pub fn try_borrow_mut(&self) -> Result<AppRefMut, BorrowMutError> {
pub fn try_borrow_mut(&self) -> Result<AppRefMut<'_>, BorrowMutError> {
if option_env!("TRACK_THREAD_BORROWS").is_some() {
let thread_id = std::thread::current().id();
eprintln!("borrowed {thread_id:?}");

View file

@ -718,7 +718,7 @@ impl<T> ops::Index<usize> for AtlasTextureList<T> {
impl<T> AtlasTextureList<T> {
#[allow(unused)]
fn drain(&mut self) -> std::vec::Drain<Option<T>> {
fn drain(&mut self) -> std::vec::Drain<'_, Option<T>> {
self.free_list.clear();
self.textures.drain(..)
}

View file

@ -25,7 +25,7 @@ pub(crate) const ESCAPE_KEY: u16 = 0x1b;
const TAB_KEY: u16 = 0x09;
const SHIFT_TAB_KEY: u16 = 0x19;
pub fn key_to_native(key: &str) -> Cow<str> {
pub fn key_to_native(key: &str) -> Cow<'_, str> {
use cocoa::appkit::*;
let code = match key {
"space" => SPACE_KEY,

View file

@ -149,7 +149,7 @@ impl Scene {
),
allow(dead_code)
)]
pub(crate) fn batches(&self) -> impl Iterator<Item = PrimitiveBatch> {
pub(crate) fn batches(&self) -> impl Iterator<Item = PrimitiveBatch<'_>> {
BatchIterator {
shadows: &self.shadows,
shadows_start: 0,

View file

@ -616,7 +616,7 @@ impl Hash for (dyn AsCacheKeyRef + '_) {
}
impl AsCacheKeyRef for CacheKey {
fn as_cache_key_ref(&self) -> CacheKeyRef {
fn as_cache_key_ref(&self) -> CacheKeyRef<'_> {
CacheKeyRef {
text: &self.text,
font_size: self.font_size,
@ -645,7 +645,7 @@ impl<'a> Borrow<dyn AsCacheKeyRef + 'a> for Arc<CacheKey> {
}
impl AsCacheKeyRef for CacheKeyRef<'_> {
fn as_cache_key_ref(&self) -> CacheKeyRef {
fn as_cache_key_ref(&self) -> CacheKeyRef<'_> {
*self
}
}