Skip to content

Commit

Permalink
Update naming
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkAndshark committed Nov 10, 2023
1 parent 5daea72 commit 7c3b83c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions mbtiles/src/mbtiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub struct Metadata {
}

#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct LevelDetail {
pub struct ZoomStats {
pub zoom: u8,
pub count: u64,
pub smallest: u64,
Expand All @@ -56,7 +56,7 @@ pub struct Statistics {
pub file_size: u64,
pub schema: MbtType,
pub page_size: u64,
pub level_details: Vec<LevelDetail>,
pub zoom_stats_list: Vec<ZoomStats>,
pub count: u64,
pub smallest: Option<u64>,
pub largest: Option<u64>,
Expand All @@ -82,7 +82,7 @@ impl Display for Statistics {
)
.unwrap();

for l in &self.level_details {
for l in &self.zoom_stats_list {
let smallest = SizeFormatterBinary::new(l.smallest);
let largest = SizeFormatterBinary::new(l.largest);
let average = SizeFormatterBinary::new(l.average as u64);
Expand Down Expand Up @@ -325,7 +325,7 @@ impl Mbtiles {
);
let mbt_type = self.detect_type(&mut *conn).await?;
let level_rows = tile_infos_query.fetch_all(&mut *conn).await?;
let level_details: Vec<LevelDetail> = level_rows
let level_details: Vec<ZoomStats> = level_rows
.into_iter()
.map(|r| {
let zoom = r.zoom.unwrap() as u8;
Expand All @@ -351,7 +351,7 @@ impl Mbtiles {
);

let bbox = Bounds::new(minx, miny, maxx, maxy);
LevelDetail {
ZoomStats {
zoom,
count,
smallest,
Expand All @@ -367,7 +367,7 @@ impl Mbtiles {
file_size,
schema: mbt_type,
page_size,
level_details,
zoom_stats_list: level_details,
count: 0,
smallest: None,
largest: None,
Expand All @@ -387,7 +387,7 @@ impl Mbtiles {
file_size,
schema: mbt_type,
page_size,
level_details,
zoom_stats_list: level_details,
count,
smallest,
largest,
Expand Down Expand Up @@ -1066,7 +1066,7 @@ mod tests {
file_size: 49152
schema: Flat
page_size: 4096
level_details:
zoom_stats_list:
- zoom: 0
count: 1
smallest: 1107
Expand Down

0 comments on commit 7c3b83c

Please sign in to comment.