diff --git a/src/directory.rs b/src/directory.rs index 355affb..48a658d 100644 --- a/src/directory.rs +++ b/src/directory.rs @@ -5,7 +5,7 @@ use std::ops::{Index, IndexMut, Range}; use std::slice::{Iter, SliceIndex}; #[cfg(feature = "async")] -use futures::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt}; +use futures::{AsyncReadExt, AsyncWrite, AsyncWriteExt}; #[cfg(feature = "async")] use integer_encoding::{VarIntAsyncReader, VarIntAsyncWriter}; @@ -97,9 +97,9 @@ impl<'a> IntoIterator for &'a Directory { impl Directory { #[duplicate_item( - fn_name cfg_async_filter input_traits decompress(compression, binding) read_varint(type, reader) async; - [from_reader_impl] [cfg(all())] [impl Read] [decompress(compression, &mut binding)] [reader.read_varint::()] []; - [from_async_reader_impl] [cfg(feature="async")] [(impl AsyncRead + Unpin + Send + AsyncReadExt)] [decompress_async(compression, &mut binding)] [reader.read_varint_async::().await] [async]; + fn_name cfg_async_filter input_traits decompress(compression, binding) read_varint(type, reader) async; + [from_reader_impl] [cfg(all())] [impl Read] [decompress(compression, &mut binding)] [reader.read_varint::()] []; + [from_async_reader_impl] [cfg(feature="async")] [(impl Unpin + Send + AsyncReadExt)] [decompress_async(compression, &mut binding)] [reader.read_varint_async::().await] [async]; )] #[allow(clippy::needless_range_loop)] #[cfg_async_filter] @@ -300,7 +300,7 @@ impl Directory { /// ``` #[cfg(feature = "async")] pub async fn from_async_reader( - input: &mut (impl AsyncRead + Unpin + Send + AsyncReadExt), + input: &mut (impl Unpin + Send + AsyncReadExt), length: u64, compression: Compression, ) -> Result { diff --git a/src/header/mod.rs b/src/header/mod.rs index faccb57..4055cbc 100644 --- a/src/header/mod.rs +++ b/src/header/mod.rs @@ -48,7 +48,7 @@ pub struct Header { /// Length (in bytes) of tile data section pub tile_data_length: u64, - /// Number of tiles, which are addressable in this PMTiles archive + /// Number of tiles, which are addressable in this `PMTiles` archive pub num_addressed_tiles: u64, /// Number of directory entries, that point to a tile @@ -58,7 +58,7 @@ pub struct Header { pub num_tile_content: u64, /// Indicates whether this archive is clustered, which means that - /// all directory entries are ordered in ascending order by tile_ids + /// all directory entries are ordered in ascending order by `tile_ids` #[deku(bits = 8)] pub clustered: bool, diff --git a/src/tile_manager.rs b/src/tile_manager.rs index 24b8cb4..4b4bf70 100644 --- a/src/tile_manager.rs +++ b/src/tile_manager.rs @@ -30,7 +30,7 @@ pub struct TileManager { /// hash of tile -> bytes of tile data_by_hash: HashMap>, - /// tile_id -> hash of tile + /// `tile_id` -> hash of tile tile_by_id: HashMap, /// hash of tile -> ids with this hash diff --git a/src/util/read_directories.rs b/src/util/read_directories.rs index f19de94..18cb050 100644 --- a/src/util/read_directories.rs +++ b/src/util/read_directories.rs @@ -1,7 +1,7 @@ #[cfg(feature = "async")] use async_recursion::async_recursion; #[cfg(feature = "async")] -use futures::io::{AsyncRead, AsyncReadExt, AsyncSeekExt}; +use futures::io::{AsyncReadExt, AsyncSeekExt}; use std::collections::HashMap; use std::io::{Read, Result, Seek}; use std::ops::RangeBounds; @@ -112,7 +112,7 @@ pub fn read_directories( #[allow(clippy::module_name_repetitions)] #[cfg(feature = "async")] pub async fn read_directories_async( - reader: &mut (impl AsyncRead + Unpin + Send + AsyncReadExt + AsyncSeekExt), + reader: &mut (impl Unpin + Send + AsyncReadExt + AsyncSeekExt), compression: Compression, root_dir_offset_length: (u64, u64), leaf_dir_offset: u64, @@ -145,9 +145,9 @@ fn range_end_inc(range: &impl RangeBounds) -> Option { } #[duplicate_item( - fn_name cfg_async_filter async add_await(code) seek_start(reader, offset) FilterRangeTraits input_traits read_directory(reader, len, compression); - [read_dir_rec] [cfg(all())] [] [code] [reader.seek(std::io::SeekFrom::Start(offset))] [(impl RangeBounds)] [(impl Read + Seek)] [Directory::from_reader(reader, len, compression)]; - [read_dir_rec_async] [cfg(feature="async")] [#[async_recursion] async] [code.await] [reader.seek(futures::io::SeekFrom::Start(offset)).await] [(impl RangeBounds + Sync + Send)] [(impl AsyncRead + Unpin + Send + AsyncReadExt + AsyncSeekExt)] [Directory::from_async_reader(reader, len, compression).await]; + fn_name cfg_async_filter async add_await(code) seek_start(reader, offset) FilterRangeTraits input_traits read_directory(reader, len, compression); + [read_dir_rec] [cfg(all())] [] [code] [reader.seek(std::io::SeekFrom::Start(offset))] [(impl RangeBounds)] [(impl Read + Seek)] [Directory::from_reader(reader, len, compression)]; + [read_dir_rec_async] [cfg(feature="async")] [#[async_recursion] async] [code.await] [reader.seek(futures::io::SeekFrom::Start(offset)).await] [(impl RangeBounds + Sync + Send)] [(impl Unpin + Send + AsyncReadExt + AsyncSeekExt)] [Directory::from_async_reader(reader, len, compression).await]; )] #[cfg_async_filter] async fn fn_name(