Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
chore: Fix warnings for Rust 1.89 (#32378)
Piotr Osiewicz72bcb0beb7bb
diff --git a/crates/agent/src/thread_store.rs b/crates/agent/src/thread_store.rsindex 9ad2d37446c..a86fcda072f 100644--- a/crates/agent/src/thread_store.rs+++ b/crates/agent/src/thread_store.rs@@ -89,7 +89,7 @@ pub fn init(cx: &mut App) {pub struct SharedProjectContext(Rc<RefCell<Option<ProjectContext>>>);impl SharedProjectContext {- pub fn borrow(&self) -> Ref<Option<ProjectContext>> {+ pub fn borrow(&self) -> Ref<'_, Option<ProjectContext>> {self.0.borrow()}}@@ -919,7 +919,7 @@ impl ThreadsDatabase {fn bytes_encode(item: &Self::EItem,- ) -> Result<std::borrow::Cow<[u8]>, heed::BoxedError> {+ ) -> Result<std::borrow::Cow<'_, [u8]>, heed::BoxedError> {serde_json::to_vec(&item.0).map(std::borrow::Cow::Owned).map_err(Into::into)diff --git a/crates/channel/src/channel_store.rs b/crates/channel/src/channel_store.rsindex b7162998cc0..a73734cd49d 100644--- a/crates/channel/src/channel_store.rs+++ b/crates/channel/src/channel_store.rs@@ -111,7 +111,7 @@ pub struct ChannelMembership {pub role: proto::ChannelRole,}impl ChannelMembership {- pub fn sort_key(&self) -> MembershipSortKey {+ pub fn sort_key(&self) -> MembershipSortKey<'_> {MembershipSortKey {role_order: match self.role {proto::ChannelRole::Admin => 0,diff --git a/crates/channel/src/channel_store/channel_index.rs b/crates/channel/src/channel_store/channel_index.rsindex 8eb633e25f9..749160f956d 100644--- a/crates/channel/src/channel_store/channel_index.rs+++ b/crates/channel/src/channel_store/channel_index.rs@@ -32,7 +32,7 @@ impl ChannelIndex {.retain(|channel_id| !channels.contains(channel_id));}- pub fn bulk_insert(&mut self) -> ChannelPathsInsertGuard {+ pub fn bulk_insert(&mut self) -> ChannelPathsInsertGuard<'_> {ChannelPathsInsertGuard {channels_ordered: &mut self.channels_ordered,channels_by_id: &mut self.channels_by_id,diff --git a/crates/client/src/proxy.rs b/crates/client/src/proxy.rsindex ef87fa1a9b3..eb3812ca072 100644--- a/crates/client/src/proxy.rs+++ b/crates/client/src/proxy.rs@@ -39,7 +39,7 @@ enum ProxyType<'t> {HttpProxy(HttpProxyType<'t>),}-fn parse_proxy_type(proxy: &Url) -> Option<((String, u16), ProxyType)> {+fn parse_proxy_type(proxy: &Url) -> Option<((String, u16), ProxyType<'_>)> {let scheme = proxy.scheme();let host = proxy.host()?.to_string();let port = proxy.port_or_known_default()?;diff --git a/crates/editor/src/display_map/block_map.rs b/crates/editor/src/display_map/block_map.rsindex 8214ab7a8c0..ea754da03f7 100644--- a/crates/editor/src/display_map/block_map.rs+++ b/crates/editor/src/display_map/block_map.rs@@ -464,7 +464,7 @@ impl BlockMap {map}- pub fn read(&self, wrap_snapshot: WrapSnapshot, edits: Patch<u32>) -> BlockMapReader {+ pub fn read(&self, wrap_snapshot: WrapSnapshot, edits: Patch<u32>) -> BlockMapReader<'_> {self.sync(&wrap_snapshot, edits);*self.wrap_snapshot.borrow_mut() = wrap_snapshot.clone();BlockMapReader {@@ -479,7 +479,7 @@ impl BlockMap {}}- pub fn write(&mut self, wrap_snapshot: WrapSnapshot, edits: Patch<u32>) -> BlockMapWriter {+ pub fn write(&mut self, wrap_snapshot: WrapSnapshot, edits: Patch<u32>) -> BlockMapWriter<'_> {self.sync(&wrap_snapshot, edits);*self.wrap_snapshot.borrow_mut() = wrap_snapshot;BlockMapWriter(self)@@ -1327,7 +1327,7 @@ impl BlockSnapshot {}}- pub(super) fn row_infos(&self, start_row: BlockRow) -> BlockRows {+ pub(super) fn row_infos(&self, start_row: BlockRow) -> BlockRows<'_> {let mut cursor = self.transforms.cursor::<(BlockRow, WrapRow)>(&());cursor.seek(&start_row, Bias::Right, &());let (output_start, input_start) = cursor.start();diff --git a/crates/editor/src/display_map/fold_map.rs b/crates/editor/src/display_map/fold_map.rsindex 0011f07feab..92456836a97 100644--- a/crates/editor/src/display_map/fold_map.rs+++ b/crates/editor/src/display_map/fold_map.rs@@ -357,7 +357,7 @@ impl FoldMap {&mut self,inlay_snapshot: InlaySnapshot,edits: Vec<InlayEdit>,- ) -> (FoldMapWriter, FoldSnapshot, Vec<FoldEdit>) {+ ) -> (FoldMapWriter<'_>, FoldSnapshot, Vec<FoldEdit>) {let (snapshot, edits) = self.read(inlay_snapshot, edits);(FoldMapWriter(self), snapshot, edits)}@@ -730,7 +730,7 @@ impl FoldSnapshot {(line_end - line_start) as u32}- pub fn row_infos(&self, start_row: u32) -> FoldRows {+ pub fn row_infos(&self, start_row: u32) -> FoldRows<'_> {if start_row > self.transforms.summary().output.lines.row {panic!("invalid display row {}", start_row);}diff --git a/crates/editor/src/display_map/wrap_map.rs b/crates/editor/src/display_map/wrap_map.rsindex fd662dbb1f3..a29bf538827 100644--- a/crates/editor/src/display_map/wrap_map.rs+++ b/crates/editor/src/display_map/wrap_map.rs@@ -726,7 +726,7 @@ impl WrapSnapshot {self.transforms.summary().output.longest_row}- pub fn row_infos(&self, start_row: u32) -> WrapRows {+ pub fn row_infos(&self, start_row: u32) -> WrapRows<'_> {let mut transforms = self.transforms.cursor::<(WrapPoint, TabPoint)>(&());transforms.seek(&WrapPoint::new(start_row, 0), Bias::Left, &());let mut input_row = transforms.start().1.row();diff --git a/crates/editor/src/selections_collection.rs b/crates/editor/src/selections_collection.rsindex cec720f9d6d..da5fbe41ef8 100644--- a/crates/editor/src/selections_collection.rs+++ b/crates/editor/src/selections_collection.rs@@ -411,7 +411,7 @@ impl<'a> MutableSelectionsCollection<'a> {self.collection.display_map(self.cx)}- pub fn buffer(&self) -> Ref<MultiBufferSnapshot> {+ pub fn buffer(&self) -> Ref<'_, MultiBufferSnapshot> {self.collection.buffer(self.cx)}diff --git a/crates/extension_host/src/wasm_host.rs b/crates/extension_host/src/wasm_host.rsindex b31e9f1509e..5d2c2f9b95f 100644--- a/crates/extension_host/src/wasm_host.rs+++ b/crates/extension_host/src/wasm_host.rs@@ -724,7 +724,7 @@ impl IncrementalCompilationCache {}impl CacheStore for IncrementalCompilationCache {- fn get(&self, key: &[u8]) -> Option<Cow<[u8]>> {+ fn get(&self, key: &[u8]) -> Option<Cow<'_, [u8]>> {self.cache.get(key).map(|v| v.into())}diff --git a/crates/git/src/repository.rs b/crates/git/src/repository.rsindex fbde692fdb5..165497d1296 100644--- a/crates/git/src/repository.rs+++ b/crates/git/src/repository.rs@@ -323,7 +323,7 @@ pub trait GitRepository: Send + Sync {/// Resolve a list of refs to SHAs.fn revparse_batch(&self, revs: Vec<String>) -> BoxFuture<Result<Vec<Option<String>>>>;- fn head_sha(&self) -> BoxFuture<Option<String>> {+ fn head_sha(&self) -> BoxFuture<'_, Option<String>> {async move {self.revparse_batch(vec!["HEAD".into()]).await@@ -525,7 +525,7 @@ impl GitRepository for RealGitRepository {repo.commondir().into()}- fn show(&self, commit: String) -> BoxFuture<Result<CommitDetails>> {+ fn show(&self, commit: String) -> BoxFuture<'_, Result<CommitDetails>> {let working_directory = self.working_directory();self.executor.spawn(async move {@@ -561,7 +561,7 @@ impl GitRepository for RealGitRepository {.boxed()}- fn load_commit(&self, commit: String, cx: AsyncApp) -> BoxFuture<Result<CommitDiff>> {+ fn load_commit(&self, commit: String, cx: AsyncApp) -> BoxFuture<'_, Result<CommitDiff>> {let Some(working_directory) = self.repository.lock().workdir().map(ToOwned::to_owned)else {return future::ready(Err(anyhow!("no working directory"))).boxed();@@ -668,7 +668,7 @@ impl GitRepository for RealGitRepository {commit: String,mode: ResetMode,env: Arc<HashMap<String, String>>,- ) -> BoxFuture<Result<()>> {+ ) -> BoxFuture<'_, Result<()>> {async move {let working_directory = self.working_directory();@@ -698,7 +698,7 @@ impl GitRepository for RealGitRepository {commit: String,paths: Vec<RepoPath>,env: Arc<HashMap<String, String>>,- ) -> BoxFuture<Result<()>> {+ ) -> BoxFuture<'_, Result<()>> {let working_directory = self.working_directory();let git_binary_path = self.git_binary_path.clone();async move {@@ -723,7 +723,7 @@ impl GitRepository for RealGitRepository {.boxed()}- fn load_index_text(&self, path: RepoPath) -> BoxFuture<Option<String>> {+ fn load_index_text(&self, path: RepoPath) -> BoxFuture<'_, Option<String>> {// https://git-scm.com/book/en/v2/Git-Internals-Git-Objectsconst GIT_MODE_SYMLINK: u32 = 0o120000;@@ -756,7 +756,7 @@ impl GitRepository for RealGitRepository {.boxed()}- fn load_committed_text(&self, path: RepoPath) -> BoxFuture<Option<String>> {+ fn load_committed_text(&self, path: RepoPath) -> BoxFuture<'_, Option<String>> {let repo = self.repository.clone();self.executor.spawn(async move {@@ -777,7 +777,7 @@ impl GitRepository for RealGitRepository {path: RepoPath,content: Option<String>,env: Arc<HashMap<String, String>>,- ) -> BoxFuture<anyhow::Result<()>> {+ ) -> BoxFuture<'_, anyhow::Result<()>> {let working_directory = self.working_directory();let git_binary_path = self.git_binary_path.clone();self.executor@@ -841,7 +841,7 @@ impl GitRepository for RealGitRepository {remote.url().map(|url| url.to_string())}- fn revparse_batch(&self, revs: Vec<String>) -> BoxFuture<Result<Vec<Option<String>>>> {+ fn revparse_batch(&self, revs: Vec<String>) -> BoxFuture<'_, Result<Vec<Option<String>>>> {let working_directory = self.working_directory();self.executor.spawn(async move {@@ -891,14 +891,14 @@ impl GitRepository for RealGitRepository {.boxed()}- fn merge_message(&self) -> BoxFuture<Option<String>> {+ fn merge_message(&self) -> BoxFuture<'_, Option<String>> {let path = self.path().join("MERGE_MSG");self.executor.spawn(async move { std::fs::read_to_string(&path).ok() }).boxed()}- fn status(&self, path_prefixes: &[RepoPath]) -> BoxFuture<Result<GitStatus>> {+ fn status(&self, path_prefixes: &[RepoPath]) -> BoxFuture<'_, Result<GitStatus>> {let git_binary_path = self.git_binary_path.clone();let working_directory = self.working_directory();let path_prefixes = path_prefixes.to_owned();@@ -919,7 +919,7 @@ impl GitRepository for RealGitRepository {.boxed()}- fn branches(&self) -> BoxFuture<Result<Vec<Branch>>> {+ fn branches(&self) -> BoxFuture<'_, Result<Vec<Branch>>> {let working_directory = self.working_directory();let git_binary_path = self.git_binary_path.clone();self.executor@@ -986,7 +986,7 @@ impl GitRepository for RealGitRepository {.boxed()}- fn change_branch(&self, name: String) -> BoxFuture<Result<()>> {+ fn change_branch(&self, name: String) -> BoxFuture<'_, Result<()>> {let repo = self.repository.clone();self.executor.spawn(async move {@@ -1018,7 +1018,7 @@ impl GitRepository for RealGitRepository {.boxed()}- fn create_branch(&self, name: String) -> BoxFuture<Result<()>> {+ fn create_branch(&self, name: String) -> BoxFuture<'_, Result<()>> {let repo = self.repository.clone();self.executor.spawn(async move {@@ -1030,7 +1030,7 @@ impl GitRepository for RealGitRepository {.boxed()}- fn blame(&self, path: RepoPath, content: Rope) -> BoxFuture<Result<crate::blame::Blame>> {+ fn blame(&self, path: RepoPath, content: Rope) -> BoxFuture<'_, Result<crate::blame::Blame>> {let working_directory = self.working_directory();let git_binary_path = self.git_binary_path.clone();@@ -1052,7 +1052,7 @@ impl GitRepository for RealGitRepository {.boxed()}- fn diff(&self, diff: DiffType) -> BoxFuture<Result<String>> {+ fn diff(&self, diff: DiffType) -> BoxFuture<'_, Result<String>> {let working_directory = self.working_directory();let git_binary_path = self.git_binary_path.clone();self.executor@@ -1083,7 +1083,7 @@ impl GitRepository for RealGitRepository {&self,paths: Vec<RepoPath>,env: Arc<HashMap<String, String>>,- ) -> BoxFuture<Result<()>> {+ ) -> BoxFuture<'_, Result<()>> {let working_directory = self.working_directory();let git_binary_path = self.git_binary_path.clone();self.executor@@ -1111,7 +1111,7 @@ impl GitRepository for RealGitRepository {&self,paths: Vec<RepoPath>,env: Arc<HashMap<String, String>>,- ) -> BoxFuture<Result<()>> {+ ) -> BoxFuture<'_, Result<()>> {let working_directory = self.working_directory();let git_binary_path = self.git_binary_path.clone();@@ -1143,7 +1143,7 @@ impl GitRepository for RealGitRepository {name_and_email: Option<(SharedString, SharedString)>,options: CommitOptions,env: Arc<HashMap<String, String>>,- ) -> BoxFuture<Result<()>> {+ ) -> BoxFuture<'_, Result<()>> {let working_directory = self.working_directory();self.executor.spawn(async move {@@ -1182,7 +1182,7 @@ impl GitRepository for RealGitRepository {ask_pass: AskPassDelegate,env: Arc<HashMap<String, String>>,cx: AsyncApp,- ) -> BoxFuture<Result<RemoteCommandOutput>> {+ ) -> BoxFuture<'_, Result<RemoteCommandOutput>> {let working_directory = self.working_directory();let executor = cx.background_executor().clone();async move {@@ -1214,7 +1214,7 @@ impl GitRepository for RealGitRepository {ask_pass: AskPassDelegate,env: Arc<HashMap<String, String>>,cx: AsyncApp,- ) -> BoxFuture<Result<RemoteCommandOutput>> {+ ) -> BoxFuture<'_, Result<RemoteCommandOutput>> {let working_directory = self.working_directory();let executor = cx.background_executor().clone();async move {@@ -1239,7 +1239,7 @@ impl GitRepository for RealGitRepository {ask_pass: AskPassDelegate,env: Arc<HashMap<String, String>>,cx: AsyncApp,- ) -> BoxFuture<Result<RemoteCommandOutput>> {+ ) -> BoxFuture<'_, Result<RemoteCommandOutput>> {let working_directory = self.working_directory();let remote_name = format!("{}", fetch_options);let executor = cx.background_executor().clone();@@ -1257,7 +1257,7 @@ impl GitRepository for RealGitRepository {.boxed()}- fn get_remotes(&self, branch_name: Option<String>) -> BoxFuture<Result<Vec<Remote>>> {+ fn get_remotes(&self, branch_name: Option<String>) -> BoxFuture<'_, Result<Vec<Remote>>> {let working_directory = self.working_directory();let git_binary_path = self.git_binary_path.clone();self.executor@@ -1303,7 +1303,7 @@ impl GitRepository for RealGitRepository {.boxed()}- fn check_for_pushed_commit(&self) -> BoxFuture<Result<Vec<SharedString>>> {+ fn check_for_pushed_commit(&self) -> BoxFuture<'_, Result<Vec<SharedString>>> {let working_directory = self.working_directory();let git_binary_path = self.git_binary_path.clone();self.executor@@ -1396,7 +1396,7 @@ impl GitRepository for RealGitRepository {.boxed()}- fn restore_checkpoint(&self, checkpoint: GitRepositoryCheckpoint) -> BoxFuture<Result<()>> {+ fn restore_checkpoint(&self, checkpoint: GitRepositoryCheckpoint) -> BoxFuture<'_, Result<()>> {let working_directory = self.working_directory();let git_binary_path = self.git_binary_path.clone();@@ -1435,7 +1435,7 @@ impl GitRepository for RealGitRepository {&self,left: GitRepositoryCheckpoint,right: GitRepositoryCheckpoint,- ) -> BoxFuture<Result<bool>> {+ ) -> BoxFuture<'_, Result<bool>> {let working_directory = self.working_directory();let git_binary_path = self.git_binary_path.clone();@@ -1474,7 +1474,7 @@ impl GitRepository for RealGitRepository {&self,base_checkpoint: GitRepositoryCheckpoint,target_checkpoint: GitRepositoryCheckpoint,- ) -> BoxFuture<Result<String>> {+ ) -> BoxFuture<'_, Result<String>> {let working_directory = self.working_directory();let git_binary_path = self.git_binary_path.clone();diff --git a/crates/gpui/src/app.rs b/crates/gpui/src/app.rsindex e6d5fb9e48e..6c8b48873dd 100644--- a/crates/gpui/src/app.rs+++ b/crates/gpui/src/app.rs@@ -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:?}");diff --git a/crates/gpui/src/platform.rs b/crates/gpui/src/platform.rsindex 9305a87819c..4d7770b4a43 100644--- a/crates/gpui/src/platform.rs+++ b/crates/gpui/src/platform.rs@@ -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(..)}diff --git a/crates/gpui/src/platform/mac/events.rs b/crates/gpui/src/platform/mac/events.rsindex b90e8f10dc2..32ec4b89ab9 100644--- a/crates/gpui/src/platform/mac/events.rs+++ b/crates/gpui/src/platform/mac/events.rs@@ -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,diff --git a/crates/gpui/src/scene.rs b/crates/gpui/src/scene.rsindex 806054cefc3..4eaef64afa1 100644--- a/crates/gpui/src/scene.rs+++ b/crates/gpui/src/scene.rs@@ -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,diff --git a/crates/gpui/src/text_system/line_layout.rs b/crates/gpui/src/text_system/line_layout.rsindex e683bac7bdc..5e5c2eff1e0 100644--- a/crates/gpui/src/text_system/line_layout.rs+++ b/crates/gpui/src/text_system/line_layout.rs@@ -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}}diff --git a/crates/language/src/buffer.rs b/crates/language/src/buffer.rsindex 4fea6236ed7..0f43ff5c98c 100644--- a/crates/language/src/buffer.rs+++ b/crates/language/src/buffer.rs@@ -3127,7 +3127,7 @@ impl BufferSnapshot {None}- fn get_highlights(&self, range: Range<usize>) -> (SyntaxMapCaptures, Vec<HighlightMap>) {+ fn get_highlights(&self, range: Range<usize>) -> (SyntaxMapCaptures<'_>, Vec<HighlightMap>) {let captures = self.syntax.captures(range, &self.text, |grammar| {grammar.highlights_query.as_ref()});@@ -3143,7 +3143,7 @@ impl BufferSnapshot {/// in an arbitrary way due to being stored in a [`Rope`](text::Rope). The text is also/// returned in chunks where each chunk has a single syntax highlighting style and/// diagnostic status.- pub fn chunks<T: ToOffset>(&self, range: Range<T>, language_aware: bool) -> BufferChunks {+ pub fn chunks<T: ToOffset>(&self, range: Range<T>, language_aware: bool) -> BufferChunks<'_> {let range = range.start.to_offset(self)..range.end.to_offset(self);let mut syntax = None;@@ -3192,12 +3192,12 @@ impl BufferSnapshot {}/// Iterates over every [`SyntaxLayer`] in the buffer.- pub fn syntax_layers(&self) -> impl Iterator<Item = SyntaxLayer> + '_ {+ pub fn syntax_layers(&self) -> impl Iterator<Item = SyntaxLayer<'_>> + '_ {self.syntax.layers_for_range(0..self.len(), &self.text, true)}- pub fn syntax_layer_at<D: ToOffset>(&self, position: D) -> Option<SyntaxLayer> {+ pub fn syntax_layer_at<D: ToOffset>(&self, position: D) -> Option<SyntaxLayer<'_>> {let offset = position.to_offset(self);self.syntax.layers_for_range(offset..offset, &self.text, false)@@ -3208,7 +3208,7 @@ impl BufferSnapshot {pub fn smallest_syntax_layer_containing<D: ToOffset>(&self,range: Range<D>,- ) -> Option<SyntaxLayer> {+ ) -> Option<SyntaxLayer<'_>> {let range = range.to_offset(self);return self.syntax@@ -3426,7 +3426,7 @@ impl BufferSnapshot {}/// Returns the root syntax node within the given row- pub fn syntax_root_ancestor(&self, position: Anchor) -> Option<tree_sitter::Node> {+ pub fn syntax_root_ancestor(&self, position: Anchor) -> Option<tree_sitter::Node<'_>> {let start_offset = position.to_offset(self);let row = self.summary_for_anchor::<text::PointUtf16>(&position).row as usize;@@ -3763,7 +3763,7 @@ impl BufferSnapshot {&self,range: Range<usize>,query: fn(&Grammar) -> Option<&tree_sitter::Query>,- ) -> SyntaxMapMatches {+ ) -> SyntaxMapMatches<'_> {self.syntax.matches(range, self, query)}diff --git a/crates/language/src/syntax_map.rs b/crates/language/src/syntax_map.rsindex 0d131301cc4..a61bc1c90f2 100644--- a/crates/language/src/syntax_map.rs+++ b/crates/language/src/syntax_map.rs@@ -1126,7 +1126,7 @@ impl<'a> SyntaxMapMatches<'a> {&self.grammars}- pub fn peek(&self) -> Option<SyntaxMapMatch> {+ pub fn peek(&self) -> Option<SyntaxMapMatch<'_>> {let layer = self.layers.first()?;if !layer.has_next {@@ -1550,7 +1550,7 @@ fn insert_newlines_between_ranges(impl OwnedSyntaxLayer {/// Returns the root syntax node for this layer.- pub fn node(&self) -> Node {+ pub fn node(&self) -> Node<'_> {self.tree.root_node_with_offset(self.offset.0, self.offset.1)}diff --git a/crates/livekit_client/src/livekit_client/playback.rs b/crates/livekit_client/src/livekit_client/playback.rsindex d941c314a97..3f6b3fd7db4 100644--- a/crates/livekit_client/src/livekit_client/playback.rs+++ b/crates/livekit_client/src/livekit_client/playback.rs@@ -412,7 +412,7 @@ impl libwebrtc::native::audio_mixer::AudioMixerSource for AudioMixerSource {self.sample_rate}- fn get_audio_frame_with_info<'a>(&self, target_sample_rate: u32) -> Option<AudioFrame> {+ fn get_audio_frame_with_info<'a>(&self, target_sample_rate: u32) -> Option<AudioFrame<'_>> {assert_eq!(self.sample_rate, target_sample_rate);let buf = self.buffer.lock().pop_front()?;Some(AudioFrame {diff --git a/crates/markdown/src/markdown.rs b/crates/markdown/src/markdown.rsindex 172cda09bb6..ac959d13b5c 100644--- a/crates/markdown/src/markdown.rs+++ b/crates/markdown/src/markdown.rs@@ -231,7 +231,7 @@ impl Markdown {&self.parsed_markdown}- pub fn escape(s: &str) -> Cow<str> {+ pub fn escape(s: &str) -> Cow<'_, str> {// Valid to use bytes since multi-byte UTF-8 doesn't use ASCII chars.let count = s.bytes()diff --git a/crates/markdown_preview/src/markdown_parser.rs b/crates/markdown_preview/src/markdown_parser.rsindex 0e540fcc9ea..27691f2ecff 100644--- a/crates/markdown_preview/src/markdown_parser.rs+++ b/crates/markdown_preview/src/markdown_parser.rs@@ -72,25 +72,25 @@ impl<'a> MarkdownParser<'a> {self.cursor >= self.tokens.len() - 1}- fn peek(&self, steps: usize) -> Option<&(Event, Range<usize>)> {+ fn peek(&self, steps: usize) -> Option<&(Event<'_>, Range<usize>)> {if self.eof() || (steps + self.cursor) >= self.tokens.len() {return self.tokens.last();}return self.tokens.get(self.cursor + steps);}- fn previous(&self) -> Option<&(Event, Range<usize>)> {+ fn previous(&self) -> Option<&(Event<'_>, Range<usize>)> {if self.cursor == 0 || self.cursor > self.tokens.len() {return None;}return self.tokens.get(self.cursor - 1);}- fn current(&self) -> Option<&(Event, Range<usize>)> {+ fn current(&self) -> Option<&(Event<'_>, Range<usize>)> {return self.peek(0);}- fn current_event(&self) -> Option<&Event> {+ fn current_event(&self) -> Option<&Event<'_>> {return self.current().map(|(event, _)| event);}diff --git a/crates/multi_buffer/src/multi_buffer.rs b/crates/multi_buffer/src/multi_buffer.rsindex 1815f3dd10c..6d544222d4e 100644--- a/crates/multi_buffer/src/multi_buffer.rs+++ b/crates/multi_buffer/src/multi_buffer.rs@@ -728,7 +728,7 @@ impl MultiBuffer {self.snapshot.borrow().clone()}- pub fn read(&self, cx: &App) -> Ref<MultiBufferSnapshot> {+ pub fn read(&self, cx: &App) -> Ref<'_, MultiBufferSnapshot> {self.sync(cx);self.snapshot.borrow()}@@ -2615,7 +2615,7 @@ impl MultiBuffer {"untitled".into()}- fn buffer_based_title(&self, buffer: &Buffer) -> Option<Cow<str>> {+ fn buffer_based_title(&self, buffer: &Buffer) -> Option<Cow<'_, str>> {let mut is_leading_whitespace = true;let mut count = 0;let mut prev_was_space = false;@@ -3779,7 +3779,7 @@ impl MultiBufferSnapshot {.flat_map(|c| c.chars().rev())}- fn reversed_chunks_in_range(&self, range: Range<usize>) -> ReversedMultiBufferChunks {+ fn reversed_chunks_in_range(&self, range: Range<usize>) -> ReversedMultiBufferChunks<'_> {let mut cursor = self.cursor::<usize>();cursor.seek(&range.end);let current_chunks = cursor.region().as_ref().map(|region| {@@ -4294,7 +4294,7 @@ impl MultiBufferSnapshot {self.excerpts.summary().widest_line_number + 1}- pub fn bytes_in_range<T: ToOffset>(&self, range: Range<T>) -> MultiBufferBytes {+ pub fn bytes_in_range<T: ToOffset>(&self, range: Range<T>) -> MultiBufferBytes<'_> {let range = range.start.to_offset(self)..range.end.to_offset(self);let mut excerpts = self.cursor::<usize>();excerpts.seek(&range.start);@@ -4333,7 +4333,7 @@ impl MultiBufferSnapshot {pub fn reversed_bytes_in_range<T: ToOffset>(&self,range: Range<T>,- ) -> ReversedMultiBufferBytes {+ ) -> ReversedMultiBufferBytes<'_> {let range = range.start.to_offset(self)..range.end.to_offset(self);let mut chunks = self.reversed_chunks_in_range(range.clone());let chunk = chunks.next().map_or(&[][..], |c| c.as_bytes());@@ -4344,7 +4344,7 @@ impl MultiBufferSnapshot {}}- pub fn row_infos(&self, start_row: MultiBufferRow) -> MultiBufferRows {+ pub fn row_infos(&self, start_row: MultiBufferRow) -> MultiBufferRows<'_> {let mut cursor = self.cursor::<Point>();cursor.seek(&Point::new(start_row.0, 0));let mut result = MultiBufferRows {@@ -4357,7 +4357,11 @@ impl MultiBufferSnapshot {result}- pub fn chunks<T: ToOffset>(&self, range: Range<T>, language_aware: bool) -> MultiBufferChunks {+ pub fn chunks<T: ToOffset>(+ &self,+ range: Range<T>,+ language_aware: bool,+ ) -> MultiBufferChunks<'_> {let mut chunks = MultiBufferChunks {excerpt_offset_range: ExcerptOffset::new(0)..ExcerptOffset::new(0),range: 0..0,@@ -5318,7 +5322,7 @@ impl MultiBufferSnapshot {.map(|excerpt| (excerpt.id, &excerpt.buffer, excerpt.range.clone()))}- fn cursor<D: TextDimension + Default>(&self) -> MultiBufferCursor<D> {+ fn cursor<D: TextDimension + Default>(&self) -> MultiBufferCursor<'_, D> {let excerpts = self.excerpts.cursor(&());let diff_transforms = self.diff_transforms.cursor(&());MultiBufferCursor {@@ -6081,7 +6085,7 @@ impl MultiBufferSnapshot {pub fn syntax_ancestor<T: ToOffset>(&self,range: Range<T>,- ) -> Option<(tree_sitter::Node, MultiOrSingleBufferOffsetRange)> {+ ) -> Option<(tree_sitter::Node<'_>, MultiOrSingleBufferOffsetRange)> {let range = range.start.to_offset(self)..range.end.to_offset(self);let mut excerpt = self.excerpt_containing(range.clone())?;let node = excerpt@@ -6279,7 +6283,10 @@ impl MultiBufferSnapshot {}/// Returns the excerpt containing range and its offset start within the multibuffer or none if `range` spans multiple excerpts- pub fn excerpt_containing<T: ToOffset>(&self, range: Range<T>) -> Option<MultiBufferExcerpt> {+ pub fn excerpt_containing<T: ToOffset>(+ &self,+ range: Range<T>,+ ) -> Option<MultiBufferExcerpt<'_>> {let range = range.start.to_offset(self)..range.end.to_offset(self);let mut cursor = self.cursor::<usize>();cursor.seek(&range.start);@@ -6933,7 +6940,7 @@ impl Excerpt {}}- fn chunks_in_range(&self, range: Range<usize>, language_aware: bool) -> ExcerptChunks {+ fn chunks_in_range(&self, range: Range<usize>, language_aware: bool) -> ExcerptChunks<'_> {let content_start = self.range.context.start.to_offset(&self.buffer);let chunks_start = content_start + range.start;let chunks_end = content_start + cmp::min(range.end, self.text_summary.len);diff --git a/crates/project/src/git_store/git_traversal.rs b/crates/project/src/git_store/git_traversal.rsindex b3a45406c36..68ed03cfe9e 100644--- a/crates/project/src/git_store/git_traversal.rs+++ b/crates/project/src/git_store/git_traversal.rs@@ -211,7 +211,7 @@ pub struct GitEntry {}impl GitEntry {- pub fn to_ref(&self) -> GitEntryRef {+ pub fn to_ref(&self) -> GitEntryRef<'_> {GitEntryRef {entry: &self.entry,git_summary: self.git_summary,diff --git a/crates/project/src/project.rs b/crates/project/src/project.rsindex 492c1722d89..c578dda0e99 100644--- a/crates/project/src/project.rs+++ b/crates/project/src/project.rs@@ -467,7 +467,7 @@ impl CompletionSource {}}- pub fn lsp_completion(&self, apply_defaults: bool) -> Option<Cow<lsp::CompletionItem>> {+ pub fn lsp_completion(&self, apply_defaults: bool) -> Option<Cow<'_, lsp::CompletionItem>> {if let Self::Lsp {lsp_completion,lsp_defaults,diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rsindex 1a3d07ef49a..ed27b11e8a3 100644--- a/crates/project_panel/src/project_panel.rs+++ b/crates/project_panel/src/project_panel.rs@@ -3227,7 +3227,7 @@ impl ProjectPanel {None}- fn entry_at_index(&self, index: usize) -> Option<(WorktreeId, GitEntryRef)> {+ fn entry_at_index(&self, index: usize) -> Option<(WorktreeId, GitEntryRef<'_>)> {let mut offset = 0;for (worktree_id, visible_worktree_entries, _) in &self.visible_entries {if visible_worktree_entries.len() > offset + index {diff --git a/crates/recent_projects/src/remote_servers.rs b/crates/recent_projects/src/remote_servers.rsindex 1f7c8295a92..134f728680b 100644--- a/crates/recent_projects/src/remote_servers.rs+++ b/crates/recent_projects/src/remote_servers.rs@@ -281,7 +281,7 @@ impl RemoteEntry {matches!(self, Self::Project { .. })}- fn connection(&self) -> Cow<SshConnection> {+ fn connection(&self) -> Cow<'_, SshConnection> {match self {Self::Project { connection, .. } => Cow::Borrowed(connection),Self::SshConfig { host, .. } => Cow::Owned(SshConnection {diff --git a/crates/rope/src/chunk.rs b/crates/rope/src/chunk.rsindex 5b0a671d860..dc00674380f 100644--- a/crates/rope/src/chunk.rs+++ b/crates/rope/src/chunk.rs@@ -53,7 +53,7 @@ impl Chunk {}#[inline(always)]- pub fn as_slice(&self) -> ChunkSlice {+ pub fn as_slice(&self) -> ChunkSlice<'_> {ChunkSlice {chars: self.chars,chars_utf16: self.chars_utf16,@@ -64,7 +64,7 @@ impl Chunk {}#[inline(always)]- pub fn slice(&self, range: Range<usize>) -> ChunkSlice {+ pub fn slice(&self, range: Range<usize>) -> ChunkSlice<'_> {self.as_slice().slice(range)}}diff --git a/crates/rope/src/rope.rs b/crates/rope/src/rope.rsindex b049498ccb4..535b863b7d7 100644--- a/crates/rope/src/rope.rs+++ b/crates/rope/src/rope.rs@@ -241,7 +241,7 @@ impl Rope {self.chunks.extent(&())}- pub fn cursor(&self, offset: usize) -> Cursor {+ pub fn cursor(&self, offset: usize) -> Cursor<'_> {Cursor::new(self, offset)}@@ -258,23 +258,23 @@ impl Rope {.flat_map(|chunk| chunk.chars().rev())}- pub fn bytes_in_range(&self, range: Range<usize>) -> Bytes {+ pub fn bytes_in_range(&self, range: Range<usize>) -> Bytes<'_> {Bytes::new(self, range, false)}- pub fn reversed_bytes_in_range(&self, range: Range<usize>) -> Bytes {+ pub fn reversed_bytes_in_range(&self, range: Range<usize>) -> Bytes<'_> {Bytes::new(self, range, true)}- pub fn chunks(&self) -> Chunks {+ pub fn chunks(&self) -> Chunks<'_> {self.chunks_in_range(0..self.len())}- pub fn chunks_in_range(&self, range: Range<usize>) -> Chunks {+ pub fn chunks_in_range(&self, range: Range<usize>) -> Chunks<'_> {Chunks::new(self, range, false)}- pub fn reversed_chunks_in_range(&self, range: Range<usize>) -> Chunks {+ pub fn reversed_chunks_in_range(&self, range: Range<usize>) -> Chunks<'_> {Chunks::new(self, range, true)}diff --git a/crates/sum_tree/src/sum_tree.rs b/crates/sum_tree/src/sum_tree.rsindex d5f8deadad4..82022d66855 100644--- a/crates/sum_tree/src/sum_tree.rs+++ b/crates/sum_tree/src/sum_tree.rs@@ -380,7 +380,7 @@ impl<T: Item> SumTree<T> {items}- pub fn iter(&self) -> Iter<T> {+ pub fn iter(&self) -> Iter<'_, T> {Iter::new(self)}diff --git a/crates/terminal/src/terminal_settings.rs b/crates/terminal/src/terminal_settings.rsindex daebb9924ef..bd93b7e0a67 100644--- a/crates/terminal/src/terminal_settings.rs+++ b/crates/terminal/src/terminal_settings.rs@@ -103,7 +103,7 @@ pub struct VenvSettingsContent<'a> {}impl VenvSettings {- pub fn as_option(&self) -> Option<VenvSettingsContent> {+ pub fn as_option(&self) -> Option<VenvSettingsContent<'_>> {match self {VenvSettings::Off => None,VenvSettings::On {diff --git a/crates/text/src/text.rs b/crates/text/src/text.rsindex 27692ff7fbb..a2742081f4b 100644--- a/crates/text/src/text.rs+++ b/crates/text/src/text.rs@@ -2049,7 +2049,7 @@ impl BufferSnapshot {self.visible_text.reversed_chars_at(offset)}- pub fn reversed_chunks_in_range<T: ToOffset>(&self, range: Range<T>) -> rope::Chunks {+ pub fn reversed_chunks_in_range<T: ToOffset>(&self, range: Range<T>) -> rope::Chunks<'_> {let range = range.start.to_offset(self)..range.end.to_offset(self);self.visible_text.reversed_chunks_in_range(range)}diff --git a/crates/watch/src/watch.rs b/crates/watch/src/watch.rsindex a4a0ca6df42..c0741e4a204 100644--- a/crates/watch/src/watch.rs+++ b/crates/watch/src/watch.rs@@ -150,7 +150,7 @@ impl<T> Drop for Changed<'_, T> {}impl<T> Receiver<T> {- pub fn borrow(&mut self) -> parking_lot::MappedRwLockReadGuard<T> {+ pub fn borrow(&mut self) -> parking_lot::MappedRwLockReadGuard<'_, T> {let state = self.state.read();self.version = state.version;RwLockReadGuard::map(state, |state| &state.value)diff --git a/crates/worktree/src/worktree.rs b/crates/worktree/src/worktree.rsindex 62ce35789e4..6b3a0b855f9 100644--- a/crates/worktree/src/worktree.rs+++ b/crates/worktree/src/worktree.rs@@ -2566,7 +2566,7 @@ impl Snapshot {include_dirs: bool,include_ignored: bool,start_offset: usize,- ) -> Traversal {+ ) -> Traversal<'_> {let mut cursor = self.entries_by_path.cursor(&());cursor.seek(&TraversalTarget::Count {@@ -2593,19 +2593,19 @@ impl Snapshot {include_dirs: bool,include_ignored: bool,path: &Path,- ) -> Traversal {+ ) -> Traversal<'_> {Traversal::new(self, include_files, include_dirs, include_ignored, path)}- pub fn files(&self, include_ignored: bool, start: usize) -> Traversal {+ pub fn files(&self, include_ignored: bool, start: usize) -> Traversal<'_> {self.traverse_from_offset(true, false, include_ignored, start)}- pub fn directories(&self, include_ignored: bool, start: usize) -> Traversal {+ pub fn directories(&self, include_ignored: bool, start: usize) -> Traversal<'_> {self.traverse_from_offset(false, true, include_ignored, start)}- pub fn entries(&self, include_ignored: bool, start: usize) -> Traversal {+ pub fn entries(&self, include_ignored: bool, start: usize) -> Traversal<'_> {self.traverse_from_offset(true, true, include_ignored, start)}