Skip to content

Commit

Permalink
Small fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
twitchax committed Aug 14, 2023
1 parent 4ccd2fd commit 021eab5
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rtz-build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ categories = ["command-line-utilities"]

[features]
default = []
full = ["tz-ned", "tz-osm", "admin-osm", "self-contained"]
full = ["tz-ned", "tz-osm", "admin-osm", "self-contained", "rtz-core/full"]

force-rebuild = []
self-contained = []
self-contained = ["rtz-core/self-contained"]

tz-ned = []
tz-osm = []
Expand Down
1 change: 1 addition & 0 deletions rtz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ js-sys = { version = "0.3.61", optional = true }

[dev-dependencies]
pretty_assertions = "1.4.0"
cities-json = "*"

[build-dependencies]
rtz-build = { path = "../rtz-build", version = "0.2.6"}
Expand Down
8 changes: 8 additions & 0 deletions rtz/src/geo/tz/ned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,12 @@ mod bench {
black_box(NedTimezone::lookup(x, y));
});
}

#[bench]
fn bench_cities(b: &mut Bencher) {
b.iter(|| {
let city = cities_json::get_random_cities();
black_box(NedTimezone::lookup(city.lng as f32, city.lat as f32));
});
}
}
8 changes: 8 additions & 0 deletions rtz/src/geo/tz/osm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,12 @@ mod bench {
black_box(OsmTimezone::lookup(x, y));
});
}

#[bench]
fn bench_cities(b: &mut Bencher) {
b.iter(|| {
let city = cities_json::get_random_cities();
black_box(OsmTimezone::lookup(city.lng as f32, city.lat as f32));
});
}
}

0 comments on commit 021eab5

Please sign in to comment.