File tree Expand file tree Collapse file tree 2 files changed +7
-13
lines changed Expand file tree Collapse file tree 2 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,9 @@ pub struct CommitList {
45
45
items : ItemBatch ,
46
46
highlights : Option < Rc < IndexSet < CommitId > > > ,
47
47
commits : IndexSet < CommitId > ,
48
+ /// The marked commits.
49
+ /// `self.marked[].0` holds the commit index into `self.items.items` - used for ordering the list.
50
+ /// `self.marked[].1` is the commit id of the marked commit.
48
51
marked : Vec < ( usize , CommitId ) > ,
49
52
scroll_state : ( Instant , f32 ) ,
50
53
tags : Option < Tags > ,
@@ -114,15 +117,6 @@ impl CommitList {
114
117
self . marked . len ( )
115
118
}
116
119
117
- ///
118
- #[ expect(
119
- clippy:: missing_const_for_fn,
120
- reason = "as of 1.86.0 clippy wants this to be const even though that breaks"
121
- ) ]
122
- pub fn marked ( & self ) -> & [ ( usize , CommitId ) ] {
123
- & self . marked
124
- }
125
-
126
120
///
127
121
pub fn clear_marked ( & mut self ) {
128
122
self . marked . clear ( ) ;
Original file line number Diff line number Diff line change @@ -586,19 +586,19 @@ impl Component for Revlog {
586
586
self . queue . push ( InternalEvent :: OpenPopup (
587
587
StackablePopupOpen :: CompareCommits (
588
588
InspectCommitOpen :: new (
589
- self . list . marked ( ) [ 0 ] . 1 ,
589
+ self . list . marked_commits ( ) [ 0 ] ,
590
590
) ,
591
591
) ,
592
592
) ) ;
593
593
return Ok ( EventState :: Consumed ) ;
594
594
} else if self . list . marked_count ( ) == 2 {
595
595
//compare two marked commits
596
- let marked = self . list . marked ( ) ;
596
+ let marked = self . list . marked_commits ( ) ;
597
597
self . queue . push ( InternalEvent :: OpenPopup (
598
598
StackablePopupOpen :: CompareCommits (
599
599
InspectCommitOpen {
600
- commit_id : marked[ 0 ] . 1 ,
601
- compare_id : Some ( marked[ 1 ] . 1 ) ,
600
+ commit_id : marked[ 0 ] ,
601
+ compare_id : Some ( marked[ 1 ] ) ,
602
602
tags : None ,
603
603
} ,
604
604
) ,
You can’t perform that action at this time.
0 commit comments