@@ -49,7 +49,7 @@ pub(crate) fn point_to_tile(lat: f64, lng: f64, res: u8) -> Tile {
4949}
5050
5151/// Compute the latitude for a tile with an offset.
52- pub ( crate ) fn tile_to_latitude ( tile : Tile , offset : f64 ) -> f64 {
52+ pub ( crate ) fn tile_to_latitude ( tile : & Tile , offset : f64 ) -> f64 {
5353 // Check if offset is between 0 and 1
5454 assert ! (
5555 ( 0.0 ..=1.0 ) . contains( & offset) ,
@@ -66,7 +66,7 @@ pub(crate) fn tile_to_latitude(tile: Tile, offset: f64) -> f64 {
6666}
6767
6868/// Compute the longitude for a tile with an offset.
69- pub ( crate ) fn tile_to_longitude ( tile : Tile , offset : f64 ) -> f64 {
69+ pub ( crate ) fn tile_to_longitude ( tile : & Tile , offset : f64 ) -> f64 {
7070 // Check if offset is between 0 and 1
7171 assert ! (
7272 ( 0.0 ..=1.0 ) . contains( & offset) ,
@@ -82,7 +82,7 @@ pub(crate) fn tile_to_longitude(tile: Tile, offset: f64) -> f64 {
8282}
8383
8484/// Inverse of the scale factor at the tile center.
85- pub ( crate ) fn tile_scalefactor ( tile : Tile ) -> f64 {
85+ pub ( crate ) fn tile_scalefactor ( tile : & Tile ) -> f64 {
8686 // Get Tile coords
8787 let y = tile. y as f64 ;
8888 let z2 = ( 1 << tile. z ) as f64 ;
@@ -116,7 +116,7 @@ pub(crate) fn tile_area(tile: &Tile) -> f64 {
116116 let z_factor = |y_val : f64 | -> f64 {
117117 // Create a new tile with the same x and z but different y
118118 let temp_tile = Tile :: new ( * x, y_val as u32 , z as u8 ) ;
119- tile_scalefactor ( temp_tile) . powf ( 2.0 )
119+ tile_scalefactor ( & temp_tile) . powf ( 2.0 )
120120 } ;
121121
122122 area *= z_factor ( y) / z_factor ( center_y) ;
@@ -126,7 +126,7 @@ pub(crate) fn tile_area(tile: &Tile) -> f64 {
126126}
127127
128128/// Compute the sibling (neighbour) tile in a specific direction.
129- pub ( crate ) fn tile_sibling ( tile : Tile , direction : u8 ) -> Option < Tile > {
129+ pub ( crate ) fn tile_sibling ( tile : & Tile , direction : u8 ) -> Option < Tile > {
130130 // Early return for a low level == no neighbors
131131 // TODO: Think about what should one return instead of None
132132 if tile. z == 0_u8 {
@@ -180,7 +180,7 @@ pub(crate) fn tile_sibling(tile: Tile, direction: u8) -> Option<Tile> {
180180}
181181
182182/// Compute a hash from the tile.
183- pub ( crate ) fn to_tile_hash ( tile : Tile ) -> u64 {
183+ pub ( crate ) fn to_tile_hash ( tile : & Tile ) -> u64 {
184184 let x = tile. x as u64 ;
185185 let y = tile. y as u64 ;
186186 let z = tile. z as u64 ;
0 commit comments