Skip to content

Commit

Permalink
Use Rust 1.74 std::io::Error::other fn
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Dec 16, 2023
1 parent de6b681 commit 95c54d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ members = ["martin", "martin-tile-utils", "mbtiles"]
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/maplibre/martin"
rust-version = "1.65"
rust-version = "1.74"
readme = "README.md"
homepage = "https://martin.maplibre.org/"

Expand Down
7 changes: 1 addition & 6 deletions martin/src/mbtiles/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ impl MbtSource {
async fn new(id: String, path: PathBuf) -> FileResult<Self> {
let mbt = MbtilesPool::new(&path)
.await
.map_err(|e| {
io::Error::new(
io::ErrorKind::Other,
format!("{e:?}: Cannot open file {}", path.display()),
)
})
.map_err(|e| io::Error::other(format!("{e:?}: Cannot open file {}", path.display())))
.map_err(|e| IoError(e, path.clone()))?;

let meta = mbt
Expand Down
14 changes: 2 additions & 12 deletions martin/src/pmtiles/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,12 @@ impl PmtSource {
async fn new(id: String, path: PathBuf) -> FileResult<Self> {
let backend = MmapBackend::try_from(path.as_path())
.await
.map_err(|e| {
io::Error::new(
io::ErrorKind::Other,
format!("{e:?}: Cannot open file {}", path.display()),
)
})
.map_err(|e| io::Error::other(format!("{e:?}: Cannot open file {}", path.display())))
.map_err(|e| IoError(e, path.clone()))?;

let reader = AsyncPmTilesReader::try_from_source(backend).await;
let reader = reader
.map_err(|e| {
io::Error::new(
io::ErrorKind::Other,
format!("{e:?}: Cannot open file {}", path.display()),
)
})
.map_err(|e| io::Error::other(format!("{e:?}: Cannot open file {}", path.display())))
.map_err(|e| IoError(e, path.clone()))?;
let hdr = &reader.get_header();

Expand Down

0 comments on commit 95c54d2

Please sign in to comment.