diff --git a/README.md b/README.md index 77b0a85..8a9ca4e 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ use std::fs::File; let file = File::create("tiles.pmtiles").unwrap(); let mut writer = PmTilesWriter::new(TileType::Mvt).create(file).unwrap(); writer.add_tile(0, &[/*...*/]).unwrap(); -writer.finish().unwrap(); +writer.finalize().unwrap(); ``` ## Development diff --git a/src/writer.rs b/src/writer.rs index 9327e48..fd90c49 100644 --- a/src/writer.rs +++ b/src/writer.rs @@ -336,7 +336,7 @@ impl PmTilesStreamWriter { } /// Finish writing the `PMTiles` file. - pub fn finish(mut self) -> PmtResult<()> { + pub fn finalize(mut self) -> PmtResult<()> { if let Some(last) = self.entries.last() { self.header.data_length = last.offset + u64::from(last.length); self.header.leaf_offset = self.header.data_offset + self.header.data_length; @@ -401,7 +401,7 @@ mod tests { let tile = tiles_in.get_tile_by_id(id).await.unwrap().unwrap(); writer.add_tile(id, &tile).unwrap(); } - writer.finish().unwrap(); + writer.finalize().unwrap(); let backend = MmapBackend::try_from(&fname).await.unwrap(); let tiles_out = AsyncPmTilesReader::try_from_source(backend).await.unwrap(); @@ -487,6 +487,6 @@ mod tests { assert!(writer.header.clustered); writer.add_tile(2, &[0, 1, 2, 3]).unwrap(); assert!(!writer.header.clustered); - writer.finish().unwrap(); + writer.finalize().unwrap(); } }