Release Notes: - N/A
Unified · Split
| @@ -823,6 +823,7 @@ style = { level = "allow", priority = -1 } · 822 unmodified lines | ||
| 823 | 823 | |
| 824 | 824 | # Temporary list of style lints that we've fixed so far. |
| 825 | 825 | comparison_to_empty = "warn" |
| 826 | +for_kv_map = "warn" | |
| 826 | 827 | into_iter_on_ref = "warn" |
| 827 | 828 | iter_cloned_collect = "warn" |
| 828 | 829 | iter_next_slice = "warn" |
| @@ -1643,7 +1643,7 @@ impl AgentDiff { · 1642 unmodified lines | ||
| 1643 | 1643 | continue; |
| 1644 | 1644 | }; |
| 1645 | 1645 | |
| 1646 | − for (weak_editor, _) in buffer_editors { | |
| 1646 | + for weak_editor in buffer_editors.keys() { | |
| 1647 | 1647 | let Some(editor) = weak_editor.upgrade() else { |
| 1648 | 1648 | continue; |
| 1649 | 1649 | }; |
| @@ -135,7 +135,7 @@ impl ChannelBuffer { · 134 unmodified lines | ||
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | − for (_, old_collaborator) in &self.collaborators { | |
| 138 | + for old_collaborator in self.collaborators.values() { | |
| 139 | 139 | if !new_collaborators.contains_key(&old_collaborator.peer_id) { |
| 140 | 140 | self.buffer.update(cx, |buffer, cx| { |
| 141 | 141 | buffer.remove_peer(old_collaborator.replica_id, cx) |
| @@ -1073,7 +1073,7 @@ impl ChannelStore { · 1072 unmodified lines | ||
| 1073 | 1073 | |
| 1074 | 1074 | if let Some(this) = this.upgrade() { |
| 1075 | 1075 | this.update(cx, |this, cx| { |
| 1076 | − for (_, buffer) in &this.opened_buffers { | |
| 1076 | + for buffer in this.opened_buffers.values() { | |
| 1077 | 1077 | if let OpenEntityHandle::Open(buffer) = &buffer |
| 1078 | 1078 | && let Some(buffer) = buffer.upgrade() |
| 1079 | 1079 | { |
| @@ -1175,16 +1175,16 @@ impl ExtensionStore { · 1174 unmodified lines | ||
| 1175 | 1175 | } |
| 1176 | 1176 | } |
| 1177 | 1177 | |
| 1178 | − for (server_id, _) in &extension.manifest.context_servers { | |
| 1178 | + for server_id in extension.manifest.context_servers.keys() { | |
| 1179 | 1179 | self.proxy.unregister_context_server(server_id.clone(), cx); |
| 1180 | 1180 | } |
| 1181 | − for (adapter, _) in &extension.manifest.debug_adapters { | |
| 1181 | + for adapter in extension.manifest.debug_adapters.keys() { | |
| 1182 | 1182 | self.proxy.unregister_debug_adapter(adapter.clone()); |
| 1183 | 1183 | } |
| 1184 | − for (locator, _) in &extension.manifest.debug_locators { | |
| 1184 | + for locator in extension.manifest.debug_locators.keys() { | |
| 1185 | 1185 | self.proxy.unregister_debug_locator(locator.clone()); |
| 1186 | 1186 | } |
| 1187 | − for (command_name, _) in &extension.manifest.slash_commands { | |
| 1187 | + for command_name in extension.manifest.slash_commands.keys() { | |
| 1188 | 1188 | self.proxy.unregister_slash_command(command_name.clone()); |
| 1189 | 1189 | } |
| 1190 | 1190 | } |
| @@ -1386,7 +1386,7 @@ impl ExtensionStore { · 195 unmodified lines | ||
| 1386 | 1386 | ); |
| 1387 | 1387 | } |
| 1388 | 1388 | |
| 1389 | − for (id, _context_server_entry) in &manifest.context_servers { | |
| 1389 | + for id in manifest.context_servers.keys() { | |
| 1390 | 1390 | this.proxy |
| 1391 | 1391 | .register_context_server(extension.clone(), id.clone(), cx); |
| 1392 | 1392 | } |
| @@ -528,7 +528,7 @@ impl WaylandClient { · 527 unmodified lines | ||
| 528 | 528 | |
| 529 | 529 | client.common.appearance = appearance; |
| 530 | 530 | |
| 531 | − for (_, window) in &mut client.windows { | |
| 531 | + for window in client.windows.values_mut() { | |
| 532 | 532 | window.set_appearance(appearance); |
| 533 | 533 | } |
| 534 | 534 | } |
| @@ -456,7 +456,7 @@ impl X11Client { · 455 unmodified lines | ||
| 456 | 456 | move |event, _, client| match event { |
| 457 | 457 | XDPEvent::WindowAppearance(appearance) => { |
| 458 | 458 | client.with_common(|common| common.appearance = appearance); |
| 459 | − for (_, window) in &mut client.0.borrow_mut().windows { | |
| 459 | + for window in client.0.borrow_mut().windows.values_mut() { | |
| 460 | 460 | window.window.set_appearance(appearance); |
| 461 | 461 | } |
| 462 | 462 | } |
| @@ -5338,7 +5338,7 @@ fn subscribe_for_editor_events( · 5337 unmodified lines | ||
| 5338 | 5338 | } |
| 5339 | 5339 | EditorEvent::Reparsed(buffer_id) => { |
| 5340 | 5340 | if let Some(excerpts) = outline_panel.excerpts.get_mut(buffer_id) { |
| 5341 | − for (_, excerpt) in excerpts { | |
| 5341 | + for excerpt in excerpts.values_mut() { | |
| 5342 | 5342 | excerpt.invalidate_outlines(); |
| 5343 | 5343 | } |
| 5344 | 5344 | } |
| @@ -10883,7 +10883,7 @@ impl LspStore { · 10882 unmodified lines | ||
| 10883 | 10883 | // Find all worktrees that have this server in their language server tree |
| 10884 | 10884 | for (worktree_id, servers) in &local.lsp_tree.instances { |
| 10885 | 10885 | if *worktree_id != key.worktree_id { |
| 10886 | − for (_, server_map) in &servers.roots { | |
| 10886 | + for server_map in servers.roots.values() { | |
| 10887 | 10887 | if server_map.contains_key(&key.name) { |
| 10888 | 10888 | worktrees_using_server.push(*worktree_id); |
| 10889 | 10889 | } |
| @@ -77,7 +77,7 @@ impl ManifestTree { · 76 unmodified lines | ||
| 77 | 77 | _subscriptions: [ |
| 78 | 78 | cx.subscribe(&worktree_store, Self::on_worktree_store_event), |
| 79 | 79 | cx.observe_global::<SettingsStore>(|this, cx| { |
| 80 | − for (_, roots) in &mut this.root_points { | |
| 80 | + for roots in this.root_points.values_mut() { | |
| 81 | 81 | roots.update(cx, |worktree_roots, _| { |
| 82 | 82 | worktree_roots.roots = RootPathTrie::new(); |
| 83 | 83 | }) |
| @@ -312,8 +312,8 @@ impl LanguageServerTree { · 311 unmodified lines | ||
| 312 | 312 | |
| 313 | 313 | /// Remove nodes with a given ID from the tree. |
| 314 | 314 | pub(crate) fn remove_nodes(&mut self, ids: &BTreeSet<LanguageServerId>) { |
| 315 | − for (_, servers) in &mut self.instances { | |
| 316 | − for (_, nodes) in &mut servers.roots { | |
| 315 | + for servers in self.instances.values_mut() { | |
| 316 | + for nodes in &mut servers.roots.values_mut() { | |
| 317 | 317 | nodes.retain(|_, (node, _)| node.id.get().is_none_or(|id| !ids.contains(id))); |
| 318 | 318 | } |
| 319 | 319 | } |