Skip to content

Commit 8707ad5

Browse files
dont merge test ci (#1256)
1 parent 1b22ecf commit 8707ad5

File tree

11 files changed

+39
-30
lines changed

11 files changed

+39
-30
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
name: Backend Benchmarks
4545
strategy:
4646
matrix:
47-
os: [ubuntu-20.04, macos-11, windows-2019]
47+
os: [ubuntu-20.04, macos-12, windows-2019]
4848
runs-on: ${{ matrix.os }}
4949
steps:
5050

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ This will save a `.pickle` file in your current working directory.
8282
**NOTE:** Use of this recording is intended only for debugging the swift-console and not for
8383
long term storage of streams. There is no guarantee the recording will be compatible with
8484
other console versions, as the messaging format between backend and frontend has no guarantee
85-
of backwards or forwards compatibility
85+
of backwards or forwards compatibility.
8686

8787
Debugging internal messaging should be version specific and recording it should be tied
8888
to its version.

console_backend/src/fft_monitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl FftMonitor {
152152
if let Some(chan) = channel {
153153
channels.append(&mut vec![chan]);
154154
} else {
155-
channels = self.channels.clone();
155+
channels.clone_from(&self.channels);
156156
}
157157
for chan in channels {
158158
if let Some(chan_en) = self.enabled.get_mut(&chan) {

console_backend/src/tabs/advanced_tab/advanced_spectrum_analyzer_tab.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ impl AdvancedSpectrumAnalyzerTab {
7979
if let Some(most_recent_fft) = ffts.pop() {
8080
self.fft_monitor.clear_ffts(None);
8181
if let Some(amplitudes) = most_recent_fft.get(&String::from(AMPLITUDES)) {
82-
self.most_recent_amplitudes = amplitudes.clone();
82+
self.most_recent_amplitudes.clone_from(amplitudes);
8383
}
8484
if let Some(frequencies) = most_recent_fft.get(&String::from(FREQUENCIES)) {
85-
self.most_recent_frequencies = frequencies.clone();
85+
self.most_recent_frequencies.clone_from(frequencies);
8686
}
8787

8888
self.send_data();

console_backend/src/tabs/advanced_tab/advanced_system_monitor_tab.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,14 @@ mod tests {
216216
uart_ftdi: uart_ftdi.clone(),
217217
latency,
218218
}));
219-
assert_eq!(*tab.obs_latency.get(&CURR.to_string()).unwrap(), current);
220-
assert_eq!(*tab.obs_latency.get(&AVG.to_string()).unwrap(), avg);
221-
assert_eq!(*tab.obs_latency.get(&MIN.to_string()).unwrap(), lmin);
222-
assert_eq!(*tab.obs_latency.get(&MAX.to_string()).unwrap(), lmax);
223-
assert_eq!(*tab.obs_period.get(&CURR.to_string()).unwrap(), no_period);
224-
assert_eq!(*tab.obs_period.get(&AVG.to_string()).unwrap(), no_period);
225-
assert_eq!(*tab.obs_period.get(&MIN.to_string()).unwrap(), no_period);
226-
assert_eq!(*tab.obs_period.get(&MAX.to_string()).unwrap(), no_period);
219+
assert_eq!(*tab.obs_latency.get(CURR).unwrap(), current);
220+
assert_eq!(*tab.obs_latency.get(AVG).unwrap(), avg);
221+
assert_eq!(*tab.obs_latency.get(MIN).unwrap(), lmin);
222+
assert_eq!(*tab.obs_latency.get(MAX).unwrap(), lmax);
223+
assert_eq!(*tab.obs_period.get(CURR).unwrap(), no_period);
224+
assert_eq!(*tab.obs_period.get(AVG).unwrap(), no_period);
225+
assert_eq!(*tab.obs_period.get(MIN).unwrap(), no_period);
226+
assert_eq!(*tab.obs_period.get(MAX).unwrap(), no_period);
227227
let avg = 1;
228228
let current = 2;
229229
let lmin = 3;
@@ -250,14 +250,14 @@ mod tests {
250250
latency,
251251
obs_period,
252252
}));
253-
assert_eq!(*tab.obs_latency.get(&CURR.to_string()).unwrap(), current);
254-
assert_eq!(*tab.obs_latency.get(&AVG.to_string()).unwrap(), avg);
255-
assert_eq!(*tab.obs_latency.get(&MIN.to_string()).unwrap(), lmin);
256-
assert_eq!(*tab.obs_latency.get(&MAX.to_string()).unwrap(), lmax);
257-
assert_eq!(*tab.obs_period.get(&CURR.to_string()).unwrap(), current);
258-
assert_eq!(*tab.obs_period.get(&AVG.to_string()).unwrap(), avg);
259-
assert_eq!(*tab.obs_period.get(&MIN.to_string()).unwrap(), pmin);
260-
assert_eq!(*tab.obs_period.get(&MAX.to_string()).unwrap(), pmax);
253+
assert_eq!(*tab.obs_latency.get(CURR).unwrap(), current);
254+
assert_eq!(*tab.obs_latency.get(AVG).unwrap(), avg);
255+
assert_eq!(*tab.obs_latency.get(MIN).unwrap(), lmin);
256+
assert_eq!(*tab.obs_latency.get(MAX).unwrap(), lmax);
257+
assert_eq!(*tab.obs_period.get(CURR).unwrap(), current);
258+
assert_eq!(*tab.obs_period.get(AVG).unwrap(), avg);
259+
assert_eq!(*tab.obs_period.get(MIN).unwrap(), pmin);
260+
assert_eq!(*tab.obs_period.get(MAX).unwrap(), pmax);
261261
}
262262

263263
#[test]

console_backend/src/tabs/baseline_tab.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,16 @@ impl BaselineTab {
112112
nsec: Some(0),
113113
shared_state,
114114
sln_cur_data: {
115-
let mut data = vec![Vec::with_capacity(1); NUM_GNSS_MODES];
115+
let mut data = (0..NUM_GNSS_MODES)
116+
.map(|_| Vec::with_capacity(1))
117+
.collect::<Vec<_>>();
116118
data.reserve_exact(NUM_GNSS_MODES);
117119
data
118120
},
119121
sln_data: {
120-
let mut data = vec![Vec::with_capacity(PLOT_HISTORY_MAX); NUM_GNSS_MODES];
122+
let mut data = (0..NUM_GNSS_MODES)
123+
.map(|_| Vec::with_capacity(PLOT_HISTORY_MAX))
124+
.collect::<Vec<_>>();
121125
data.reserve_exact(NUM_GNSS_MODES);
122126
data
123127
},

console_backend/src/tabs/observation_tab.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl ObservationTable {
111111
self.gps_week = wn;
112112
self.prev_obs_total = obs_total;
113113
self.prev_obs_count = 0;
114-
self.old_carrier_phase = self.new_carrier_phase.clone();
114+
self.old_carrier_phase.clone_from(&self.new_carrier_phase);
115115
self.incoming_obs.clear();
116116
self.new_carrier_phase.clear();
117117
self.rows.clear();

console_backend/src/tabs/settings_tab.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ impl SettingsTab {
181181
}
182182

183183
pub fn get(&self, group: &str, name: &str) -> Result<SettingsEntry> {
184-
self.settings.lock().get(group, name).map(Clone::clone)
184+
self.settings.lock().get(group, name).cloned()
185185
}
186186

187187
pub fn group(&self, group: &str) -> Result<Vec<SettingsEntry>> {

console_backend/src/tabs/solution_tab/solution_position_tab.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,16 @@ impl SolutionPositionTab {
138138
nsec: Some(0),
139139
shared_state,
140140
sln_cur_data: {
141-
let mut data = vec![Vec::with_capacity(1); NUM_GNSS_MODES];
141+
let mut data = (0..NUM_GNSS_MODES)
142+
.map(|_| Vec::with_capacity(1))
143+
.collect::<Vec<_>>();
142144
data.reserve_exact(NUM_GNSS_MODES);
143145
data
144146
},
145147
sln_data: {
146-
let mut data = vec![Vec::with_capacity(PLOT_HISTORY_MAX); NUM_GNSS_MODES];
148+
let mut data = (0..NUM_GNSS_MODES)
149+
.map(|_| Vec::with_capacity(PLOT_HISTORY_MAX))
150+
.collect::<Vec<_>>();
147151
data.reserve_exact(NUM_GNSS_MODES);
148152
data
149153
},

console_backend/src/tabs/update_tab.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,12 @@ fn send_file(update_tab_context: UpdateTabContext, fileio: &mut Fileio) -> anyho
446446
let size = file_blob.metadata()?.len() as usize;
447447
let mut bytes_written = 0;
448448
update_tab_context.fw_log_replace_last("Writing 0.0%...".to_string());
449-
match fileio.overwrite_with_progress(destination, file_blob, |n| {
449+
let on_progress = |n| {
450450
bytes_written += n;
451451
let progress = (bytes_written as f64) / (size as f64) * 100.0;
452452
update_tab_context.fw_log_replace_last(format!("Writing {progress:.2}%..."));
453-
}) {
453+
};
454+
match fileio.overwrite_with_progress(destination, file_blob, on_progress) {
454455
Ok(_) => {
455456
update_tab_context.fw_log_append(String::from("File transfer complete."));
456457
}

utils/glob.ds

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fn glob_paths_excluding_target
1313
filename = concat ${cargo_home} "/" ${i}
1414
unix_filename = replace ${filename} \\ /
1515
ignored = array_contains ${gi_unix} ${unix_filename}
16-
if not contains ${ignored} \"false\"
16+
if not contains ${ignored} "false"
1717
array_push ${out} ${unix_filename}
1818
end
1919
end

0 commit comments

Comments
 (0)