Skip to content

Commit

Permalink
Provide default Source::support_url_query
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Oct 21, 2023
1 parent b88d714 commit 2053f80
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
4 changes: 0 additions & 4 deletions martin/src/mbtiles/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ impl Source for MbtSource {
Box::new(self.clone())
}

fn support_url_query(&self) -> bool {
false
}

async fn get_tile(&self, xyz: &Xyz, _url_query: &Option<UrlQuery>) -> Result<Tile, Error> {
if let Some(tile) = self
.mbtiles
Expand Down
4 changes: 0 additions & 4 deletions martin/src/pmtiles/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@ impl Source for PmtSource {
Box::new(self.clone())
}

fn support_url_query(&self) -> bool {
false
}

async fn get_tile(&self, xyz: &Xyz, _url_query: &Option<UrlQuery>) -> Result<Tile, Error> {
// TODO: optimize to return Bytes
if let Some(t) = self
Expand Down
4 changes: 3 additions & 1 deletion martin/src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ pub trait Source: Send + Debug {

fn clone_source(&self) -> Box<dyn Source>;

fn support_url_query(&self) -> bool;
fn support_url_query(&self) -> bool {
false
}

async fn get_tile(&self, xyz: &Xyz, query: &Option<UrlQuery>) -> Result<Tile>;

Expand Down
4 changes: 0 additions & 4 deletions martin/src/srv/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,10 +505,6 @@ mod tests {
unimplemented!()
}

fn support_url_query(&self) -> bool {
unimplemented!()
}

async fn get_tile(
&self,
_xyz: &Xyz,
Expand Down

0 comments on commit 2053f80

Please sign in to comment.