Skip to content

Commit e936663

Browse files
committed
clippy fixes
1 parent a23a59e commit e936663

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

asyncgit/src/graph/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl From<usize> for LaneIndex {
4242

4343
impl From<LaneIndex> for usize {
4444
fn from(lane: LaneIndex) -> Self {
45-
lane.0 as usize
45+
lane.0 as Self
4646
}
4747
}
4848

asyncgit/src/graph/walker.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
use super::buffer::Buffer;
22
use super::chunk::{Chunk, Markers};
33
use super::oids::GraphOids;
4-
use super::{AliasId, ConnectionType, GraphRow, LaneIndex, MAX_LANE_COLORS};
4+
use super::{
5+
AliasId, ConnectionType, GraphRow, LaneIndex, MAX_LANE_COLORS,
6+
};
57
use crate::sync::CommitId;
68
use core::cmp::Ordering;
79
use std::collections::{HashMap, HashSet};
@@ -339,7 +341,10 @@ impl GraphWalker {
339341
connection_color,
340342
);
341343

342-
(LaneIndex::from(start_lane), LaneIndex::from(end_lane))
344+
(
345+
LaneIndex::from(start_lane),
346+
LaneIndex::from(end_lane),
347+
)
343348
})
344349
.collect()
345350
}
@@ -579,7 +584,7 @@ impl GraphWalker {
579584
}
580585

581586
/// Determines the correct node type for the active commit lane.
582-
fn determine_commit_connection(
587+
const fn determine_commit_connection(
583588
is_stash: bool,
584589
is_merge: bool,
585590
is_branch_tip: bool,

src/components/commitlist.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,12 +1354,15 @@ mod tests {
13541354
#[test]
13551355
fn test_build_graph_spans() {
13561356
let row = GraphRow {
1357-
lane_count: 1,
1358-
commit_lane: 0,
1357+
lane_count: 1.into(),
1358+
commit_lane: 0.into(),
13591359
is_merge: false,
13601360
is_branch_tip: false,
13611361
is_stash: false,
1362-
lanes: vec![Some((ConnectionType::CommitNormal, 0))],
1362+
lanes: vec![Some((
1363+
ConnectionType::CommitNormal,
1364+
0.into(),
1365+
))],
13631366
merge_bridge: None,
13641367
branches: vec![],
13651368
};

0 commit comments

Comments
 (0)