Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan-rsm-McKenzie committed Dec 22, 2024
1 parent 0de2bc6 commit 4684f2a
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/containers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ impl Bytes<'static> {
}
}

impl<'bytes> Default for Bytes<'bytes> {
impl Default for Bytes<'_> {
fn default() -> Self {
Self {
inner: Owned(Box::default()),
Expand Down Expand Up @@ -275,7 +275,7 @@ impl CompressableBytes<'static> {
}
}

impl<'bytes> Default for CompressableBytes<'bytes> {
impl Default for CompressableBytes<'_> {
fn default() -> Self {
Self {
inner: OwnedDecompressed(Box::default()),
Expand Down
2 changes: 1 addition & 1 deletion src/fo4/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl Options {

derive::key!(Key: FileHash);

impl<'bytes> Key<'bytes> {
impl Key<'_> {
#[must_use]
fn hash_in_place(name: &mut BString) -> FileHash {
fo4::hash_file_in_place(name)
Expand Down
2 changes: 1 addition & 1 deletion src/fo4/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ pub struct Chunk<'bytes> {

derive::compressable_bytes!(Chunk: CompressionOptions);

impl<'bytes> Chunk<'bytes> {
impl Chunk<'_> {
pub fn compress_into(&self, out: &mut Vec<u8>, options: &CompressionOptions) -> Result<()> {
if self.is_compressed() {
Err(Error::AlreadyCompressed)
Expand Down
10 changes: 5 additions & 5 deletions src/fo4/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ impl<'bytes> CapacityError<'bytes> {
}
}

impl<'bytes> Debug for CapacityError<'bytes> {
impl Debug for CapacityError<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
<Self as Display>::fmt(self, f)
}
}

impl<'bytes> Display for CapacityError<'bytes> {
impl Display for CapacityError<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
write!(
f,
Expand All @@ -46,7 +46,7 @@ impl<'bytes> Display for CapacityError<'bytes> {
}
}

impl<'bytes> error::Error for CapacityError<'bytes> {}
impl error::Error for CapacityError<'_> {}

/// See also [`FileReadOptions`](ReadOptions).
#[derive(Debug, Default)]
Expand Down Expand Up @@ -1014,7 +1014,7 @@ pub struct File<'bytes> {
pub header: Header,
}

impl<'bytes> Sealed for File<'bytes> {}
impl Sealed for File<'_> {}

type ReadResult<T> = T;
derive::reader_with_options!((File: ReadOptions) => ReadResult);
Expand Down Expand Up @@ -1474,7 +1474,7 @@ impl<'bytes> Index<usize> for File<'bytes> {
}
}

impl<'bytes> IndexMut<usize> for File<'bytes> {
impl IndexMut<usize> for File<'_> {
fn index_mut(&mut self, index: usize) -> &mut Self::Output {
&mut self.chunks[index]
}
Expand Down
2 changes: 1 addition & 1 deletion src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ pub(crate) struct CopiedSource<'bytes> {
pos: usize,
}

impl<'bytes> CopiedSource<'bytes> {
impl CopiedSource<'_> {
#[must_use]
fn make_bytes(&self, range: Range<usize>) -> Bytes<'static> {
Bytes::from_owned(self.source[range].into())
Expand Down
2 changes: 1 addition & 1 deletion src/tes3/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl Header {

derive::key!(Key: FileHash);

impl<'bytes> Key<'bytes> {
impl Key<'_> {
#[must_use]
fn hash_in_place(name: &mut BString) -> FileHash {
tes3::hash_file_in_place(name)
Expand Down
2 changes: 1 addition & 1 deletion src/tes4/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ struct SortedDirectory<'this, 'bytes> {

derive::key!(Key: DirectoryHash);

impl<'bytes> Key<'bytes> {
impl Key<'_> {
#[must_use]
fn hash_in_place(name: &mut BString) -> DirectoryHash {
tes4::hash_directory_in_place(name)
Expand Down
2 changes: 1 addition & 1 deletion src/tes4/directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use bstr::BString;

derive::key!(Key: FileHash);

impl<'bytes> Key<'bytes> {
impl Key<'_> {
#[must_use]
fn hash_in_place(name: &mut BString) -> FileHash {
tes4::hash_file_in_place(name)
Expand Down

0 comments on commit 4684f2a

Please sign in to comment.