Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

Use anyhow for erro handling #72

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
218 changes: 116 additions & 102 deletions Cargo.lock

Large diffs are not rendered by default.

24 changes: 14 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors = ['J2ghz <j2.00ghz@gmail.com>']
categories = ['command-line-utilities']
description = 'Generates images from rtl_power csv files'
edition = '2018'
edition = '2021'
exclude = ['samples/*']
keywords = [
'sdr',
Expand All @@ -15,6 +15,10 @@ readme = 'README.md'
repository = 'https://github.com/j2ghz/sdr-heatmap/'
version = '0.1.5'

[profile.release]
codegen-units = 1
lto = "fat"

[[bench]]
harness = false
name = 'bench'
Expand All @@ -27,14 +31,14 @@ test-generator = "0.3"
[dependencies]
anyhow = "1.0"
arrayvec = "0.7"
clap = '2.33.3'
csv = '1.1.6'
flate2 = '1.0.19'
image = '0.23.12'
clap = '2.33'
csv = '1.1'
flate2 = '1.0'
image = '0.23'
itertools = "0.10"
log = '0.4.11'
rayon = '1.5.0'
stderrlog = '0.5.0'
log = '0.4'
rayon = '1.5'
stderrlog = '0.5'
structopt = "0.3"
walkdir = '2'
webp = "0.1.2"
walkdir = '2.3'
webp = "0.2"
10 changes: 5 additions & 5 deletions benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fn get_test_files() -> std::vec::Vec<std::path::PathBuf> {
fn preprocess_bench(c: &mut Criterion) {
let mut group = c.benchmark_group("preprocess implementations");
for file in get_test_files().iter() {
let size = get_file_size(&file);
let size = get_file_size(file);
group.throughput(Throughput::Bytes(size));
group.bench_with_input(
BenchmarkId::new("basic", file.display()),
Expand All @@ -58,7 +58,7 @@ fn preprocess_bench(c: &mut Criterion) {
b.iter_with_large_setup(
|| read_file_to_memory(file),
|data| {
let summary = preprocess(data);
let summary = preprocess(data).unwrap();
black_box(summary);
},
)
Expand All @@ -71,7 +71,7 @@ fn preprocess_bench(c: &mut Criterion) {
b.iter_with_large_setup(
|| read_file_to_memory(file),
|data| {
let summary = preprocess_iter(data);
let summary = preprocess_iter(data).unwrap();
black_box(summary);
},
)
Expand All @@ -85,7 +85,7 @@ fn preprocess_bench(c: &mut Criterion) {
fn process_bench(c: &mut Criterion) {
let mut group = c.benchmark_group("process implementations");
for file in get_test_files().iter() {
let size = get_file_size(&file);
let size = get_file_size(file);
group.throughput(Throughput::Bytes(size));
group.bench_with_input(
BenchmarkId::new("basic", file.display()),
Expand All @@ -107,7 +107,7 @@ fn process_bench(c: &mut Criterion) {
b.iter_with_large_setup(
|| read_csv_to_memory(file),
|data| {
let summary = process_iter(data, -1000.0, 1000.0, 1);
let summary = process_iter(data, -1000.0, 1000.0, 1).unwrap();
black_box(summary);
},
)
Expand Down
Loading