Skip to content

Commit 4cfedac

Browse files
committed
chore: Fix cargo clippy warnings
1 parent c2e14c0 commit 4cfedac

File tree

5 files changed

+24
-37
lines changed

5 files changed

+24
-37
lines changed

src/extractor/parser.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,12 @@ impl CodeExtractor {
3838
.build();
3939

4040
let mut total_files_to_process = 0;
41-
let mut scanned_count = 0;
4241

4342
for entry in walker_count {
4443
let entry =
4544
entry.map_err(|e| GitTypeError::ExtractionFailed(format!("Walk error: {}", e)))?;
4645
let path = entry.path();
4746

48-
scanned_count += 1;
49-
50-
if scanned_count % 200 == 0 {}
51-
5247
if !path.is_file() {
5348
continue;
5449
}

src/game/models/loading_steps/cloning_step.rs

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,20 @@ impl Step for CloningStep {
4949

5050
fn execute(&self, context: &mut ExecutionContext) -> Result<StepResult> {
5151
if let Some(repo_spec) = context.repo_spec {
52-
match RepoManager::parse_repo_url(repo_spec)? {
53-
repo_info => {
54-
let repo_display = format!(
55-
"Repository: {}/{} ({})",
56-
repo_info.owner, repo_info.name, repo_info.origin
57-
);
52+
let repo_info = RepoManager::parse_repo_url(repo_spec)?;
53+
let repo_display = format!(
54+
"Repository: {}/{} ({})",
55+
repo_info.owner, repo_info.name, repo_info.origin
56+
);
5857

59-
// Set repo info in LoadingScreen
60-
if let Some(screen) = context.loading_screen {
61-
let _ = screen.set_repo_info(repo_display);
62-
}
63-
64-
// Clone repository
65-
let repo_path =
66-
RepoManager::clone_or_update_repo(&repo_info, context.loading_screen)?;
67-
Ok(StepResult::RepoPath(repo_path))
68-
}
58+
// Set repo info in LoadingScreen
59+
if let Some(screen) = context.loading_screen {
60+
let _ = screen.set_repo_info(repo_display);
6961
}
62+
63+
// Clone repository
64+
let repo_path = RepoManager::clone_or_update_repo(&repo_info, context.loading_screen)?;
65+
Ok(StepResult::RepoPath(repo_path))
7066
} else {
7167
// Skip this step if no remote repo specified
7268
Ok(StepResult::Skipped)

src/game/models/loading_steps/step_manager.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ pub struct StepManager {
1010
steps: Vec<Box<dyn Step>>,
1111
}
1212

13+
impl Default for StepManager {
14+
fn default() -> Self {
15+
Self::new()
16+
}
17+
}
18+
1319
impl StepManager {
1420
pub fn new() -> Self {
1521
Self {

src/game/screens/loading_screen.rs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ pub struct StepInfo {
6565

6666
pub struct LoadingScreen {
6767
state: LoadingScreenState,
68-
step_manager: Arc<StepManager>,
6968
render_handle: Option<thread::JoinHandle<Result<()>>>,
7069
}
7170

@@ -105,7 +104,6 @@ impl LoadingScreen {
105104

106105
Ok(Self {
107106
state,
108-
step_manager,
109107
render_handle: None,
110108
})
111109
}
@@ -289,19 +287,11 @@ impl LoadingScreen {
289287
// Create vertical centering layout
290288
let vertical_layout = Layout::default()
291289
.direction(Direction::Vertical)
292-
.constraints(if has_repo_info {
293-
vec![
294-
Constraint::Length(vertical_margin),
295-
Constraint::Length(content_height),
296-
Constraint::Min(0),
297-
]
298-
} else {
299-
vec![
300-
Constraint::Length(vertical_margin),
301-
Constraint::Length(content_height),
302-
Constraint::Min(0),
303-
]
304-
})
290+
.constraints(vec![
291+
Constraint::Length(vertical_margin),
292+
Constraint::Length(content_height),
293+
Constraint::Min(0),
294+
])
305295
.split(size);
306296

307297
// Main content layout

src/repo_manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ impl RepoManager {
270270

271271
// Phase 1: Git garbage collection
272272
let _output = Command::new("git")
273-
.args(&["gc", "--aggressive", "--prune=now"])
273+
.args(["gc", "--aggressive", "--prune=now"])
274274
.current_dir(repo_path)
275275
.output();
276276

0 commit comments

Comments
 (0)