Skip to content

Commit

Permalink
Avoid unnecessary clone and shorten code
Browse files Browse the repository at this point in the history
  • Loading branch information
pka committed Oct 28, 2023
1 parent f043548 commit a9481be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions bbox-tile-server/src/tilesource/mvt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ impl MvtBuilder {
}
}
pub fn new_layer(name: &str, tile_size: u32) -> mvt::tile::Layer {
let mut mvt_layer = mvt::tile::Layer {
mvt::tile::Layer {
version: 2,
name: String::from(name),
extent: Some(tile_size),
..Default::default()
};
mvt_layer.name = String::from(name);
mvt_layer
}
}
pub fn add_feature_attribute(
&mut self,
Expand Down
3 changes: 1 addition & 2 deletions bbox-tile-server/src/tilesource/postgis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ impl TileRead for PgSource {
extent.right,
extent.top,
)?
}
.clone();
};
for field in &layer.fields {
if field.name == layer.geometry_field {
continue;
Expand Down

0 comments on commit a9481be

Please sign in to comment.