Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
This commit is contained in:
Piotr Osiewicz 2025-02-28 18:33:35 +01:00 committed by GitHub
parent fc52b43159
commit e4e758db3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
68 changed files with 180 additions and 190 deletions

View file

@ -999,7 +999,7 @@ impl std::ops::DerefMut for BlockPoint {
}
}
impl<'a> Deref for BlockMapReader<'a> {
impl Deref for BlockMapReader<'_> {
type Target = BlockSnapshot;
fn deref(&self) -> &Self::Target {
@ -1007,13 +1007,13 @@ impl<'a> Deref for BlockMapReader<'a> {
}
}
impl<'a> DerefMut for BlockMapReader<'a> {
impl DerefMut for BlockMapReader<'_> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.snapshot
}
}
impl<'a> BlockMapReader<'a> {
impl BlockMapReader<'_> {
pub fn row_for_block(&self, block_id: CustomBlockId) -> Option<BlockRow> {
let block = self.blocks.iter().find(|block| block.id == block_id)?;
let buffer_row = block
@ -1053,7 +1053,7 @@ impl<'a> BlockMapReader<'a> {
}
}
impl<'a> BlockMapWriter<'a> {
impl BlockMapWriter<'_> {
pub fn insert(
&mut self,
blocks: impl IntoIterator<Item = BlockProperties<Anchor>>,
@ -1740,7 +1740,7 @@ impl BlockSnapshot {
}
}
impl<'a> BlockChunks<'a> {
impl BlockChunks<'_> {
/// Go to the next transform
fn advance(&mut self) {
self.input_chunk = Chunk::default();
@ -1856,7 +1856,7 @@ impl<'a> Iterator for BlockChunks<'a> {
}
}
impl<'a> Iterator for BlockRows<'a> {
impl Iterator for BlockRows<'_> {
type Item = RowInfo;
fn next(&mut self) -> Option<Self::Item> {
@ -1952,7 +1952,7 @@ impl<'a> sum_tree::Dimension<'a, TransformSummary> for BlockRow {
}
}
impl<'a> Deref for BlockContext<'a, '_> {
impl Deref for BlockContext<'_, '_> {
type Target = App;
fn deref(&self) -> &Self::Target {

View file

@ -132,7 +132,7 @@ impl<'a> sum_tree::Dimension<'a, TransformSummary> for FoldPoint {
pub(crate) struct FoldMapWriter<'a>(&'a mut FoldMap);
impl<'a> FoldMapWriter<'a> {
impl FoldMapWriter<'_> {
pub(crate) fn fold<T: ToOffset>(
&mut self,
ranges: impl IntoIterator<Item = (Range<T>, FoldPlaceholder)>,
@ -1121,7 +1121,7 @@ impl<'a> sum_tree::Dimension<'a, FoldSummary> for FoldRange {
}
}
impl<'a> sum_tree::SeekTarget<'a, FoldSummary, FoldRange> for FoldRange {
impl sum_tree::SeekTarget<'_, FoldSummary, FoldRange> for FoldRange {
fn cmp(&self, other: &Self, buffer: &MultiBufferSnapshot) -> Ordering {
AnchorRangeExt::cmp(&self.0, &other.0, buffer)
}
@ -1144,7 +1144,7 @@ pub struct FoldRows<'a> {
fold_point: FoldPoint,
}
impl<'a> FoldRows<'a> {
impl FoldRows<'_> {
pub(crate) fn seek(&mut self, row: u32) {
let fold_point = FoldPoint::new(row, 0);
self.cursor.seek(&fold_point, Bias::Left, &());
@ -1155,7 +1155,7 @@ impl<'a> FoldRows<'a> {
}
}
impl<'a> Iterator for FoldRows<'a> {
impl Iterator for FoldRows<'_> {
type Item = RowInfo;
fn next(&mut self) -> Option<Self::Item> {
@ -1190,7 +1190,7 @@ pub struct FoldChunks<'a> {
max_output_offset: FoldOffset,
}
impl<'a> FoldChunks<'a> {
impl FoldChunks<'_> {
pub(crate) fn seek(&mut self, range: Range<FoldOffset>) {
self.transform_cursor.seek(&range.start, Bias::Right, &());

View file

@ -215,7 +215,7 @@ pub struct InlayChunks<'a> {
snapshot: &'a InlaySnapshot,
}
impl<'a> InlayChunks<'a> {
impl InlayChunks<'_> {
pub fn seek(&mut self, new_range: Range<InlayOffset>) {
self.transforms.seek(&new_range.start, Bias::Right, &());
@ -341,7 +341,7 @@ impl<'a> Iterator for InlayChunks<'a> {
}
}
impl<'a> InlayBufferRows<'a> {
impl InlayBufferRows<'_> {
pub fn seek(&mut self, row: u32) {
let inlay_point = InlayPoint::new(row, 0);
self.transforms.seek(&inlay_point, Bias::Left, &());
@ -363,7 +363,7 @@ impl<'a> InlayBufferRows<'a> {
}
}
impl<'a> Iterator for InlayBufferRows<'a> {
impl Iterator for InlayBufferRows<'_> {
type Item = RowInfo;
fn next(&mut self) -> Option<Self::Item> {

View file

@ -498,7 +498,7 @@ pub struct TabChunks<'a> {
inside_leading_tab: bool,
}
impl<'a> TabChunks<'a> {
impl TabChunks<'_> {
pub(crate) fn seek(&mut self, range: Range<TabPoint>) {
let (input_start, expanded_char_column, to_next_stop) =
self.snapshot.to_fold_point(range.start, Bias::Left);

View file

@ -69,7 +69,7 @@ pub struct WrapRows<'a> {
transforms: Cursor<'a, Transform, (WrapPoint, TabPoint)>,
}
impl<'a> WrapRows<'a> {
impl WrapRows<'_> {
pub(crate) fn seek(&mut self, start_row: u32) {
self.transforms
.seek(&WrapPoint::new(start_row, 0), Bias::Left, &());
@ -872,7 +872,7 @@ impl WrapSnapshot {
}
}
impl<'a> WrapChunks<'a> {
impl WrapChunks<'_> {
pub(crate) fn seek(&mut self, rows: Range<u32>) {
let output_start = WrapPoint::new(rows.start, 0);
let output_end = WrapPoint::new(rows.end, 0);
@ -955,7 +955,7 @@ impl<'a> Iterator for WrapChunks<'a> {
}
}
impl<'a> Iterator for WrapRows<'a> {
impl Iterator for WrapRows<'_> {
type Item = RowInfo;
fn next(&mut self) -> Option<Self::Item> {
@ -1120,7 +1120,7 @@ impl<'a> sum_tree::Dimension<'a, TransformSummary> for TabPoint {
}
}
impl<'a> sum_tree::SeekTarget<'a, TransformSummary, TransformSummary> for TabPoint {
impl sum_tree::SeekTarget<'_, TransformSummary, TransformSummary> for TabPoint {
fn cmp(&self, cursor_location: &TransformSummary, _: &()) -> std::cmp::Ordering {
Ord::cmp(&self.0, &cursor_location.input.lines)
}