mirror of
https://github.com/maplibre/martin.git
synced 2024-12-20 05:11:57 +03:00
Use Rust 1.74 std::io::Error::other fn (#1009)
This commit is contained in:
parent
b832bb22f4
commit
ecdeb8bf21
@ -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/"
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user