Skip to content

Commit f4299e0

Browse files
CommanderStormnyurikpre-commit-ci[bot]
authoredMar 15, 2025··
2024 rust edition (#1719)
Re-Reverts #1718 This PR upgrades (`cargo fix --eddition`, then fix what does not make sense) our crates to the 2024 edition. While quite early, this enables things such as the v3 resolver, which might be helpfull to prevent MRSV breakages in the future by a MSRV breakage now. Most of the changes are from rustfmt => going commit-by-commit is likely a good approach Depends on: - rust 1.85 being avaliable in githubs CI actions/runner-images#11637 - [x] Windows Runner rollout - [x] Unix Runner rollout - [x] Mac Runner rollout - rust 1.85 being avaliable in pre-commit.ci - [x] pre-commit-ci/runner-image#294 - [x] pre-commit CI runner rollout - [x] #1752 --------- Co-authored-by: Yuri Astrakhan <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent eab7319 commit f4299e0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+424
-290
lines changed
 

‎Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[workspace]
2-
resolver = "2"
2+
resolver = "3"
33
members = ["martin", "martin-tile-utils", "mbtiles"]
44

55
[workspace.package]
6-
edition = "2021"
6+
edition = "2024"
77
license = "MIT OR Apache-2.0"
88
repository = "https://github.com/maplibre/martin"
9-
rust-version = "1.80"
9+
rust-version = "1.85"
1010
homepage = "https://martin.maplibre.org/"
1111

1212
[workspace.lints.rust]

‎martin-tile-utils/src/lib.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,7 @@ pub fn get_zoom_precision(zoom: u8) -> usize {
271271
assert!(zoom < MAX_ZOOM, "zoom {zoom} must be <= {MAX_ZOOM}");
272272
let lng_delta = webmercator_to_wgs84(EARTH_CIRCUMFERENCE / f64::from(1_u32 << zoom), 0.0).0;
273273
let log = lng_delta.log10() - 0.5;
274-
if log > 0.0 {
275-
0
276-
} else {
277-
-log.ceil() as usize
278-
}
274+
if log > 0.0 { 0 } else { -log.ceil() as usize }
279275
}
280276

281277
#[must_use]
@@ -304,10 +300,10 @@ mod tests {
304300

305301
use std::fs::read;
306302

307-
use approx::assert_relative_eq;
308-
use insta::assert_snapshot;
309303
use Encoding::{Internal, Uncompressed};
310304
use Format::{Jpeg, Json, Png, Webp};
305+
use approx::assert_relative_eq;
306+
use insta::assert_snapshot;
311307

312308
use super::*;
313309

0 commit comments

Comments
 (0)
Please sign in to comment.