Skip to content

Commit

Permalink
fix: 🚨 fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
DerZade committed May 18, 2024
1 parent 2933242 commit dcdd4df
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions src/directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -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::<type>()] [];
[from_async_reader_impl] [cfg(feature="async")] [(impl AsyncRead + Unpin + Send + AsyncReadExt)] [decompress_async(compression, &mut binding)] [reader.read_varint_async::<type>().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::<type>()] [];
[from_async_reader_impl] [cfg(feature="async")] [(impl Unpin + Send + AsyncReadExt)] [decompress_async(compression, &mut binding)] [reader.read_varint_async::<type>().await] [async];
)]
#[allow(clippy::needless_range_loop)]
#[cfg_async_filter]
Expand Down Expand Up @@ -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<Self> {
Expand Down
4 changes: 2 additions & 2 deletions src/header/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,

Expand Down
2 changes: 1 addition & 1 deletion src/tile_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub struct TileManager<R> {
/// hash of tile -> bytes of tile
data_by_hash: HashMap<u64, Vec<u8>>,

/// tile_id -> hash of tile
/// `tile_id` -> hash of tile
tile_by_id: HashMap<u64, TileManagerTile>,

/// hash of tile -> ids with this hash
Expand Down
10 changes: 5 additions & 5 deletions src/util/read_directories.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -145,9 +145,9 @@ fn range_end_inc(range: &impl RangeBounds<u64>) -> Option<u64> {
}

#[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<u64>)] [(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<u64> + 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<u64>)] [(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<u64> + Sync + Send)] [(impl Unpin + Send + AsyncReadExt + AsyncSeekExt)] [Directory::from_async_reader(reader, len, compression).await];
)]
#[cfg_async_filter]
async fn fn_name(
Expand Down

0 comments on commit dcdd4df

Please sign in to comment.