Use Rust 1.74 std::io::Error::other fn (#1009)

This commit is contained in:
Yuri Astrakhan 2024-01-16 21:18:14 -05:00 committed by GitHub
parent b832bb22f4
commit ecdeb8bf21
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 19 deletions

View File

@ -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.70"
rust-version = "1.74"
readme = "README.md"
homepage = "https://martin.maplibre.org/"

View File

@ -63,12 +63,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

View File

@ -313,22 +313,12 @@ impl PmtFileSource {
pub async fn new(cache: PmtCache, 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_cached_source(backend, cache).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()))?;
Self::new_int(id, path, reader).await