Use &Snapshot directly instead of impl Into<Content<'a>>
The text::Buffer and its snapshot already used the same representation for their content, so we can just make Buffer deref to a Snapshot.
This commit is contained in:
@@ -359,7 +359,8 @@ impl FoldMap {
|
||||
}
|
||||
|
||||
if fold.start > sum.input.bytes {
|
||||
let text_summary = buffer.text_summary_for_range(sum.input.bytes..fold.start);
|
||||
let text_summary = buffer
|
||||
.text_summary_for_range::<TextSummary, _>(sum.input.bytes..fold.start);
|
||||
new_transforms.push(
|
||||
Transform {
|
||||
summary: TransformSummary {
|
||||
@@ -400,7 +401,8 @@ impl FoldMap {
|
||||
|
||||
let sum = new_transforms.summary();
|
||||
if sum.input.bytes < edit.new.end {
|
||||
let text_summary = buffer.text_summary_for_range(sum.input.bytes..edit.new.end);
|
||||
let text_summary =
|
||||
buffer.text_summary_for_range::<TextSummary, _>(sum.input.bytes..edit.new.end);
|
||||
new_transforms.push(
|
||||
Transform {
|
||||
summary: TransformSummary {
|
||||
@@ -539,7 +541,7 @@ impl Snapshot {
|
||||
let buffer_end = cursor.start().1 + end_in_transform;
|
||||
summary += self
|
||||
.buffer_snapshot
|
||||
.text_summary_for_range(buffer_start..buffer_end);
|
||||
.text_summary_for_range::<TextSummary, _>(buffer_start..buffer_end);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user