Closes #ISSUE Release Notes: - N/A *or* Added/Fixed/Improved ... ---------
Unified · Split
| @@ -240,7 +240,7 @@ jobs: · 239 unmodified lines | ||
| 240 | 240 | timeout-minutes: 60 |
| 241 | 241 | name: (Windows) Run Clippy and tests |
| 242 | 242 | if: github.repository_owner == 'zed-industries' |
| 243 | − runs-on: hosted-windows-1 | |
| 243 | + runs-on: hosted-windows-2 | |
| 244 | 244 | steps: |
| 245 | 245 | # more info here:- https://github.com/rust-lang/cargo/issues/13020 |
| 246 | 246 | - name: Enable longer pathnames for git |
| @@ -709,6 +709,9 @@ debug = "full" · 708 unmodified lines | ||
| 709 | 709 | lto = false |
| 710 | 710 | codegen-units = 16 |
| 711 | 711 | |
| 712 | +[workspace.lints.rust] | |
| 713 | +unexpected_cfgs = { level = "allow" } | |
| 714 | + | |
| 712 | 715 | [workspace.lints.clippy] |
| 713 | 716 | dbg_macro = "deny" |
| 714 | 717 | todo = "deny" |
| @@ -109,7 +109,7 @@ impl sum_tree::Summary for DiffHunkSummary { · 108 unmodified lines | ||
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | −impl<'a> sum_tree::SeekTarget<'a, DiffHunkSummary, DiffHunkSummary> for Anchor { | |
| 112 | +impl sum_tree::SeekTarget<'_, DiffHunkSummary, DiffHunkSummary> for Anchor { | |
| 113 | 113 | fn cmp(&self, cursor_location: &DiffHunkSummary, buffer: &text::BufferSnapshot) -> Ordering { |
| 114 | 114 | if self |
| 115 | 115 | .cmp(&cursor_location.buffer_range.start, buffer) |
| @@ -48,7 +48,7 @@ pub struct ChannelPathsInsertGuard<'a> { · 47 unmodified lines | ||
| 48 | 48 | channels_by_id: &'a mut BTreeMap<ChannelId, Arc<Channel>>, |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | −impl<'a> ChannelPathsInsertGuard<'a> { | |
| 51 | +impl ChannelPathsInsertGuard<'_> { | |
| 52 | 52 | pub fn insert(&mut self, channel_proto: proto::Channel) -> bool { |
| 53 | 53 | let mut ret = false; |
| 54 | 54 | let parent_path = channel_proto |
| @@ -86,7 +86,7 @@ impl<'a> ChannelPathsInsertGuard<'a> { · 31 unmodified lines | ||
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | −impl<'a> Drop for ChannelPathsInsertGuard<'a> { | |
| 89 | +impl Drop for ChannelPathsInsertGuard<'_> { | |
| 90 | 90 | fn drop(&mut self) { |
| 91 | 91 | self.channels_ordered.sort_by(|a, b| { |
| 92 | 92 | let a = channel_path_sorting_key(*a, self.channels_by_id); |
| @@ -202,7 +202,7 @@ impl Database { · 201 unmodified lines | ||
| 202 | 202 | .await |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | − pub async fn get_known_extension_versions<'a>(&self) -> Result<HashMap<String, Vec<String>>> { | |
| 205 | + pub async fn get_known_extension_versions(&self) -> Result<HashMap<String, Vec<String>>> { | |
| 206 | 206 | self.transaction(|tx| async move { |
| 207 | 207 | let mut extension_external_ids_by_id = HashMap::default(); |
| 208 | 208 | |
| @@ -975,7 +975,7 @@ impl Server { · 974 unmodified lines | ||
| 975 | 975 | } |
| 976 | 976 | } |
| 977 | 977 | |
| 978 | −impl<'a> Deref for ConnectionPoolGuard<'a> { | |
| 978 | +impl Deref for ConnectionPoolGuard<'_> { | |
| 979 | 979 | type Target = ConnectionPool; |
| 980 | 980 | |
| 981 | 981 | fn deref(&self) -> &Self::Target { |
| @@ -983,13 +983,13 @@ impl<'a> Deref for ConnectionPoolGuard<'a> { · 1 unmodified line | ||
| 983 | 983 | } |
| 984 | 984 | } |
| 985 | 985 | |
| 986 | −impl<'a> DerefMut for ConnectionPoolGuard<'a> { | |
| 986 | +impl DerefMut for ConnectionPoolGuard<'_> { | |
| 987 | 987 | fn deref_mut(&mut self) -> &mut Self::Target { |
| 988 | 988 | &mut self.guard |
| 989 | 989 | } |
| 990 | 990 | } |
| 991 | 991 | |
| 992 | −impl<'a> Drop for ConnectionPoolGuard<'a> { | |
| 992 | +impl Drop for ConnectionPoolGuard<'_> { | |
| 993 | 993 | fn drop(&mut self) { |
| 994 | 994 | #[cfg(test)] |
| 995 | 995 | self.check_invariants(); |
| @@ -27,7 +27,7 @@ impl<'de> Deserialize<'de> for ChatPanelButton { · 26 unmodified lines | ||
| 27 | 27 | { |
| 28 | 28 | struct Visitor; |
| 29 | 29 | |
| 30 | − impl<'de> serde::de::Visitor<'de> for Visitor { | |
| 30 | + impl serde::de::Visitor<'_> for Visitor { | |
| 31 | 31 | type Value = ChatPanelButton; |
| 32 | 32 | |
| 33 | 33 | fn expecting(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { |
| @@ -411,7 +411,7 @@ async fn stream_completion( · 410 unmodified lines | ||
| 411 | 411 | |
| 412 | 412 | match serde_json::from_str::<ResponseEvent>(line) { |
| 413 | 413 | Ok(response) => { |
| 414 | − if response.choices.first().is_none() | |
| 414 | + if response.choices.is_empty() | |
| 415 | 415 | || response.choices.first().unwrap().finish_reason.is_some() |
| 416 | 416 | { |
| 417 | 417 | None |
| @@ -999,7 +999,7 @@ impl std::ops::DerefMut for BlockPoint { · 998 unmodified lines | ||
| 999 | 999 | } |
| 1000 | 1000 | } |
| 1001 | 1001 | |
| 1002 | −impl<'a> Deref for BlockMapReader<'a> { | |
| 1002 | +impl Deref for BlockMapReader<'_> { | |
| 1003 | 1003 | type Target = BlockSnapshot; |
| 1004 | 1004 | |
| 1005 | 1005 | fn deref(&self) -> &Self::Target { |
| @@ -1007,13 +1007,13 @@ impl<'a> Deref for BlockMapReader<'a> { · 1 unmodified line | ||
| 1007 | 1007 | } |
| 1008 | 1008 | } |
| 1009 | 1009 | |
| 1010 | −impl<'a> DerefMut for BlockMapReader<'a> { | |
| 1010 | +impl DerefMut for BlockMapReader<'_> { | |
| 1011 | 1011 | fn deref_mut(&mut self) -> &mut Self::Target { |
| 1012 | 1012 | &mut self.snapshot |
| 1013 | 1013 | } |
| 1014 | 1014 | } |
| 1015 | 1015 | |
| 1016 | −impl<'a> BlockMapReader<'a> { | |
| 1016 | +impl BlockMapReader<'_> { | |
| 1017 | 1017 | pub fn row_for_block(&self, block_id: CustomBlockId) -> Option<BlockRow> { |
| 1018 | 1018 | let block = self.blocks.iter().find(|block| block.id == block_id)?; |
| 1019 | 1019 | let buffer_row = block |
| @@ -1053,7 +1053,7 @@ impl<'a> BlockMapReader<'a> { · 33 unmodified lines | ||
| 1053 | 1053 | } |
| 1054 | 1054 | } |
| 1055 | 1055 | |
| 1056 | −impl<'a> BlockMapWriter<'a> { | |
| 1056 | +impl BlockMapWriter<'_> { | |
| 1057 | 1057 | pub fn insert( |
| 1058 | 1058 | &mut self, |
| 1059 | 1059 | blocks: impl IntoIterator<Item = BlockProperties<Anchor>>, |
| @@ -1740,7 +1740,7 @@ impl BlockSnapshot { · 680 unmodified lines | ||
| 1740 | 1740 | } |
| 1741 | 1741 | } |
| 1742 | 1742 | |
| 1743 | −impl<'a> BlockChunks<'a> { | |
| 1743 | +impl BlockChunks<'_> { | |
| 1744 | 1744 | /// Go to the next transform |
| 1745 | 1745 | fn advance(&mut self) { |
| 1746 | 1746 | self.input_chunk = Chunk::default(); |
| @@ -1856,7 +1856,7 @@ impl<'a> Iterator for BlockChunks<'a> { · 109 unmodified lines | ||
| 1856 | 1856 | } |
| 1857 | 1857 | } |
| 1858 | 1858 | |
| 1859 | −impl<'a> Iterator for BlockRows<'a> { | |
| 1859 | +impl Iterator for BlockRows<'_> { | |
| 1860 | 1860 | type Item = RowInfo; |
| 1861 | 1861 | |
| 1862 | 1862 | fn next(&mut self) -> Option<Self::Item> { |
| @@ -1952,7 +1952,7 @@ impl<'a> sum_tree::Dimension<'a, TransformSummary> for BlockRow { · 89 unmodified lines | ||
| 1952 | 1952 | } |
| 1953 | 1953 | } |
| 1954 | 1954 | |
| 1955 | −impl<'a> Deref for BlockContext<'a, '_> { | |
| 1955 | +impl Deref for BlockContext<'_, '_> { | |
| 1956 | 1956 | type Target = App; |
| 1957 | 1957 | |
| 1958 | 1958 | fn deref(&self) -> &Self::Target { |
| @@ -132,7 +132,7 @@ impl<'a> sum_tree::Dimension<'a, TransformSummary> for FoldPoint { · 131 unmodified lines | ||
| 132 | 132 | |
| 133 | 133 | pub(crate) struct FoldMapWriter<'a>(&'a mut FoldMap); |
| 134 | 134 | |
| 135 | −impl<'a> FoldMapWriter<'a> { | |
| 135 | +impl FoldMapWriter<'_> { | |
| 136 | 136 | pub(crate) fn fold<T: ToOffset>( |
| 137 | 137 | &mut self, |
| 138 | 138 | ranges: impl IntoIterator<Item = (Range<T>, FoldPlaceholder)>, |
| @@ -1121,7 +1121,7 @@ impl<'a> sum_tree::Dimension<'a, FoldSummary> for FoldRange { · 982 unmodified lines | ||
| 1121 | 1121 | } |
| 1122 | 1122 | } |
| 1123 | 1123 | |
| 1124 | −impl<'a> sum_tree::SeekTarget<'a, FoldSummary, FoldRange> for FoldRange { | |
| 1124 | +impl sum_tree::SeekTarget<'_, FoldSummary, FoldRange> for FoldRange { | |
| 1125 | 1125 | fn cmp(&self, other: &Self, buffer: &MultiBufferSnapshot) -> Ordering { |
| 1126 | 1126 | AnchorRangeExt::cmp(&self.0, &other.0, buffer) |
| 1127 | 1127 | } |
| @@ -1144,7 +1144,7 @@ pub struct FoldRows<'a> { · 16 unmodified lines | ||
| 1144 | 1144 | fold_point: FoldPoint, |
| 1145 | 1145 | } |
| 1146 | 1146 | |
| 1147 | −impl<'a> FoldRows<'a> { | |
| 1147 | +impl FoldRows<'_> { | |
| 1148 | 1148 | pub(crate) fn seek(&mut self, row: u32) { |
| 1149 | 1149 | let fold_point = FoldPoint::new(row, 0); |
| 1150 | 1150 | self.cursor.seek(&fold_point, Bias::Left, &()); |
| @@ -1155,7 +1155,7 @@ impl<'a> FoldRows<'a> { · 4 unmodified lines | ||
| 1155 | 1155 | } |
| 1156 | 1156 | } |
| 1157 | 1157 | |
| 1158 | −impl<'a> Iterator for FoldRows<'a> { | |
| 1158 | +impl Iterator for FoldRows<'_> { | |
| 1159 | 1159 | type Item = RowInfo; |
| 1160 | 1160 | |
| 1161 | 1161 | fn next(&mut self) -> Option<Self::Item> { |
| @@ -1190,7 +1190,7 @@ pub struct FoldChunks<'a> { · 28 unmodified lines | ||
| 1190 | 1190 | max_output_offset: FoldOffset, |
| 1191 | 1191 | } |
| 1192 | 1192 | |
| 1193 | −impl<'a> FoldChunks<'a> { | |
| 1193 | +impl FoldChunks<'_> { | |
| 1194 | 1194 | pub(crate) fn seek(&mut self, range: Range<FoldOffset>) { |
| 1195 | 1195 | self.transform_cursor.seek(&range.start, Bias::Right, &()); |
| 1196 | 1196 | |
| @@ -215,7 +215,7 @@ pub struct InlayChunks<'a> { · 214 unmodified lines | ||
| 215 | 215 | snapshot: &'a InlaySnapshot, |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | −impl<'a> InlayChunks<'a> { | |
| 218 | +impl InlayChunks<'_> { | |
| 219 | 219 | pub fn seek(&mut self, new_range: Range<InlayOffset>) { |
| 220 | 220 | self.transforms.seek(&new_range.start, Bias::Right, &()); |
| 221 | 221 | |
| @@ -341,7 +341,7 @@ impl<'a> Iterator for InlayChunks<'a> { · 119 unmodified lines | ||
| 341 | 341 | } |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | −impl<'a> InlayBufferRows<'a> { | |
| 344 | +impl InlayBufferRows<'_> { | |
| 345 | 345 | pub fn seek(&mut self, row: u32) { |
| 346 | 346 | let inlay_point = InlayPoint::new(row, 0); |
| 347 | 347 | self.transforms.seek(&inlay_point, Bias::Left, &()); |
| @@ -363,7 +363,7 @@ impl<'a> InlayBufferRows<'a> { · 15 unmodified lines | ||
| 363 | 363 | } |
| 364 | 364 | } |
| 365 | 365 | |
| 366 | −impl<'a> Iterator for InlayBufferRows<'a> { | |
| 366 | +impl Iterator for InlayBufferRows<'_> { | |
| 367 | 367 | type Item = RowInfo; |
| 368 | 368 | |
| 369 | 369 | fn next(&mut self) -> Option<Self::Item> { |
| @@ -498,7 +498,7 @@ pub struct TabChunks<'a> { · 497 unmodified lines | ||
| 498 | 498 | inside_leading_tab: bool, |
| 499 | 499 | } |
| 500 | 500 | |
| 501 | −impl<'a> TabChunks<'a> { | |
| 501 | +impl TabChunks<'_> { | |
| 502 | 502 | pub(crate) fn seek(&mut self, range: Range<TabPoint>) { |
| 503 | 503 | let (input_start, expanded_char_column, to_next_stop) = |
| 504 | 504 | self.snapshot.to_fold_point(range.start, Bias::Left); |
| @@ -69,7 +69,7 @@ pub struct WrapRows<'a> { · 68 unmodified lines | ||
| 69 | 69 | transforms: Cursor<'a, Transform, (WrapPoint, TabPoint)>, |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | −impl<'a> WrapRows<'a> { | |
| 72 | +impl WrapRows<'_> { | |
| 73 | 73 | pub(crate) fn seek(&mut self, start_row: u32) { |
| 74 | 74 | self.transforms |
| 75 | 75 | .seek(&WrapPoint::new(start_row, 0), Bias::Left, &()); |
| @@ -872,7 +872,7 @@ impl WrapSnapshot { · 796 unmodified lines | ||
| 872 | 872 | } |
| 873 | 873 | } |
| 874 | 874 | |
| 875 | −impl<'a> WrapChunks<'a> { | |
| 875 | +impl WrapChunks<'_> { | |
| 876 | 876 | pub(crate) fn seek(&mut self, rows: Range<u32>) { |
| 877 | 877 | let output_start = WrapPoint::new(rows.start, 0); |
| 878 | 878 | let output_end = WrapPoint::new(rows.end, 0); |
| @@ -955,7 +955,7 @@ impl<'a> Iterator for WrapChunks<'a> { · 76 unmodified lines | ||
| 955 | 955 | } |
| 956 | 956 | } |
| 957 | 957 | |
| 958 | −impl<'a> Iterator for WrapRows<'a> { | |
| 958 | +impl Iterator for WrapRows<'_> { | |
| 959 | 959 | type Item = RowInfo; |
| 960 | 960 | |
| 961 | 961 | fn next(&mut self) -> Option<Self::Item> { |
| @@ -1120,7 +1120,7 @@ impl<'a> sum_tree::Dimension<'a, TransformSummary> for TabPoint { · 158 unmodified lines | ||
| 1120 | 1120 | } |
| 1121 | 1121 | } |
| 1122 | 1122 | |
| 1123 | −impl<'a> sum_tree::SeekTarget<'a, TransformSummary, TransformSummary> for TabPoint { | |
| 1123 | +impl sum_tree::SeekTarget<'_, TransformSummary, TransformSummary> for TabPoint { | |
| 1124 | 1124 | fn cmp(&self, cursor_location: &TransformSummary, _: &()) -> std::cmp::Ordering { |
| 1125 | 1125 | Ord::cmp(&self.0, &cursor_location.input.lines) |
| 1126 | 1126 | } |
| @@ -17393,7 +17393,7 @@ impl Focusable for Editor { · 17392 unmodified lines | ||
| 17393 | 17393 | } |
| 17394 | 17394 | |
| 17395 | 17395 | impl Render for Editor { |
| 17396 | − fn render<'a>(&mut self, _: &mut Window, cx: &mut Context<'a, Self>) -> impl IntoElement { | |
| 17396 | + fn render(&mut self, _: &mut Window, cx: &mut Context<'_, Self>) -> impl IntoElement { | |
| 17397 | 17397 | let settings = ThemeSettings::get_global(cx); |
| 17398 | 17398 | |
| 17399 | 17399 | let mut text_style = match self.mode { |
| @@ -177,7 +177,7 @@ impl<'de> Deserialize<'de> for ScrollbarDiagnostics { · 176 unmodified lines | ||
| 177 | 177 | { |
| 178 | 178 | struct Visitor; |
| 179 | 179 | |
| 180 | − impl<'de> serde::de::Visitor<'de> for Visitor { | |
| 180 | + impl serde::de::Visitor<'_> for Visitor { | |
| 181 | 181 | type Value = ScrollbarDiagnostics; |
| 182 | 182 | |
| 183 | 183 | fn expecting(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { |
| @@ -238,7 +238,7 @@ pub fn indented_line_beginning( · 237 unmodified lines | ||
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | /// Returns a position of the end of line. |
| 241 | − | |
| 241 | +/// | |
| 242 | 242 | /// If `stop_at_soft_boundaries` is true, the returned position is that of the |
| 243 | 243 | /// displayed line (e.g. it could actually be in the middle of a text line if that line is soft-wrapped). |
| 244 | 244 | /// Otherwise it's always going to be the end of a logical line. |
| @@ -843,14 +843,14 @@ impl<'a> MutableSelectionsCollection<'a> { · 842 unmodified lines | ||
| 843 | 843 | } |
| 844 | 844 | } |
| 845 | 845 | |
| 846 | −impl<'a> Deref for MutableSelectionsCollection<'a> { | |
| 846 | +impl Deref for MutableSelectionsCollection<'_> { | |
| 847 | 847 | type Target = SelectionsCollection; |
| 848 | 848 | fn deref(&self) -> &Self::Target { |
| 849 | 849 | self.collection |
| 850 | 850 | } |
| 851 | 851 | } |
| 852 | 852 | |
| 853 | −impl<'a> DerefMut for MutableSelectionsCollection<'a> { | |
| 853 | +impl DerefMut for MutableSelectionsCollection<'_> { | |
| 854 | 854 | fn deref_mut(&mut self) -> &mut Self::Target { |
| 855 | 855 | self.collection |
| 856 | 856 | } |
| @@ -181,7 +181,10 @@ pub fn register_extension(build_extension: fn() -> Box<dyn Extension>) { · 180 unmodified lines | ||
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | fn extension() -> &'static mut dyn Extension { |
| 184 | − unsafe { EXTENSION.as_deref_mut().unwrap() } | |
| 184 | + #[expect(static_mut_refs)] | |
| 185 | + unsafe { | |
| 186 | + EXTENSION.as_deref_mut().unwrap() | |
| 187 | + } | |
| 185 | 188 | } |
| 186 | 189 | |
| 187 | 190 | static mut EXTENSION: Option<Box<dyn Extension>> = None; |
| @@ -78,10 +78,9 @@ impl HeadlessExtensionStore { · 77 unmodified lines | ||
| 78 | 78 | if e.dev { |
| 79 | 79 | return true; |
| 80 | 80 | } |
| 81 | − !self | |
| 82 | − .loaded_extensions | |
| 81 | + self.loaded_extensions | |
| 83 | 82 | .get(e.id.as_str()) |
| 84 | − .is_some_and(|loaded| loaded.as_ref() == e.version.as_str()) | |
| 83 | + .is_none_or(|loaded| loaded.as_ref() != e.version.as_str()) | |
| 85 | 84 | }) |
| 86 | 85 | .collect(); |
| 87 | 86 | |
| @@ -348,7 +348,7 @@ impl Extension { · 347 unmodified lines | ||
| 348 | 348 | .call_labels_for_completions( |
| 349 | 349 | store, |
| 350 | 350 | &language_server_id.0, |
| 351 | − &completions.into_iter().map(Into::into).collect::<Vec<_>>(), | |
| 351 | + &completions.into_iter().collect::<Vec<_>>(), | |
| 352 | 352 | ) |
| 353 | 353 | .await? |
| 354 | 354 | .map(|labels| { |
| @@ -402,7 +402,7 @@ impl Extension { · 47 unmodified lines | ||
| 402 | 402 | .call_labels_for_symbols( |
| 403 | 403 | store, |
| 404 | 404 | &language_server_id.0, |
| 405 | − &symbols.into_iter().map(Into::into).collect::<Vec<_>>(), | |
| 405 | + &symbols.into_iter().collect::<Vec<_>>(), | |
| 406 | 406 | ) |
| 407 | 407 | .await? |
| 408 | 408 | .map(|labels| { |
| @@ -1451,9 +1451,9 @@ impl<'a> PathComponentSlice<'a> { · 1450 unmodified lines | ||
| 1451 | 1451 | matches.next(); |
| 1452 | 1452 | } |
| 1453 | 1453 | if is_first_normal || is_last || !is_normal || contains_match { |
| 1454 | − if !longest | |
| 1454 | + if longest | |
| 1455 | 1455 | .as_ref() |
| 1456 | − .is_some_and(|old| old.end - old.start > cur.end - cur.start) | |
| 1456 | + .is_none_or(|old| old.end - old.start <= cur.end - cur.start) | |
| 1457 | 1457 | { |
| 1458 | 1458 | longest = Some(cur); |
| 1459 | 1459 | } |
| @@ -1462,9 +1462,9 @@ impl<'a> PathComponentSlice<'a> { · 2 unmodified lines | ||
| 1462 | 1462 | cur.end = i + 1; |
| 1463 | 1463 | } |
| 1464 | 1464 | } |
| 1465 | − if !longest | |
| 1465 | + if longest | |
| 1466 | 1466 | .as_ref() |
| 1467 | − .is_some_and(|old| old.end - old.start > cur.end - cur.start) | |
| 1467 | + .is_none_or(|old| old.end - old.start <= cur.end - cur.start) | |
| 1468 | 1468 | { |
| 1469 | 1469 | longest = Some(cur); |
| 1470 | 1470 | } |
| @@ -108,7 +108,7 @@ impl Match { · 107 unmodified lines | ||
| 108 | 108 | fn styled_text(&self, project: &Project, window: &Window, cx: &App) -> StyledText { |
| 109 | 109 | let mut text = "./".to_string(); |
| 110 | 110 | let mut highlights = Vec::new(); |
| 111 | − let mut offset = text.as_bytes().len(); | |
| 111 | + let mut offset = text.len(); | |
| 112 | 112 | |
| 113 | 113 | let separator = '/'; |
| 114 | 114 | let dir_indicator = "[…]"; |
| @@ -125,7 +125,7 @@ impl Match { · 10 unmodified lines | ||
| 125 | 125 | highlights.push((range.start + offset..range.end + offset, style)) |
| 126 | 126 | } |
| 127 | 127 | text.push(separator); |
| 128 | − offset = text.as_bytes().len(); | |
| 128 | + offset = text.len(); | |
| 129 | 129 | |
| 130 | 130 | if let Some(suffix) = &self.suffix { |
| 131 | 131 | text.push_str(suffix); |
| @@ -140,10 +140,10 @@ impl Match { · 8 unmodified lines | ||
| 140 | 140 | Color::Created |
| 141 | 141 | }; |
| 142 | 142 | highlights.push(( |
| 143 | − offset..offset + suffix.as_bytes().len(), | |
| 143 | + offset..offset + suffix.len(), | |
| 144 | 144 | HighlightStyle::color(color.color(cx)), |
| 145 | 145 | )); |
| 146 | − offset += suffix.as_bytes().len(); | |
| 146 | + offset += suffix.len(); | |
| 147 | 147 | if entry.is_some_and(|e| e.is_dir()) { |
| 148 | 148 | text.push(separator); |
| 149 | 149 | offset += separator.len_utf8(); |
| @@ -165,7 +165,7 @@ impl Match { · 15 unmodified lines | ||
| 165 | 165 | text.push_str(suffix); |
| 166 | 166 | let existing_prefix_len = self |
| 167 | 167 | .existing_prefix(project, cx) |
| 168 | − .map(|prefix| prefix.to_string_lossy().as_bytes().len()) | |
| 168 | + .map(|prefix| prefix.to_string_lossy().len()) | |
| 169 | 169 | .unwrap_or(0); |
| 170 | 170 | |
| 171 | 171 | if existing_prefix_len > 0 { |
| @@ -175,14 +175,14 @@ impl Match { · 3 unmodified lines | ||
| 175 | 175 | )); |
| 176 | 176 | } |
| 177 | 177 | highlights.push(( |
| 178 | − offset + existing_prefix_len..offset + suffix.as_bytes().len(), | |
| 178 | + offset + existing_prefix_len..offset + suffix.len(), | |
| 179 | 179 | HighlightStyle::color(if self.entry(project, cx).is_some() { |
| 180 | 180 | Color::Conflict.color(cx) |
| 181 | 181 | } else { |
| 182 | 182 | Color::Created.color(cx) |
| 183 | 183 | }), |
| 184 | 184 | )); |
| 185 | − offset += suffix.as_bytes().len(); | |
| 185 | + offset += suffix.len(); | |
| 186 | 186 | if suffix.ends_with('/') { |
| 187 | 187 | text.push_str(dir_indicator); |
| 188 | 188 | highlights.push(( |
| @@ -1261,7 +1261,7 @@ impl FakeFs { · 1260 unmodified lines | ||
| 1261 | 1261 | self.with_git_state(dot_git, true, |state| { |
| 1262 | 1262 | let branch = branch.map(Into::into); |
| 1263 | 1263 | state.branches.extend(branch.clone()); |
| 1264 | − state.current_branch_name = branch.map(Into::into) | |
| 1264 | + state.current_branch_name = branch | |
| 1265 | 1265 | }) |
| 1266 | 1266 | } |
| 1267 | 1267 | |
| @@ -140,7 +140,7 @@ pub async fn match_path_sets<'a, Set: PathMatchCandidateSet<'a>>( · 139 unmodified lines | ||
| 140 | 140 | let query_char_bag = CharBag::from(&lowercase_query[..]); |
| 141 | 141 | |
| 142 | 142 | let num_cpus = executor.num_cpus().min(path_count); |
| 143 | − let segment_size = (path_count + num_cpus - 1) / num_cpus; | |
| 143 | + let segment_size = path_count.div_ceil(num_cpus); | |
| 144 | 144 | let mut segment_results = (0..num_cpus) |
| 145 | 145 | .map(|_| Vec::with_capacity(max_results)) |
| 146 | 146 | .collect::<Vec<_>>(); |
| @@ -145,7 +145,7 @@ pub async fn match_strings( · 144 unmodified lines | ||
| 145 | 145 | let query_char_bag = CharBag::from(&lowercase_query[..]); |
| 146 | 146 | |
| 147 | 147 | let num_cpus = executor.num_cpus().min(candidates.len()); |
| 148 | − let segment_size = (candidates.len() + num_cpus - 1) / num_cpus; | |
| 148 | + let segment_size = candidates.len().div_ceil(num_cpus); | |
| 149 | 149 | let mut segment_results = (0..num_cpus) |
| 150 | 150 | .map(|_| Vec::with_capacity(max_results.min(candidates.len()))) |
| 151 | 151 | .collect::<Vec<_>>(); |
| @@ -344,7 +344,7 @@ mod tests { · 343 unmodified lines | ||
| 344 | 344 | have_json.push('\n'); |
| 345 | 345 | |
| 346 | 346 | let update = std::env::var("UPDATE_GOLDEN") |
| 347 | − .map(|val| val.to_ascii_lowercase() == "true") | |
| 347 | + .map(|val| val.eq_ignore_ascii_case("true")) | |
| 348 | 348 | .unwrap_or(false); |
| 349 | 349 | |
| 350 | 350 | if update { |
| @@ -1019,7 +1019,7 @@ impl Borrow<Path> for RepoPath { · 1018 unmodified lines | ||
| 1019 | 1019 | #[derive(Debug)] |
| 1020 | 1020 | pub struct RepoPathDescendants<'a>(pub &'a Path); |
| 1021 | 1021 | |
| 1022 | −impl<'a> MapSeekTarget<RepoPath> for RepoPathDescendants<'a> { | |
| 1022 | +impl MapSeekTarget<RepoPath> for RepoPathDescendants<'_> { | |
| 1023 | 1023 | fn cmp_cursor(&self, key: &RepoPath) -> Ordering { |
| 1024 | 1024 | if key.starts_with(self.0) { |
| 1025 | 1025 | Ordering::Greater |
| @@ -553,7 +553,7 @@ impl GitPanel { · 552 unmodified lines | ||
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | fn select_first(&mut self, _: &SelectFirst, _window: &mut Window, cx: &mut Context<Self>) { |
| 556 | − if self.entries.first().is_some() { | |
| 556 | + if !self.entries.is_empty() { | |
| 557 | 557 | self.selected_entry = Some(1); |
| 558 | 558 | self.scroll_to_selected_entry(cx); |
| 559 | 559 | } |
| @@ -82,7 +82,7 @@ impl AppCell { · 81 unmodified lines | ||
| 82 | 82 | #[derive(Deref, DerefMut)] |
| 83 | 83 | pub struct AppRef<'a>(Ref<'a, App>); |
| 84 | 84 | |
| 85 | −impl<'a> Drop for AppRef<'a> { | |
| 85 | +impl Drop for AppRef<'_> { | |
| 86 | 86 | fn drop(&mut self) { |
| 87 | 87 | if option_env!("TRACK_THREAD_BORROWS").is_some() { |
| 88 | 88 | let thread_id = std::thread::current().id(); |
| @@ -95,7 +95,7 @@ impl<'a> Drop for AppRef<'a> { · 6 unmodified lines | ||
| 95 | 95 | #[derive(Deref, DerefMut)] |
| 96 | 96 | pub struct AppRefMut<'a>(RefMut<'a, App>); |
| 97 | 97 | |
| 98 | −impl<'a> Drop for AppRefMut<'a> { | |
| 98 | +impl Drop for AppRefMut<'_> { | |
| 99 | 99 | fn drop(&mut self) { |
| 100 | 100 | if option_env!("TRACK_THREAD_BORROWS").is_some() { |
| 101 | 101 | let thread_id = std::thread::current().id(); |
| @@ -649,7 +649,7 @@ impl<'a, T: 'static> Context<'a, T> { · 648 unmodified lines | ||
| 649 | 649 | } |
| 650 | 650 | } |
| 651 | 651 | |
| 652 | −impl<'a, T> Context<'a, T> { | |
| 652 | +impl<T> Context<'_, T> { | |
| 653 | 653 | /// Emit an event of the specified type, which can be handled by other entities that have subscribed via `subscribe` methods on their respective contexts. |
| 654 | 654 | pub fn emit<Evt>(&mut self, event: Evt) |
| 655 | 655 | where |
| @@ -664,7 +664,7 @@ impl<'a, T> Context<'a, T> { · 8 unmodified lines | ||
| 664 | 664 | } |
| 665 | 665 | } |
| 666 | 666 | |
| 667 | −impl<'a, T> AppContext for Context<'a, T> { | |
| 667 | +impl<T> AppContext for Context<'_, T> { | |
| 668 | 668 | type Result<U> = U; |
| 669 | 669 | |
| 670 | 670 | fn new<U: 'static>( |
| @@ -191,7 +191,7 @@ pub(crate) struct Lease<'a, T> { · 190 unmodified lines | ||
| 191 | 191 | entity_type: PhantomData<T>, |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | −impl<'a, T: 'static> core::ops::Deref for Lease<'a, T> { | |
| 194 | +impl<T: 'static> core::ops::Deref for Lease<'_, T> { | |
| 195 | 195 | type Target = T; |
| 196 | 196 | |
| 197 | 197 | fn deref(&self) -> &Self::Target { |
| @@ -199,13 +199,13 @@ impl<'a, T: 'static> core::ops::Deref for Lease<'a, T> { · 1 unmodified line | ||
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | −impl<'a, T: 'static> core::ops::DerefMut for Lease<'a, T> { | |
| 202 | +impl<T: 'static> core::ops::DerefMut for Lease<'_, T> { | |
| 203 | 203 | fn deref_mut(&mut self) -> &mut Self::Target { |
| 204 | 204 | self.entity.as_mut().unwrap().downcast_mut().unwrap() |
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | −impl<'a, T> Drop for Lease<'a, T> { | |
| 208 | +impl<T> Drop for Lease<'_, T> { | |
| 209 | 209 | fn drop(&mut self) { |
| 210 | 210 | if self.entity.is_some() && !panicking() { |
| 211 | 211 | panic!("Leases must be ended with EntityMap::end_lease") |
| @@ -82,7 +82,7 @@ impl From<Rgba> for u32 { · 81 unmodified lines | ||
| 82 | 82 | |
| 83 | 83 | struct RgbaVisitor; |
| 84 | 84 | |
| 85 | −impl<'de> Visitor<'de> for RgbaVisitor { | |
| 85 | +impl Visitor<'_> for RgbaVisitor { | |
| 86 | 86 | type Value = Rgba; |
| 87 | 87 | |
| 88 | 88 | fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| @@ -180,7 +180,7 @@ impl TryFrom<&'_ str> for Rgba { · 91 unmodified lines | ||
| 180 | 180 | /// Duplicates a given hex digit. |
| 181 | 181 | /// E.g., `0xf` -> `0xff`. |
| 182 | 182 | const fn duplicate(value: u8) -> u8 { |
| 183 | − value << 4 | value | |
| 183 | + (value << 4) | value | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | (duplicate(r), duplicate(g), duplicate(b), duplicate(a)) |
| @@ -946,13 +946,13 @@ impl<'a> sum_tree::Dimension<'a, ListItemSummary> for Height { · 945 unmodified lines | ||
| 946 | 946 | } |
| 947 | 947 | } |
| 948 | 948 | |
| 949 | −impl<'a> sum_tree::SeekTarget<'a, ListItemSummary, ListItemSummary> for Count { | |
| 949 | +impl sum_tree::SeekTarget<'_, ListItemSummary, ListItemSummary> for Count { | |
| 950 | 950 | fn cmp(&self, other: &ListItemSummary, _: &()) -> std::cmp::Ordering { |
| 951 | 951 | self.0.partial_cmp(&other.count).unwrap() |
| 952 | 952 | } |
| 953 | 953 | } |
| 954 | 954 | |
| 955 | −impl<'a> sum_tree::SeekTarget<'a, ListItemSummary, ListItemSummary> for Height { | |
| 955 | +impl sum_tree::SeekTarget<'_, ListItemSummary, ListItemSummary> for Height { | |
| 956 | 956 | fn cmp(&self, other: &ListItemSummary, _: &()) -> std::cmp::Ordering { |
| 957 | 957 | self.0.partial_cmp(&other.height).unwrap() |
| 958 | 958 | } |
| @@ -587,7 +587,7 @@ impl<'a> Scope<'a> { · 586 unmodified lines | ||
| 587 | 587 | } |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | −impl<'a> Drop for Scope<'a> { | |
| 590 | +impl Drop for Scope<'_> { | |
| 591 | 591 | fn drop(&mut self) { |
| 592 | 592 | self.tx.take().unwrap(); |
| 593 | 593 | |
| @@ -5,7 +5,6 @@ use objc::{class, msg_send, sel, sel_impl}; · 4 unmodified lines | ||
| 5 | 5 | /// The `cocoa` crate does not define NSAttributedString (and related Cocoa classes), |
| 6 | 6 | /// which are needed for copying rich text (that is, text intermingled with images) |
| 7 | 7 | /// to the clipboard. This adds access to those APIs. |
| 8 | − | |
| 9 | 8 | #[allow(non_snake_case)] |
| 10 | 9 | pub trait NSAttributedString: Sized { |
| 11 | 10 | unsafe fn alloc(_: Self) -> id { |
| @@ -26,7 +26,7 @@ pub(crate) mod dispatch_sys { · 25 unmodified lines | ||
| 26 | 26 | |
| 27 | 27 | use dispatch_sys::*; |
| 28 | 28 | pub(crate) fn dispatch_get_main_queue() -> dispatch_queue_t { |
| 29 | − unsafe { addr_of!(_dispatch_main_q) as *const _ as dispatch_queue_t } | |
| 29 | + addr_of!(_dispatch_main_q) as *const _ as dispatch_queue_t | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | pub(crate) struct MacDispatcher { |
| @@ -1221,10 +1221,10 @@ fn set_window_composition_attribute(hwnd: HWND, color: Option<Color>, state: u32 · 1220 unmodified lines | ||
| 1221 | 1221 | unsafe { |
| 1222 | 1222 | type SetWindowCompositionAttributeType = |
| 1223 | 1223 | unsafe extern "system" fn(HWND, *mut WINDOWCOMPOSITIONATTRIBDATA) -> BOOL; |
| 1224 | − let module_name = PCSTR::from_raw("user32.dll\0".as_ptr()); | |
| 1224 | + let module_name = PCSTR::from_raw(c"user32.dll".as_ptr() as *const u8); | |
| 1225 | 1225 | let user32 = GetModuleHandleA(module_name); |
| 1226 | 1226 | if user32.is_ok() { |
| 1227 | − let func_name = PCSTR::from_raw("SetWindowCompositionAttribute\0".as_ptr()); | |
| 1227 | + let func_name = PCSTR::from_raw(c"SetWindowCompositionAttribute".as_ptr() as *const u8); | |
| 1228 | 1228 | let set_window_composition_attribute: SetWindowCompositionAttributeType = |
| 1229 | 1229 | std::mem::transmute(GetProcAddress(user32.unwrap(), func_name)); |
| 1230 | 1230 | let mut color = color.unwrap_or_default(); |
| @@ -1238,7 +1238,7 @@ fn set_window_composition_attribute(hwnd: HWND, color: Option<Color>, state: u32 · 7 unmodified lines | ||
| 1238 | 1238 | gradient_color: (color.0 as u32) |
| 1239 | 1239 | | ((color.1 as u32) << 8) |
| 1240 | 1240 | | ((color.2 as u32) << 16) |
| 1241 | − | (color.3 as u32) << 24, | |
| 1241 | + | ((color.3 as u32) << 24), | |
| 1242 | 1242 | animation_id: 0, |
| 1243 | 1243 | }; |
| 1244 | 1244 | let mut data = WINDOWCOMPOSITIONATTRIBDATA { |
| @@ -670,6 +670,15 @@ pub struct TextRun { · 669 unmodified lines | ||
| 670 | 670 | pub strikethrough: Option<StrikethroughStyle>, |
| 671 | 671 | } |
| 672 | 672 | |
| 673 | +#[cfg(all(target_os = "macos", test))] | |
| 674 | +impl TextRun { | |
| 675 | + fn with_len(&self, len: usize) -> Self { | |
| 676 | + let mut this = self.clone(); | |
| 677 | + this.len = len; | |
| 678 | + this | |
| 679 | + } | |
| 680 | +} | |
| 681 | + | |
| 673 | 682 | /// An identifier for a specific glyph, as returned by [`TextSystem::layout_line`]. |
| 674 | 683 | #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)] |
| 675 | 684 | #[repr(C)] |
| @@ -601,15 +601,15 @@ struct CacheKeyRef<'a> { · 600 unmodified lines | ||
| 601 | 601 | wrap_width: Option<Pixels>, |
| 602 | 602 | } |
| 603 | 603 | |
| 604 | −impl<'a> PartialEq for (dyn AsCacheKeyRef + 'a) { | |
| 604 | +impl PartialEq for (dyn AsCacheKeyRef + '_) { | |
| 605 | 605 | fn eq(&self, other: &dyn AsCacheKeyRef) -> bool { |
| 606 | 606 | self.as_cache_key_ref() == other.as_cache_key_ref() |
| 607 | 607 | } |
| 608 | 608 | } |
| 609 | 609 | |
| 610 | −impl<'a> Eq for (dyn AsCacheKeyRef + 'a) {} | |
| 610 | +impl Eq for (dyn AsCacheKeyRef + '_) {} | |
| 611 | 611 | |
| 612 | −impl<'a> Hash for (dyn AsCacheKeyRef + 'a) { | |
| 612 | +impl Hash for (dyn AsCacheKeyRef + '_) { | |
| 613 | 613 | fn hash<H: Hasher>(&self, state: &mut H) { |
| 614 | 614 | self.as_cache_key_ref().hash(state) |
| 615 | 615 | } |
| @@ -644,7 +644,7 @@ impl<'a> Borrow<dyn AsCacheKeyRef + 'a> for Arc<CacheKey> { · 28 unmodified lines | ||
| 644 | 644 | } |
| 645 | 645 | } |
| 646 | 646 | |
| 647 | −impl<'a> AsCacheKeyRef for CacheKeyRef<'a> { | |
| 647 | +impl AsCacheKeyRef for CacheKeyRef<'_> { | |
| 648 | 648 | fn as_cache_key_ref(&self) -> CacheKeyRef { |
| 649 | 649 | *self |
| 650 | 650 | } |
| @@ -543,14 +543,6 @@ mod tests { · 542 unmodified lines | ||
| 543 | 543 | background_color: None, |
| 544 | 544 | }; |
| 545 | 545 | |
| 546 | − impl TextRun { | |
| 547 | − fn with_len(&self, len: usize) -> Self { | |
| 548 | − let mut this = self.clone(); | |
| 549 | − this.len = len; | |
| 550 | − this | |
| 551 | − } | |
| 552 | − } | |
| 553 | − | |
| 554 | 546 | let text = "aa bbb cccc ddddd eeee".into(); |
| 555 | 547 | let lines = text_system |
| 556 | 548 | .shape_text( |
| @@ -72,7 +72,7 @@ where · 71 unmodified lines | ||
| 72 | 72 | pub struct CwdBacktrace<'a>(pub &'a backtrace::Backtrace); |
| 73 | 73 | |
| 74 | 74 | #[cfg(any(test, feature = "test-support"))] |
| 75 | −impl<'a> std::fmt::Debug for CwdBacktrace<'a> { | |
| 75 | +impl std::fmt::Debug for CwdBacktrace<'_> { | |
| 76 | 76 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 77 | 77 | use backtrace::{BacktraceFmt, BytesOrWideString}; |
| 78 | 78 | |
| @@ -3689,8 +3689,6 @@ impl Window { · 3688 unmodified lines | ||
| 3689 | 3689 | dispatch_tree.bindings_for_action(action, &[context]) |
| 3690 | 3690 | } |
| 3691 | 3691 | |
| 3692 | − /// Returns a generic event listener that invokes the given listener with the view and context associated with the given view handle. | |
| 3693 | − | |
| 3694 | 3692 | /// Returns a generic event listener that invokes the given listener with the view and context associated with the given view handle. |
| 3695 | 3693 | pub fn listener_for<V: Render, E>( |
| 3696 | 3694 | &self, |
| @@ -79,7 +79,7 @@ pub trait HttpClient: 'static + Send + Sync { · 78 unmodified lines | ||
| 79 | 79 | .body(body); |
| 80 | 80 | |
| 81 | 81 | match request { |
| 82 | − Ok(request) => Box::pin(async move { self.send(request).await.map_err(Into::into) }), | |
| 82 | + Ok(request) => Box::pin(async move { self.send(request).await }), | |
| 83 | 83 | Err(e) => Box::pin(async move { Err(e.into()) }), |
| 84 | 84 | } |
| 85 | 85 | } |
| @@ -96,7 +96,7 @@ pub trait HttpClient: 'static + Send + Sync { · 10 unmodified lines | ||
| 96 | 96 | .body(body); |
| 97 | 97 | |
| 98 | 98 | match request { |
| 99 | − Ok(request) => Box::pin(async move { self.send(request).await.map_err(Into::into) }), | |
| 99 | + Ok(request) => Box::pin(async move { self.send(request).await }), | |
| 100 | 100 | Err(e) => Box::pin(async move { Err(e.into()) }), |
| 101 | 101 | } |
| 102 | 102 | } |
| @@ -509,7 +509,7 @@ impl fmt::Debug for ChunkRenderer { · 508 unmodified lines | ||
| 509 | 509 | } |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | −impl<'a, 'b> Deref for ChunkRendererContext<'a, 'b> { | |
| 512 | +impl Deref for ChunkRendererContext<'_, '_> { | |
| 513 | 513 | type Target = App; |
| 514 | 514 | |
| 515 | 515 | fn deref(&self) -> &Self::Target { |
| @@ -517,7 +517,7 @@ impl<'a, 'b> Deref for ChunkRendererContext<'a, 'b> { · 1 unmodified line | ||
| 517 | 517 | } |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | −impl<'a, 'b> DerefMut for ChunkRendererContext<'a, 'b> { | |
| 520 | +impl DerefMut for ChunkRendererContext<'_, '_> { | |
| 521 | 521 | fn deref_mut(&mut self) -> &mut Self::Target { |
| 522 | 522 | self.context |
| 523 | 523 | } |
| @@ -4137,7 +4137,7 @@ impl Deref for BufferSnapshot { · 3613 unmodified lines | ||
| 4137 | 4137 | } |
| 4138 | 4138 | } |
| 4139 | 4139 | |
| 4140 | −unsafe impl<'a> Send for BufferChunks<'a> {} | |
| 4140 | +unsafe impl Send for BufferChunks<'_> {} | |
| 4141 | 4141 | |
| 4142 | 4142 | impl<'a> BufferChunks<'a> { |
| 4143 | 4143 | pub(crate) fn new( |
| @@ -836,7 +836,7 @@ impl SyntaxSnapshot { · 835 unmodified lines | ||
| 836 | 836 | } |
| 837 | 837 | |
| 838 | 838 | #[cfg(test)] |
| 839 | − pub fn layers<'a>(&'a self, buffer: &'a BufferSnapshot) -> Vec<SyntaxLayer> { | |
| 839 | + pub fn layers<'a>(&'a self, buffer: &'a BufferSnapshot) -> Vec<SyntaxLayer<'a>> { | |
| 840 | 840 | self.layers_for_range(0..buffer.len(), buffer, true) |
| 841 | 841 | .collect() |
| 842 | 842 | } |
| @@ -1142,7 +1142,7 @@ impl<'a> SyntaxMapMatches<'a> { · 299 unmodified lines | ||
| 1142 | 1142 | } |
| 1143 | 1143 | } |
| 1144 | 1144 | |
| 1145 | −impl<'a> SyntaxMapCapturesLayer<'a> { | |
| 1145 | +impl SyntaxMapCapturesLayer<'_> { | |
| 1146 | 1146 | fn advance(&mut self) { |
| 1147 | 1147 | self.next_capture = self.captures.next().map(|(mat, ix)| mat.captures[*ix]); |
| 1148 | 1148 | } |
| @@ -1157,7 +1157,7 @@ impl<'a> SyntaxMapCapturesLayer<'a> { · 8 unmodified lines | ||
| 1157 | 1157 | } |
| 1158 | 1158 | } |
| 1159 | 1159 | |
| 1160 | −impl<'a> SyntaxMapMatchesLayer<'a> { | |
| 1160 | +impl SyntaxMapMatchesLayer<'_> { | |
| 1161 | 1161 | fn advance(&mut self) { |
| 1162 | 1162 | if let Some(mat) = self.matches.next() { |
| 1163 | 1163 | self.next_captures.clear(); |
| @@ -1740,7 +1740,7 @@ impl sum_tree::Summary for SyntaxLayerSummary { · 576 unmodified lines | ||
| 1740 | 1740 | } |
| 1741 | 1741 | } |
| 1742 | 1742 | |
| 1743 | −impl<'a> SeekTarget<'a, SyntaxLayerSummary, SyntaxLayerSummary> for SyntaxLayerPosition { | |
| 1743 | +impl SeekTarget<'_, SyntaxLayerSummary, SyntaxLayerSummary> for SyntaxLayerPosition { | |
| 1744 | 1744 | fn cmp(&self, cursor_location: &SyntaxLayerSummary, buffer: &BufferSnapshot) -> Ordering { |
| 1745 | 1745 | Ord::cmp(&self.depth, &cursor_location.max_depth) |
| 1746 | 1746 | .then_with(|| { |
| @@ -1758,16 +1758,14 @@ impl<'a> SeekTarget<'a, SyntaxLayerSummary, SyntaxLayerSummary> for SyntaxLayerP · 11 unmodified lines | ||
| 1758 | 1758 | } |
| 1759 | 1759 | } |
| 1760 | 1760 | |
| 1761 | −impl<'a> SeekTarget<'a, SyntaxLayerSummary, SyntaxLayerSummary> for ChangeStartPosition { | |
| 1761 | +impl SeekTarget<'_, SyntaxLayerSummary, SyntaxLayerSummary> for ChangeStartPosition { | |
| 1762 | 1762 | fn cmp(&self, cursor_location: &SyntaxLayerSummary, text: &BufferSnapshot) -> Ordering { |
| 1763 | 1763 | Ord::cmp(&self.depth, &cursor_location.max_depth) |
| 1764 | 1764 | .then_with(|| self.position.cmp(&cursor_location.range.end, text)) |
| 1765 | 1765 | } |
| 1766 | 1766 | } |
| 1767 | 1767 | |
| 1768 | −impl<'a> SeekTarget<'a, SyntaxLayerSummary, SyntaxLayerSummary> | |
| 1769 | − for SyntaxLayerPositionBeforeChange | |
| 1770 | −{ | |
| 1768 | +impl SeekTarget<'_, SyntaxLayerSummary, SyntaxLayerSummary> for SyntaxLayerPositionBeforeChange { | |
| 1771 | 1769 | fn cmp(&self, cursor_location: &SyntaxLayerSummary, buffer: &BufferSnapshot) -> Ordering { |
| 1772 | 1770 | if self.change.cmp(cursor_location, buffer).is_le() { |
| 1773 | 1771 | Ordering::Less |
| @@ -1869,7 +1867,7 @@ struct LogPoint(Point); · 95 unmodified lines | ||
| 1869 | 1867 | struct LogAnchorRange<'a>(&'a Range<Anchor>, &'a text::BufferSnapshot); |
| 1870 | 1868 | struct LogChangedRegions<'a>(&'a ChangeRegionSet, &'a text::BufferSnapshot); |
| 1871 | 1869 | |
| 1872 | −impl<'a> fmt::Debug for LogIncludedRanges<'a> { | |
| 1870 | +impl fmt::Debug for LogIncludedRanges<'_> { | |
| 1873 | 1871 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 1874 | 1872 | f.debug_list() |
| 1875 | 1873 | .entries(self.0.iter().map(|range| { |
| @@ -1881,14 +1879,14 @@ impl<'a> fmt::Debug for LogIncludedRanges<'a> { · 5 unmodified lines | ||
| 1881 | 1879 | } |
| 1882 | 1880 | } |
| 1883 | 1881 | |
| 1884 | −impl<'a> fmt::Debug for LogAnchorRange<'a> { | |
| 1882 | +impl fmt::Debug for LogAnchorRange<'_> { | |
| 1885 | 1883 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 1886 | 1884 | let range = self.0.to_point(self.1); |
| 1887 | 1885 | (LogPoint(range.start)..LogPoint(range.end)).fmt(f) |
| 1888 | 1886 | } |
| 1889 | 1887 | } |
| 1890 | 1888 | |
| 1891 | −impl<'a> fmt::Debug for LogChangedRegions<'a> { | |
| 1889 | +impl fmt::Debug for LogChangedRegions<'_> { | |
| 1892 | 1890 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 1893 | 1891 | f.debug_list() |
| 1894 | 1892 | .entries( |
| @@ -305,13 +305,7 @@ impl LspAdapter for ExtensionLspAdapter { · 304 unmodified lines | ||
| 305 | 305 | .labels_for_symbols(self.language_server_id.clone(), symbols) |
| 306 | 306 | .await?; |
| 307 | 307 | |
| 308 | − Ok(labels_from_extension( | |
| 309 | − labels | |
| 310 | − .into_iter() | |
| 311 | − .map(|label| label.map(Into::into)) | |
| 312 | − .collect(), | |
| 313 | − language, | |
| 314 | − )) | |
| 308 | + Ok(labels_from_extension(labels, language)) | |
| 315 | 309 | } |
| 316 | 310 | } |
| 317 | 311 | |
| @@ -153,8 +153,8 @@ impl LlmApiToken { · 152 unmodified lines | ||
| 153 | 153 | Self::fetch(self.0.write().await, client).await |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | − async fn fetch<'a>( | |
| 157 | − mut lock: RwLockWriteGuard<'a, Option<String>>, | |
| 156 | + async fn fetch( | |
| 157 | + mut lock: RwLockWriteGuard<'_, Option<String>>, | |
| 158 | 158 | client: &Arc<Client>, |
| 159 | 159 | ) -> Result<String> { |
| 160 | 160 | let response = client.request(proto::GetLlmToken {}).await?; |
| @@ -684,7 +684,7 @@ impl<'a> EnvironmentApi<'a> { · 683 unmodified lines | ||
| 684 | 684 | } |
| 685 | 685 | } |
| 686 | 686 | |
| 687 | −impl<'a> pet_core::os_environment::Environment for EnvironmentApi<'a> { | |
| 687 | +impl pet_core::os_environment::Environment for EnvironmentApi<'_> { | |
| 688 | 688 | fn get_user_home(&self) -> Option<PathBuf> { |
| 689 | 689 | self.user_home() |
| 690 | 690 | } |
| @@ -6896,7 +6896,7 @@ impl<'a> sum_tree::Dimension<'a, ExcerptSummary> for ExcerptOffset { · 6895 unmodified lines | ||
| 6896 | 6896 | } |
| 6897 | 6897 | } |
| 6898 | 6898 | |
| 6899 | −impl<'a> sum_tree::SeekTarget<'a, ExcerptSummary, ExcerptSummary> for ExcerptOffset { | |
| 6899 | +impl sum_tree::SeekTarget<'_, ExcerptSummary, ExcerptSummary> for ExcerptOffset { | |
| 6900 | 6900 | fn cmp(&self, cursor_location: &ExcerptSummary, _: &()) -> cmp::Ordering { |
| 6901 | 6901 | Ord::cmp(&self.value, &cursor_location.text.len) |
| 6902 | 6902 | } |
| @@ -6908,7 +6908,7 @@ impl<'a> sum_tree::SeekTarget<'a, ExcerptSummary, Option<&'a Locator>> for Locat · 5 unmodified lines | ||
| 6908 | 6908 | } |
| 6909 | 6909 | } |
| 6910 | 6910 | |
| 6911 | −impl<'a> sum_tree::SeekTarget<'a, ExcerptSummary, ExcerptSummary> for Locator { | |
| 6911 | +impl sum_tree::SeekTarget<'_, ExcerptSummary, ExcerptSummary> for Locator { | |
| 6912 | 6912 | fn cmp(&self, cursor_location: &ExcerptSummary, _: &()) -> cmp::Ordering { |
| 6913 | 6913 | Ord::cmp(self, &cursor_location.excerpt_locator) |
| 6914 | 6914 | } |
| @@ -6982,16 +6982,16 @@ impl<'a> sum_tree::Dimension<'a, DiffTransformSummary> for ExcerptPoint { · 67 unmodified lines | ||
| 6982 | 6982 | } |
| 6983 | 6983 | } |
| 6984 | 6984 | |
| 6985 | −impl<'a, D: TextDimension + Ord> | |
| 6986 | − sum_tree::SeekTarget<'a, DiffTransformSummary, DiffTransformSummary> for ExcerptDimension<D> | |
| 6985 | +impl<D: TextDimension + Ord> sum_tree::SeekTarget<'_, DiffTransformSummary, DiffTransformSummary> | |
| 6986 | + for ExcerptDimension<D> | |
| 6987 | 6987 | { |
| 6988 | 6988 | fn cmp(&self, cursor_location: &DiffTransformSummary, _: &()) -> cmp::Ordering { |
| 6989 | 6989 | Ord::cmp(&self.0, &D::from_text_summary(&cursor_location.input)) |
| 6990 | 6990 | } |
| 6991 | 6991 | } |
| 6992 | 6992 | |
| 6993 | −impl<'a, D: TextDimension + Ord> | |
| 6994 | − sum_tree::SeekTarget<'a, DiffTransformSummary, (OutputDimension<D>, ExcerptDimension<D>)> | |
| 6993 | +impl<D: TextDimension + Ord> | |
| 6994 | + sum_tree::SeekTarget<'_, DiffTransformSummary, (OutputDimension<D>, ExcerptDimension<D>)> | |
| 6995 | 6995 | for ExcerptDimension<D> |
| 6996 | 6996 | { |
| 6997 | 6997 | fn cmp( |
| @@ -7053,14 +7053,14 @@ impl<'a> sum_tree::Dimension<'a, DiffTransformSummary> for Point { · 55 unmodified lines | ||
| 7053 | 7053 | } |
| 7054 | 7054 | } |
| 7055 | 7055 | |
| 7056 | −impl<'a> MultiBufferRows<'a> { | |
| 7056 | +impl MultiBufferRows<'_> { | |
| 7057 | 7057 | pub fn seek(&mut self, MultiBufferRow(row): MultiBufferRow) { |
| 7058 | 7058 | self.point = Point::new(row, 0); |
| 7059 | 7059 | self.cursor.seek(&self.point); |
| 7060 | 7060 | } |
| 7061 | 7061 | } |
| 7062 | 7062 | |
| 7063 | −impl<'a> Iterator for MultiBufferRows<'a> { | |
| 7063 | +impl Iterator for MultiBufferRows<'_> { | |
| 7064 | 7064 | type Item = RowInfo; |
| 7065 | 7065 | |
| 7066 | 7066 | fn next(&mut self) -> Option<Self::Item> { |
| @@ -7304,7 +7304,7 @@ impl<'a> Iterator for MultiBufferChunks<'a> { · 237 unmodified lines | ||
| 7304 | 7304 | } |
| 7305 | 7305 | } |
| 7306 | 7306 | |
| 7307 | −impl<'a> MultiBufferBytes<'a> { | |
| 7307 | +impl MultiBufferBytes<'_> { | |
| 7308 | 7308 | fn consume(&mut self, len: usize) { |
| 7309 | 7309 | self.range.start += len; |
| 7310 | 7310 | self.chunk = &self.chunk[len..]; |
| @@ -7351,7 +7351,7 @@ impl<'a> Iterator for MultiBufferBytes<'a> { · 40 unmodified lines | ||
| 7351 | 7351 | } |
| 7352 | 7352 | } |
| 7353 | 7353 | |
| 7354 | −impl<'a> io::Read for MultiBufferBytes<'a> { | |
| 7354 | +impl io::Read for MultiBufferBytes<'_> { | |
| 7355 | 7355 | fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { |
| 7356 | 7356 | let len = cmp::min(buf.len(), self.chunk.len()); |
| 7357 | 7357 | buf[..len].copy_from_slice(&self.chunk[..len]); |
| @@ -7362,7 +7362,7 @@ impl<'a> io::Read for MultiBufferBytes<'a> { · 4 unmodified lines | ||
| 7362 | 7362 | } |
| 7363 | 7363 | } |
| 7364 | 7364 | |
| 7365 | −impl<'a> io::Read for ReversedMultiBufferBytes<'a> { | |
| 7365 | +impl io::Read for ReversedMultiBufferBytes<'_> { | |
| 7366 | 7366 | fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { |
| 7367 | 7367 | let len = cmp::min(buf.len(), self.chunk.len()); |
| 7368 | 7368 | buf[..len].copy_from_slice(&self.chunk[..len]); |
| @@ -469,7 +469,7 @@ impl sum_tree::Summary for NotificationSummary { · 468 unmodified lines | ||
| 469 | 469 | } |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | −impl<'a> sum_tree::Dimension<'a, NotificationSummary> for NotificationId { | |
| 472 | +impl sum_tree::Dimension<'_, NotificationSummary> for NotificationId { | |
| 473 | 473 | fn zero(_cx: &()) -> Self { |
| 474 | 474 | Default::default() |
| 475 | 475 | } |
| @@ -480,7 +480,7 @@ impl<'a> sum_tree::Dimension<'a, NotificationSummary> for NotificationId { · 4 unmodified lines | ||
| 480 | 480 | } |
| 481 | 481 | } |
| 482 | 482 | |
| 483 | −impl<'a> sum_tree::Dimension<'a, NotificationSummary> for Count { | |
| 483 | +impl sum_tree::Dimension<'_, NotificationSummary> for Count { | |
| 484 | 484 | fn zero(_cx: &()) -> Self { |
| 485 | 485 | Default::default() |
| 486 | 486 | } |
| @@ -1632,9 +1632,9 @@ impl BufferStore { · 1631 unmodified lines | ||
| 1632 | 1632 | // file in the Cargo registry (presumably opened with go-to-definition |
| 1633 | 1633 | // from a normal Rust file). If so, we can put together a permalink |
| 1634 | 1634 | // using crate metadata. |
| 1635 | − if !buffer | |
| 1635 | + if buffer | |
| 1636 | 1636 | .language() |
| 1637 | − .is_some_and(|lang| lang.name() == "Rust".into()) | |
| 1637 | + .is_none_or(|lang| lang.name() != "Rust".into()) | |
| 1638 | 1638 | { |
| 1639 | 1639 | return Task::ready(Err(anyhow!("no permalink available"))); |
| 1640 | 1640 | } |
| @@ -78,7 +78,7 @@ pub struct ChunkSlice<'a> { · 77 unmodified lines | ||
| 78 | 78 | text: &'a str, |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | −impl<'a> Into<Chunk> for ChunkSlice<'a> { | |
| 81 | +impl Into<Chunk> for ChunkSlice<'_> { | |
| 82 | 82 | fn into(self) -> Chunk { |
| 83 | 83 | Chunk { |
| 84 | 84 | chars: self.chars, |
| @@ -124,8 +124,8 @@ impl PartialOrd for Point { · 123 unmodified lines | ||
| 124 | 124 | impl Ord for Point { |
| 125 | 125 | #[cfg(target_pointer_width = "64")] |
| 126 | 126 | fn cmp(&self, other: &Point) -> Ordering { |
| 127 | − let a = (self.row as usize) << 32 | self.column as usize; | |
| 128 | − let b = (other.row as usize) << 32 | other.column as usize; | |
| 127 | + let a = ((self.row as usize) << 32) | self.column as usize; | |
| 128 | + let b = ((other.row as usize) << 32) | other.column as usize; | |
| 129 | 129 | a.cmp(&b) |
| 130 | 130 | } |
| 131 | 131 | |
| @@ -104,8 +104,8 @@ impl PartialOrd for PointUtf16 { · 103 unmodified lines | ||
| 104 | 104 | impl Ord for PointUtf16 { |
| 105 | 105 | #[cfg(target_pointer_width = "64")] |
| 106 | 106 | fn cmp(&self, other: &PointUtf16) -> Ordering { |
| 107 | − let a = (self.row as usize) << 32 | self.column as usize; | |
| 108 | − let b = (other.row as usize) << 32 | other.column as usize; | |
| 107 | + let a = ((self.row as usize) << 32) | self.column as usize; | |
| 108 | + let b = ((other.row as usize) << 32) | other.column as usize; | |
| 109 | 109 | a.cmp(&b) |
| 110 | 110 | } |
| 111 | 111 | |
| @@ -145,7 +145,7 @@ impl Rope { · 144 unmodified lines | ||
| 145 | 145 | |
| 146 | 146 | // We also round up the capacity up by one, for a good measure; we *really* don't want to realloc here, as we assume that the # of characters |
| 147 | 147 | // we're working with there is large. |
| 148 | − let capacity = (text.len() + MIN_CHUNK_SIZE - 1) / MIN_CHUNK_SIZE; | |
| 148 | + let capacity = text.len().div_ceil(MIN_CHUNK_SIZE); | |
| 149 | 149 | let mut new_chunks = Vec::with_capacity(capacity); |
| 150 | 150 | |
| 151 | 151 | while !text.is_empty() { |
| @@ -855,7 +855,7 @@ impl<'a> Iterator for Bytes<'a> { · 703 unmodified lines | ||
| 855 | 855 | } |
| 856 | 856 | } |
| 857 | 857 | |
| 858 | −impl<'a> io::Read for Bytes<'a> { | |
| 858 | +impl io::Read for Bytes<'_> { | |
| 859 | 859 | fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { |
| 860 | 860 | if let Some(chunk) = self.peek() { |
| 861 | 861 | let len = cmp::min(buf.len(), chunk.len()); |
| @@ -889,7 +889,7 @@ pub struct Lines<'a> { · 27 unmodified lines | ||
| 889 | 889 | reversed: bool, |
| 890 | 890 | } |
| 891 | 891 | |
| 892 | −impl<'a> Lines<'a> { | |
| 892 | +impl Lines<'_> { | |
| 893 | 893 | pub fn next(&mut self) -> Option<&str> { |
| 894 | 894 | if self.done { |
| 895 | 895 | return None; |
| @@ -1909,7 +1909,7 @@ mod tests { · 1908 unmodified lines | ||
| 1909 | 1909 | .unindent(); |
| 1910 | 1910 | let expected_query_matches_count = buffer_text |
| 1911 | 1911 | .chars() |
| 1912 | − .filter(|c| c.to_ascii_lowercase() == 'a') | |
| 1912 | + .filter(|c| c.eq_ignore_ascii_case(&'a')) | |
| 1913 | 1913 | .count(); |
| 1914 | 1914 | assert!( |
| 1915 | 1915 | expected_query_matches_count > 1, |
| @@ -8,7 +8,7 @@ pub struct SettingsJsonSchemaParams<'a> { · 7 unmodified lines | ||
| 8 | 8 | pub font_names: &'a [String], |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | −impl<'a> SettingsJsonSchemaParams<'a> { | |
| 11 | +impl SettingsJsonSchemaParams<'_> { | |
| 12 | 12 | pub fn font_family_schema(&self) -> Schema { |
| 13 | 13 | let available_fonts: Vec<_> = self.font_names.iter().cloned().map(Value::String).collect(); |
| 14 | 14 | |
| @@ -377,7 +377,7 @@ impl<'a> Statement<'a> { · 376 unmodified lines | ||
| 377 | 377 | } |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | −impl<'a> Drop for Statement<'a> { | |
| 380 | +impl Drop for Statement<'_> { | |
| 381 | 381 | fn drop(&mut self) { |
| 382 | 382 | unsafe { |
| 383 | 383 | for raw_statement in self.raw_statements.iter() { |
| @@ -9,7 +9,7 @@ struct StackEntry<'a, T: Item, D> { · 8 unmodified lines | ||
| 9 | 9 | position: D, |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | −impl<'a, T: Item + fmt::Debug, D: fmt::Debug> fmt::Debug for StackEntry<'a, T, D> { | |
| 12 | +impl<T: Item + fmt::Debug, D: fmt::Debug> fmt::Debug for StackEntry<'_, T, D> { | |
| 13 | 13 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 14 | 14 | f.debug_struct("StackEntry") |
| 15 | 15 | .field("index", &self.index) |
| @@ -27,7 +27,7 @@ pub struct Cursor<'a, T: Item, D> { · 11 unmodified lines | ||
| 27 | 27 | at_end: bool, |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | −impl<'a, T: Item + fmt::Debug, D: fmt::Debug> fmt::Debug for Cursor<'a, T, D> | |
| 30 | +impl<T: Item + fmt::Debug, D: fmt::Debug> fmt::Debug for Cursor<'_, T, D> | |
| 31 | 31 | where |
| 32 | 32 | T::Summary: fmt::Debug, |
| 33 | 33 | { |
| @@ -742,14 +742,14 @@ struct SliceSeekAggregate<T: Item> { · 708 unmodified lines | ||
| 742 | 742 | |
| 743 | 743 | struct SummarySeekAggregate<D>(D); |
| 744 | 744 | |
| 745 | −impl<'a, T: Item> SeekAggregate<'a, T> for () { | |
| 745 | +impl<T: Item> SeekAggregate<'_, T> for () { | |
| 746 | 746 | fn begin_leaf(&mut self) {} |
| 747 | 747 | fn end_leaf(&mut self, _: &<T::Summary as Summary>::Context) {} |
| 748 | 748 | fn push_item(&mut self, _: &T, _: &T::Summary, _: &<T::Summary as Summary>::Context) {} |
| 749 | 749 | fn push_tree(&mut self, _: &SumTree<T>, _: &T::Summary, _: &<T::Summary as Summary>::Context) {} |
| 750 | 750 | } |
| 751 | 751 | |
| 752 | −impl<'a, T: Item> SeekAggregate<'a, T> for SliceSeekAggregate<T> { | |
| 752 | +impl<T: Item> SeekAggregate<'_, T> for SliceSeekAggregate<T> { | |
| 753 | 753 | fn begin_leaf(&mut self) {} |
| 754 | 754 | fn end_leaf(&mut self, cx: &<T::Summary as Summary>::Context) { |
| 755 | 755 | self.tree.append( |
| @@ -1468,7 +1468,7 @@ mod tests { · 1467 unmodified lines | ||
| 1468 | 1468 | } |
| 1469 | 1469 | } |
| 1470 | 1470 | |
| 1471 | − impl<'a> Dimension<'a, IntegersSummary> for u8 { | |
| 1471 | + impl Dimension<'_, IntegersSummary> for u8 { | |
| 1472 | 1472 | fn zero(_cx: &()) -> Self { |
| 1473 | 1473 | Default::default() |
| 1474 | 1474 | } |
| @@ -1478,7 +1478,7 @@ mod tests { · 3 unmodified lines | ||
| 1478 | 1478 | } |
| 1479 | 1479 | } |
| 1480 | 1480 | |
| 1481 | − impl<'a> Dimension<'a, IntegersSummary> for Count { | |
| 1481 | + impl Dimension<'_, IntegersSummary> for Count { | |
| 1482 | 1482 | fn zero(_cx: &()) -> Self { |
| 1483 | 1483 | Default::default() |
| 1484 | 1484 | } |
| @@ -1488,13 +1488,13 @@ mod tests { · 3 unmodified lines | ||
| 1488 | 1488 | } |
| 1489 | 1489 | } |
| 1490 | 1490 | |
| 1491 | − impl<'a> SeekTarget<'a, IntegersSummary, IntegersSummary> for Count { | |
| 1491 | + impl SeekTarget<'_, IntegersSummary, IntegersSummary> for Count { | |
| 1492 | 1492 | fn cmp(&self, cursor_location: &IntegersSummary, _: &()) -> Ordering { |
| 1493 | 1493 | self.0.cmp(&cursor_location.count) |
| 1494 | 1494 | } |
| 1495 | 1495 | } |
| 1496 | 1496 | |
| 1497 | − impl<'a> Dimension<'a, IntegersSummary> for Sum { | |
| 1497 | + impl Dimension<'_, IntegersSummary> for Sum { | |
| 1498 | 1498 | fn zero(_cx: &()) -> Self { |
| 1499 | 1499 | Default::default() |
| 1500 | 1500 | } |
| @@ -26,7 +26,7 @@ impl<K> Default for MapKey<K> { · 25 unmodified lines | ||
| 26 | 26 | #[derive(Clone, Debug)] |
| 27 | 27 | pub struct MapKeyRef<'a, K>(Option<&'a K>); |
| 28 | 28 | |
| 29 | −impl<'a, K> Default for MapKeyRef<'a, K> { | |
| 29 | +impl<K> Default for MapKeyRef<'_, K> { | |
| 30 | 30 | fn default() -> Self { |
| 31 | 31 | Self(None) |
| 32 | 32 | } |
| @@ -123,10 +123,7 @@ impl PtyProcessInfo { · 122 unmodified lines | ||
| 123 | 123 | |
| 124 | 124 | fn load(&mut self) -> Option<ProcessInfo> { |
| 125 | 125 | let process = self.refresh()?; |
| 126 | − let cwd = process | |
| 127 | − .cwd() | |
| 128 | − .take() | |
| 129 | − .map_or(PathBuf::new(), |p| p.to_owned()); | |
| 126 | + let cwd = process.cwd().map_or(PathBuf::new(), |p| p.to_owned()); | |
| 130 | 127 | |
| 131 | 128 | let info = ProcessInfo { |
| 132 | 129 | name: process.name().to_str()?.to_owned(), |
| @@ -81,7 +81,7 @@ impl Summary for OperationSummary { · 80 unmodified lines | ||
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | −impl<'a> Add<&'a Self> for OperationSummary { | |
| 84 | +impl Add<&Self> for OperationSummary { | |
| 85 | 85 | type Output = Self; |
| 86 | 86 | |
| 87 | 87 | fn add(self, other: &Self) -> Self { |
| @@ -93,7 +93,7 @@ impl<'a> Add<&'a Self> for OperationSummary { · 5 unmodified lines | ||
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | −impl<'a> Dimension<'a, OperationSummary> for OperationKey { | |
| 96 | +impl Dimension<'_, OperationSummary> for OperationKey { | |
| 97 | 97 | fn zero(_cx: &()) -> Self { |
| 98 | 98 | Default::default() |
| 99 | 99 | } |
| @@ -2533,7 +2533,7 @@ impl<'a> RopeBuilder<'a> { · 2532 unmodified lines | ||
| 2533 | 2533 | } |
| 2534 | 2534 | } |
| 2535 | 2535 | |
| 2536 | −impl<'a, D: TextDimension + Ord, F: FnMut(&FragmentSummary) -> bool> Iterator for Edits<'a, D, F> { | |
| 2536 | +impl<D: TextDimension + Ord, F: FnMut(&FragmentSummary) -> bool> Iterator for Edits<'_, D, F> { | |
| 2537 | 2537 | type Item = (Edit<D>, Range<Anchor>); |
| 2538 | 2538 | |
| 2539 | 2539 | fn next(&mut self) -> Option<Self::Item> { |
| @@ -2801,7 +2801,7 @@ impl ops::Sub for FullOffset { · 261 unmodified lines | ||
| 2801 | 2801 | } |
| 2802 | 2802 | } |
| 2803 | 2803 | |
| 2804 | −impl<'a> sum_tree::Dimension<'a, FragmentSummary> for usize { | |
| 2804 | +impl sum_tree::Dimension<'_, FragmentSummary> for usize { | |
| 2805 | 2805 | fn zero(_: &Option<clock::Global>) -> Self { |
| 2806 | 2806 | Default::default() |
| 2807 | 2807 | } |
| @@ -2811,7 +2811,7 @@ impl<'a> sum_tree::Dimension<'a, FragmentSummary> for usize { · 3 unmodified lines | ||
| 2811 | 2811 | } |
| 2812 | 2812 | } |
| 2813 | 2813 | |
| 2814 | −impl<'a> sum_tree::Dimension<'a, FragmentSummary> for FullOffset { | |
| 2814 | +impl sum_tree::Dimension<'_, FragmentSummary> for FullOffset { | |
| 2815 | 2815 | fn zero(_: &Option<clock::Global>) -> Self { |
| 2816 | 2816 | Default::default() |
| 2817 | 2817 | } |
| @@ -2831,7 +2831,7 @@ impl<'a> sum_tree::Dimension<'a, FragmentSummary> for Option<&'a Locator> { · 13 unmodified lines | ||
| 2831 | 2831 | } |
| 2832 | 2832 | } |
| 2833 | 2833 | |
| 2834 | −impl<'a> sum_tree::SeekTarget<'a, FragmentSummary, FragmentTextSummary> for usize { | |
| 2834 | +impl sum_tree::SeekTarget<'_, FragmentSummary, FragmentTextSummary> for usize { | |
| 2835 | 2835 | fn cmp( |
| 2836 | 2836 | &self, |
| 2837 | 2837 | cursor_location: &FragmentTextSummary, |
| @@ -2880,7 +2880,7 @@ impl<'a> sum_tree::Dimension<'a, FragmentSummary> for VersionedFullOffset { · 42 unmodified lines | ||
| 2880 | 2880 | } |
| 2881 | 2881 | } |
| 2882 | 2882 | |
| 2883 | −impl<'a> sum_tree::SeekTarget<'a, FragmentSummary, Self> for VersionedFullOffset { | |
| 2883 | +impl sum_tree::SeekTarget<'_, FragmentSummary, Self> for VersionedFullOffset { | |
| 2884 | 2884 | fn cmp(&self, cursor_position: &Self, _: &Option<clock::Global>) -> cmp::Ordering { |
| 2885 | 2885 | match (self, cursor_position) { |
| 2886 | 2886 | (Self::Offset(a), Self::Offset(b)) => Ord::cmp(a, b), |
| @@ -2952,7 +2952,7 @@ impl ToOffset for Anchor { · 65 unmodified lines | ||
| 2952 | 2952 | } |
| 2953 | 2953 | } |
| 2954 | 2954 | |
| 2955 | −impl<'a, T: ToOffset> ToOffset for &'a T { | |
| 2955 | +impl<T: ToOffset> ToOffset for &T { | |
| 2956 | 2956 | fn to_offset(&self, content: &BufferSnapshot) -> usize { |
| 2957 | 2957 | (*self).to_offset(content) |
| 2958 | 2958 | } |
| @@ -11,7 +11,7 @@ pub enum ArcCow<'a, T: ?Sized> { · 10 unmodified lines | ||
| 11 | 11 | Owned(Arc<T>), |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | −impl<'a, T: ?Sized + PartialEq> PartialEq for ArcCow<'a, T> { | |
| 14 | +impl<T: ?Sized + PartialEq> PartialEq for ArcCow<'_, T> { | |
| 15 | 15 | fn eq(&self, other: &Self) -> bool { |
| 16 | 16 | let a = self.as_ref(); |
| 17 | 17 | let b = other.as_ref(); |
| @@ -19,21 +19,21 @@ impl<'a, T: ?Sized + PartialEq> PartialEq for ArcCow<'a, T> { · 1 unmodified line | ||
| 19 | 19 | } |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | −impl<'a, T: ?Sized + PartialOrd> PartialOrd for ArcCow<'a, T> { | |
| 22 | +impl<T: ?Sized + PartialOrd> PartialOrd for ArcCow<'_, T> { | |
| 23 | 23 | fn partial_cmp(&self, other: &Self) -> Option<Ordering> { |
| 24 | 24 | self.as_ref().partial_cmp(other.as_ref()) |
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | −impl<'a, T: ?Sized + Ord> Ord for ArcCow<'a, T> { | |
| 28 | +impl<T: ?Sized + Ord> Ord for ArcCow<'_, T> { | |
| 29 | 29 | fn cmp(&self, other: &Self) -> Ordering { |
| 30 | 30 | self.as_ref().cmp(other.as_ref()) |
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | −impl<'a, T: ?Sized + Eq> Eq for ArcCow<'a, T> {} | |
| 34 | +impl<T: ?Sized + Eq> Eq for ArcCow<'_, T> {} | |
| 35 | 35 | |
| 36 | −impl<'a, T: ?Sized + Hash> Hash for ArcCow<'a, T> { | |
| 36 | +impl<T: ?Sized + Hash> Hash for ArcCow<'_, T> { | |
| 37 | 37 | fn hash<H: Hasher>(&self, state: &mut H) { |
| 38 | 38 | match self { |
| 39 | 39 | Self::Borrowed(borrowed) => Hash::hash(borrowed, state), |
| @@ -42,7 +42,7 @@ impl<'a, T: ?Sized + Hash> Hash for ArcCow<'a, T> { · 2 unmodified lines | ||
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | −impl<'a, T: ?Sized> Clone for ArcCow<'a, T> { | |
| 45 | +impl<T: ?Sized> Clone for ArcCow<'_, T> { | |
| 46 | 46 | fn clone(&self) -> Self { |
| 47 | 47 | match self { |
| 48 | 48 | Self::Borrowed(borrowed) => Self::Borrowed(borrowed), |
| @@ -102,7 +102,7 @@ impl<'a> From<&'a str> for ArcCow<'a, [u8]> { · 53 unmodified lines | ||
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | −impl<'a, T: ?Sized + ToOwned> std::borrow::Borrow<T> for ArcCow<'a, T> { | |
| 105 | +impl<T: ?Sized + ToOwned> std::borrow::Borrow<T> for ArcCow<'_, T> { | |
| 106 | 106 | fn borrow(&self) -> &T { |
| 107 | 107 | match self { |
| 108 | 108 | ArcCow::Borrowed(borrowed) => borrowed, |
| @@ -131,7 +131,7 @@ impl<T: ?Sized> AsRef<T> for ArcCow<'_, T> { · 22 unmodified lines | ||
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | −impl<'a, T: ?Sized + Debug> Debug for ArcCow<'a, T> { | |
| 134 | +impl<T: ?Sized + Debug> Debug for ArcCow<'_, T> { | |
| 135 | 135 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
| 136 | 136 | match self { |
| 137 | 137 | ArcCow::Borrowed(borrowed) => Debug::fmt(borrowed, f), |
| @@ -781,7 +781,7 @@ impl Ord for NumericPrefixWithSuffix<'_> { · 780 unmodified lines | ||
| 781 | 781 | } |
| 782 | 782 | } |
| 783 | 783 | |
| 784 | −impl<'a> PartialOrd for NumericPrefixWithSuffix<'a> { | |
| 784 | +impl PartialOrd for NumericPrefixWithSuffix<'_> { | |
| 785 | 785 | fn partial_cmp(&self, other: &Self) -> Option<Ordering> { |
| 786 | 786 | Some(self.cmp(other)) |
| 787 | 787 | } |
| @@ -1498,9 +1498,7 @@ impl LocalWorktree { · 1497 unmodified lines | ||
| 1498 | 1498 | }; |
| 1499 | 1499 | |
| 1500 | 1500 | scanner |
| 1501 | − .run(Box::pin( | |
| 1502 | − events.map(|events| events.into_iter().map(Into::into).collect()), | |
| 1503 | − )) | |
| 1501 | + .run(Box::pin(events.map(|events| events.into_iter().collect()))) | |
| 1504 | 1502 | .await; |
| 1505 | 1503 | } |
| 1506 | 1504 | }); |
| @@ -3630,7 +3628,7 @@ impl fmt::Debug for Snapshot { · 2123 unmodified lines | ||
| 3630 | 3628 | struct EntriesById<'a>(&'a SumTree<PathEntry>); |
| 3631 | 3629 | struct EntriesByPath<'a>(&'a SumTree<Entry>); |
| 3632 | 3630 | |
| 3633 | − impl<'a> fmt::Debug for EntriesByPath<'a> { | |
| 3631 | + impl fmt::Debug for EntriesByPath<'_> { | |
| 3634 | 3632 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 3635 | 3633 | f.debug_map() |
| 3636 | 3634 | .entries(self.0.iter().map(|entry| (&entry.path, entry.id))) |
| @@ -3638,7 +3636,7 @@ impl fmt::Debug for Snapshot { · 1 unmodified line | ||
| 3638 | 3636 | } |
| 3639 | 3637 | } |
| 3640 | 3638 | |
| 3641 | − impl<'a> fmt::Debug for EntriesById<'a> { | |
| 3639 | + impl fmt::Debug for EntriesById<'_> { | |
| 3642 | 3640 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 3643 | 3641 | f.debug_list().entries(self.0.iter()).finish() |
| 3644 | 3642 | } |
| @@ -5922,7 +5920,7 @@ struct TraversalProgress<'a> { · 2277 unmodified lines | ||
| 5922 | 5920 | non_ignored_file_count: usize, |
| 5923 | 5921 | } |
| 5924 | 5922 | |
| 5925 | −impl<'a> TraversalProgress<'a> { | |
| 5923 | +impl TraversalProgress<'_> { | |
| 5926 | 5924 | fn count(&self, include_files: bool, include_dirs: bool, include_ignored: bool) -> usize { |
| 5927 | 5925 | match (include_files, include_dirs, include_ignored) { |
| 5928 | 5926 | (true, true, true) => self.count, |
| @@ -5950,7 +5948,7 @@ impl<'a> sum_tree::Dimension<'a, EntrySummary> for TraversalProgress<'a> { · 21 unmodified lines | ||
| 5950 | 5948 | } |
| 5951 | 5949 | } |
| 5952 | 5950 | |
| 5953 | −impl<'a> Default for TraversalProgress<'a> { | |
| 5951 | +impl Default for TraversalProgress<'_> { | |
| 5954 | 5952 | fn default() -> Self { |
| 5955 | 5953 | Self { |
| 5956 | 5954 | max_path: Path::new(""), |
| @@ -5968,7 +5966,7 @@ pub struct GitEntryRef<'a> { · 11 unmodified lines | ||
| 5968 | 5966 | pub git_summary: GitSummary, |
| 5969 | 5967 | } |
| 5970 | 5968 | |
| 5971 | −impl<'a> GitEntryRef<'a> { | |
| 5969 | +impl GitEntryRef<'_> { | |
| 5972 | 5970 | pub fn to_owned(&self) -> GitEntry { |
| 5973 | 5971 | GitEntry { |
| 5974 | 5972 | entry: self.entry.clone(), |
| @@ -5977,7 +5975,7 @@ impl<'a> GitEntryRef<'a> { · 2 unmodified lines | ||
| 5977 | 5975 | } |
| 5978 | 5976 | } |
| 5979 | 5977 | |
| 5980 | −impl<'a> Deref for GitEntryRef<'a> { | |
| 5978 | +impl Deref for GitEntryRef<'_> { | |
| 5981 | 5979 | type Target = Entry; |
| 5982 | 5980 | |
| 5983 | 5981 | fn deref(&self) -> &Self::Target { |
| @@ -5985,7 +5983,7 @@ impl<'a> Deref for GitEntryRef<'a> { · 1 unmodified line | ||
| 5985 | 5983 | } |
| 5986 | 5984 | } |
| 5987 | 5985 | |
| 5988 | −impl<'a> AsRef<Entry> for GitEntryRef<'a> { | |
| 5986 | +impl AsRef<Entry> for GitEntryRef<'_> { | |
| 5989 | 5987 | fn as_ref(&self) -> &Entry { |
| 5990 | 5988 | self.entry |
| 5991 | 5989 | } |
| @@ -6246,7 +6244,7 @@ enum PathTarget<'a> { · 254 unmodified lines | ||
| 6246 | 6244 | Successor(&'a Path), |
| 6247 | 6245 | } |
| 6248 | 6246 | |
| 6249 | −impl<'a> PathTarget<'a> { | |
| 6247 | +impl PathTarget<'_> { | |
| 6250 | 6248 | fn cmp_path(&self, other: &Path) -> Ordering { |
| 6251 | 6249 | match self { |
| 6252 | 6250 | PathTarget::Path(path) => path.cmp(&other), |
| @@ -6261,20 +6259,20 @@ impl<'a> PathTarget<'a> { · 8 unmodified lines | ||
| 6261 | 6259 | } |
| 6262 | 6260 | } |
| 6263 | 6261 | |
| 6264 | −impl<'a, 'b, S: Summary> SeekTarget<'a, PathSummary<S>, PathProgress<'a>> for PathTarget<'b> { | |
| 6262 | +impl<'a, S: Summary> SeekTarget<'a, PathSummary<S>, PathProgress<'a>> for PathTarget<'_> { | |
| 6265 | 6263 | fn cmp(&self, cursor_location: &PathProgress<'a>, _: &S::Context) -> Ordering { |
| 6266 | 6264 | self.cmp_path(&cursor_location.max_path) |
| 6267 | 6265 | } |
| 6268 | 6266 | } |
| 6269 | 6267 | |
| 6270 | −impl<'a, 'b, S: Summary> SeekTarget<'a, PathSummary<S>, TraversalProgress<'a>> for PathTarget<'b> { | |
| 6268 | +impl<'a, S: Summary> SeekTarget<'a, PathSummary<S>, TraversalProgress<'a>> for PathTarget<'_> { | |
| 6271 | 6269 | fn cmp(&self, cursor_location: &TraversalProgress<'a>, _: &S::Context) -> Ordering { |
| 6272 | 6270 | self.cmp_path(&cursor_location.max_path) |
| 6273 | 6271 | } |
| 6274 | 6272 | } |
| 6275 | 6273 | |
| 6276 | −impl<'a, 'b> SeekTarget<'a, PathSummary<GitSummary>, (TraversalProgress<'a>, GitSummary)> | |
| 6277 | − for PathTarget<'b> | |
| 6274 | +impl<'a> SeekTarget<'a, PathSummary<GitSummary>, (TraversalProgress<'a>, GitSummary)> | |
| 6275 | + for PathTarget<'_> | |
| 6278 | 6276 | { |
| 6279 | 6277 | fn cmp(&self, cursor_location: &(TraversalProgress<'a>, GitSummary), _: &()) -> Ordering { |
| 6280 | 6278 | self.cmp_path(&cursor_location.0.max_path) |
| @@ -6317,13 +6315,13 @@ impl<'a> TraversalTarget<'a> { · 36 unmodified lines | ||
| 6317 | 6315 | } |
| 6318 | 6316 | } |
| 6319 | 6317 | |
| 6320 | −impl<'a, 'b> SeekTarget<'a, EntrySummary, TraversalProgress<'a>> for TraversalTarget<'b> { | |
| 6318 | +impl<'a> SeekTarget<'a, EntrySummary, TraversalProgress<'a>> for TraversalTarget<'_> { | |
| 6321 | 6319 | fn cmp(&self, cursor_location: &TraversalProgress<'a>, _: &()) -> Ordering { |
| 6322 | 6320 | self.cmp_progress(cursor_location) |
| 6323 | 6321 | } |
| 6324 | 6322 | } |
| 6325 | 6323 | |
| 6326 | −impl<'a, 'b> SeekTarget<'a, PathSummary<Unit>, TraversalProgress<'a>> for TraversalTarget<'b> { | |
| 6324 | +impl<'a> SeekTarget<'a, PathSummary<Unit>, TraversalProgress<'a>> for TraversalTarget<'_> { | |
| 6327 | 6325 | fn cmp(&self, cursor_location: &TraversalProgress<'a>, _: &()) -> Ordering { |
| 6328 | 6326 | self.cmp_progress(cursor_location) |
| 6329 | 6327 | } |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | [toolchain] |
| 2 | −channel = "1.81" | |
| 2 | +channel = "1.85" | |
| 3 | 3 | profile = "minimal" |
| 4 | 4 | components = [ "rustfmt", "clippy" ] |
| 5 | 5 | targets = [ "x86_64-apple-darwin", "aarch64-apple-darwin", "x86_64-unknown-linux-gnu", "wasm32-wasip1", "x86_64-pc-windows-msvc" ] |