mirror of
https://github.com/maplibre/maplibre-rs.git
synced 2025-12-08 19:05:57 +00:00
Fix compilation with http config
This commit is contained in:
parent
d6cff6be6e
commit
9bbf3deee7
@ -13,6 +13,14 @@ pub struct HttpFetcherConfig {
|
||||
pub cache_path: String,
|
||||
}
|
||||
|
||||
impl Default for HttpFetcherConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
cache_path: ".".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
||||
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
|
||||
pub trait HttpFetcher {
|
||||
|
||||
@ -49,13 +49,13 @@ impl TileFetcher for StaticTileFetcher {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::io::TileFetcher;
|
||||
use crate::io::{HttpFetcherConfig, TileFetcher};
|
||||
|
||||
use super::StaticTileFetcher;
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_tiles_available() {
|
||||
let fetcher = StaticTileFetcher::new();
|
||||
let fetcher = StaticTileFetcher::new(HttpFetcherConfig::default());
|
||||
assert!(fetcher.fetch_tile(&(0, 0, 0).into()).await.is_err()); // World overview
|
||||
assert!(fetcher
|
||||
.fetch_tile(
|
||||
|
||||
@ -39,11 +39,11 @@ impl TileFetcher for WebTileFetcher {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::WebTileFetcher;
|
||||
use crate::io::TileFetcher;
|
||||
use crate::io::{HttpFetcherConfig, TileFetcher};
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_tiles_available() {
|
||||
let fetcher = WebTileFetcher::new();
|
||||
let fetcher = WebTileFetcher::new(HttpFetcherConfig::default());
|
||||
assert!(fetcher.fetch_tile(&(0, 0, 0).into()).await.is_ok()); // World overview
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user