@@ -185,7 +185,7 @@ pub struct Doc {
185185 /// (line, col)
186186 pub completion_pos : RwSignal < ( usize , usize ) > ,
187187
188- /// Current inline completion text, if any.
188+ /// Current inline completion text, if any.
189189 /// This will be displayed even on views that are not focused.
190190 pub inline_completion : RwSignal < Option < String > > ,
191191 /// (line, col)
@@ -641,7 +641,7 @@ impl Doc {
641641 self . buffer . with_untracked ( |b| b. rev ( ) )
642642 }
643643
644- /// Get the buffer's line-ending.
644+ /// Get the buffer's line-ending.
645645 /// Note: this may not be the same as what the actual line endings in the file are, rather this
646646 /// is what the line-ending is set to (and what it will be saved as).
647647 pub fn line_ending ( & self ) -> LineEnding {
@@ -705,8 +705,7 @@ impl Doc {
705705 fn check_auto_save ( & self ) {
706706 let config = self . common . config . get_untracked ( ) ;
707707 if config. editor . autosave_interval > 0 {
708- let Some ( path) =
709- self . content . with_untracked ( |c| c. path ( ) . map ( |x| x. clone ( ) ) )
708+ let Some ( path) = self . content . with_untracked ( |c| c. path ( ) . cloned ( ) )
710709 else {
711710 return ;
712711 } ;
@@ -1272,12 +1271,13 @@ impl Doc {
12721271 . set ( FindProgress :: InProgress ( Selection :: new ( ) ) ) ;
12731272
12741273 let find_result = self . find_result . clone ( ) ;
1275- let find_rev_signal = self . common . find . rev . clone ( ) ;
1276- let triggered_by_changes = self . common . find . triggered_by_changes . clone ( ) ;
1274+ let find_rev_signal = self . common . find . rev ;
1275+ let triggered_by_changes = self . common . find . triggered_by_changes ;
12771276
1278- let path = self . content . get_untracked ( ) . path ( ) . map ( |x| x . clone ( ) ) ;
1277+ let path = self . content . get_untracked ( ) . path ( ) . cloned ( ) ;
12791278 let common = self . common . clone ( ) ;
12801279 let send = create_ext_action ( self . scope , move |occurrences : Selection | {
1280+ #[ allow( clippy:: single_match) ]
12811281 match (
12821282 occurrences. regions ( ) . is_empty ( ) ,
12831283 & path,
@@ -2099,11 +2099,7 @@ impl Styling for DocStyling {
20992099 && end >= start_offset
21002100 && diag. severity < Some ( DiagnosticSeverity :: HINT )
21012101 {
2102- let start = if start > start_offset {
2103- start - start_offset
2104- } else {
2105- 0
2106- } ;
2102+ let start = start. saturating_sub ( start_offset) ;
21072103 let end = end - start_offset;
21082104 let start = phantom_text. col_after ( start, true ) ;
21092105 let end = phantom_text. col_after ( end, false ) ;
0 commit comments