Skip to content

Commit adc7717

Browse files
--wip-- [skip ci]
1 parent 1e1e48d commit adc7717

4 files changed

Lines changed: 31 additions & 25 deletions

File tree

src/cli/setup.rs

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,30 @@ pub fn status() -> Result<()> {
6868
if executor.support_level(&system_info.os) == ExecutorSupport::Unsupported {
6969
continue;
7070
}
71-
let tool_status = executor.tool_status();
72-
match &tool_status.status {
73-
ToolInstallStatus::Installed { version } => {
74-
info!(" {} {} ({})", check_mark(), tool_status.tool_name, version);
75-
}
76-
ToolInstallStatus::IncorrectVersion { version, message } => {
77-
info!(
78-
" {} {} ({}, {})",
79-
warn_mark(),
80-
tool_status.tool_name,
81-
version,
82-
message
83-
);
84-
}
85-
ToolInstallStatus::NotInstalled => {
86-
info!(
87-
" {} {} (not installed)",
88-
cross_mark(),
89-
tool_status.tool_name
90-
);
71+
match executor.tool_status() {
72+
Some(tool_status) => match &tool_status.status {
73+
ToolInstallStatus::Installed { version } => {
74+
info!(" {} {} ({})", check_mark(), tool_status.tool_name, version);
75+
}
76+
ToolInstallStatus::IncorrectVersion { version, message } => {
77+
info!(
78+
" {} {} ({}, {})",
79+
warn_mark(),
80+
tool_status.tool_name,
81+
version,
82+
message
83+
);
84+
}
85+
ToolInstallStatus::NotInstalled => {
86+
info!(
87+
" {} {} (not installed)",
88+
cross_mark(),
89+
tool_status.tool_name
90+
);
91+
}
92+
},
93+
None => {
94+
info!(" {} No tool to install", check_mark());
9195
}
9296
}
9397
}

src/executor/memory/executor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ impl Executor for MemoryExecutor {
7373
ExecutorName::Memory
7474
}
7575

76-
fn tool_status(&self) -> ToolStatus {
77-
get_memtrack_status()
76+
fn tool_status(&self) -> Option<ToolStatus> {
77+
Some(get_memtrack_status())
7878
}
7979

8080
fn support_level(&self, os: &Os) -> ExecutorSupport {

src/executor/valgrind/executor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ impl Executor for ValgrindExecutor {
1919
ExecutorName::Valgrind
2020
}
2121

22-
fn tool_status(&self) -> ToolStatus {
23-
get_valgrind_status()
22+
fn tool_status(&self) -> Option<ToolStatus> {
23+
Some(get_valgrind_status())
2424
}
2525

2626
fn support_level(&self, os: &Os) -> ExecutorSupport {

src/executor/wall_time/executor.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ impl Executor for WallTimeExecutor {
122122
}
123123

124124
fn tool_status(&self) -> Option<ToolStatus> {
125-
self.perf.map(|_| super::perf::setup::get_perf_status())
125+
self.perf
126+
.as_ref()
127+
.map(|_| super::perf::setup::get_perf_status())
126128
}
127129

128130
fn support_level(&self, os: &Os) -> ExecutorSupport {

0 commit comments

Comments
 (0)