Skip to content

Commit

Permalink
reorder params
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Nov 10, 2023
1 parent 3cd82a8 commit 9cd05c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/async_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ impl AsyncPmTilesReader<HttpBackend, NoCache> {
///
/// Fails if [url] does not exist or is an invalid archive. (Note: HTTP requests are made to validate it.)
pub async fn new_with_url<U: IntoUrl>(client: Client, url: U) -> Result<Self, Error> {
Self::new_with_cached_url(client, url, NoCache).await
Self::new_with_cached_url(NoCache, client, url).await
}
}

Expand All @@ -227,9 +227,9 @@ impl<C: DirectoryCache + Sync + Send> AsyncPmTilesReader<HttpBackend, C> {
///
/// Fails if [url] does not exist or is an invalid archive. (Note: HTTP requests are made to validate it.)
pub async fn new_with_cached_url<U: IntoUrl>(
cache: C,
client: Client,
url: U,
cache: C,
) -> Result<Self, Error> {
let backend = HttpBackend::try_from(client, url)?;

Expand All @@ -243,7 +243,7 @@ impl AsyncPmTilesReader<MmapBackend, NoCache> {
///
/// Fails if [p] does not exist or is an invalid archive.
pub async fn new_with_path<P: AsRef<Path>>(path: P) -> Result<Self, Error> {
Self::new_with_cached_path(path, NoCache).await
Self::new_with_cached_path(NoCache, path).await
}
}

Expand All @@ -252,7 +252,7 @@ impl<C: DirectoryCache + Sync + Send> AsyncPmTilesReader<MmapBackend, C> {
/// Creates a new cached PMTiles reader from a file path using the async mmap backend.
///
/// Fails if [p] does not exist or is an invalid archive.
pub async fn new_with_cached_path<P: AsRef<Path>>(path: P, cache: C) -> Result<Self, Error> {
pub async fn new_with_cached_path<P: AsRef<Path>>(cache: C, path: P) -> Result<Self, Error> {
let backend = MmapBackend::try_from(path).await?;

Self::try_from_cached_source(backend, cache).await
Expand Down

0 comments on commit 9cd05c8

Please sign in to comment.