Skip to content

Commit

Permalink
Fix clippy issues and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Diggsey committed Dec 3, 2024
1 parent 43abbaf commit f20866c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: Upload coverage artifact
path: lcov.info
4 changes: 2 additions & 2 deletions src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl<'de> Visitor<'de> for ValueVisitor {

struct NumberVisitor;

impl<'de> Visitor<'de> for NumberVisitor {
impl Visitor<'_> for NumberVisitor {
type Value = INumber;

fn expecting(&self, formatter: &mut Formatter) -> fmt::Result {
Expand All @@ -160,7 +160,7 @@ impl<'de> Visitor<'de> for NumberVisitor {

struct StringVisitor;

impl<'de> Visitor<'de> for StringVisitor {
impl Visitor<'_> for StringVisitor {
type Value = IString;

fn expecting(&self, formatter: &mut Formatter) -> fmt::Result {
Expand Down
12 changes: 6 additions & 6 deletions src/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct SplitHeader<'a> {
table: &'a [usize],
}

impl<'a> SplitHeader<'a> {
impl SplitHeader<'_> {
fn find_bucket(&self, key: &IString) -> Result<usize, usize> {
let hash_cap = hash_capacity(self.cap);
let initial_bucket = hash_bucket(key, hash_cap);
Expand Down Expand Up @@ -108,7 +108,7 @@ struct SplitHeaderMut<'a> {
table: &'a mut [usize],
}

impl<'a> SplitHeaderMut<'a> {
impl SplitHeaderMut<'_> {
fn as_ref(&self) -> SplitHeader {
SplitHeader {
cap: self.cap,
Expand Down Expand Up @@ -301,7 +301,7 @@ pub struct OccupiedEntry<'a> {
bucket: usize,
}

impl<'a> Debug for OccupiedEntry<'a> {
impl Debug for OccupiedEntry<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.debug_struct("OccupiedEntry")
.field("key", self.key())
Expand Down Expand Up @@ -389,7 +389,7 @@ pub struct VacantEntry<'a> {
key: IString,
}

impl<'a> Debug for VacantEntry<'a> {
impl Debug for VacantEntry<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.debug_struct("OccupiedEntry")
.field("key", self.key())
Expand Down Expand Up @@ -1015,7 +1015,7 @@ impl<'a> Iterator for Iter<'a> {
}
}

impl<'a> ExactSizeIterator for Iter<'a> {
impl ExactSizeIterator for Iter<'_> {
fn len(&self) -> usize {
self.0.len()
}
Expand All @@ -1034,7 +1034,7 @@ impl<'a> Iterator for IterMut<'a> {
}
}

impl<'a> ExactSizeIterator for IterMut<'a> {
impl ExactSizeIterator for IterMut<'_> {
fn len(&self) -> usize {
self.0.len()
}
Expand Down
14 changes: 7 additions & 7 deletions src/thin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub struct ThinRef<'a, T> {
phantom: PhantomData<&'a T>,
}

impl<'a, T> ThinRef<'a, T> {
impl<T> ThinRef<'_, T> {
pub unsafe fn new(ptr: *const T) -> Self {
Self {
ptr: NonNull::new_unchecked(ptr as *mut T),
Expand All @@ -17,16 +17,16 @@ impl<'a, T> ThinRef<'a, T> {
}
}

impl<'a, T> Deref for ThinRef<'a, T> {
impl<T> Deref for ThinRef<'_, T> {
type Target = T;

fn deref(&self) -> &Self::Target {
unsafe { &*self.ptr() }
}
}

impl<'a, T> Copy for ThinRef<'a, T> {}
impl<'a, T> Clone for ThinRef<'a, T> {
impl<T> Copy for ThinRef<'_, T> {}
impl<T> Clone for ThinRef<'_, T> {
fn clone(&self) -> Self {
*self
}
Expand All @@ -38,7 +38,7 @@ pub struct ThinMut<'a, T> {
phantom: PhantomData<&'a mut T>,
}

impl<'a, T> ThinMut<'a, T> {
impl<T> ThinMut<'_, T> {
pub unsafe fn new(ptr: *mut T) -> Self {
Self {
ptr: NonNull::new_unchecked(ptr),
Expand All @@ -47,7 +47,7 @@ impl<'a, T> ThinMut<'a, T> {
}
}

impl<'a, T> Deref for ThinMut<'a, T> {
impl<T> Deref for ThinMut<'_, T> {
type Target = T;

fn deref(&self) -> &Self::Target {
Expand All @@ -56,7 +56,7 @@ impl<'a, T> Deref for ThinMut<'a, T> {
}
}

impl<'a, T> DerefMut for ThinMut<'a, T> {
impl<T> DerefMut for ThinMut<'_, T> {
fn deref_mut(&mut self) -> &mut Self::Target {
// Safety: `ptr` must be valid
unsafe { &mut *self.ptr_mut() }
Expand Down
4 changes: 2 additions & 2 deletions src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ pub enum DestructuredMut<'a> {
#[derive(Debug)]
pub struct BoolMut<'a>(&'a mut IValue);

impl<'a> BoolMut<'a> {
impl BoolMut<'_> {
/// Set the [`IValue`] referenced by this proxy type to either
/// `true` or `false`.
pub fn set(&mut self, value: bool) {
Expand All @@ -155,7 +155,7 @@ impl<'a> BoolMut<'a> {
}
}

impl<'a> Deref for BoolMut<'a> {
impl Deref for BoolMut<'_> {
type Target = bool;
fn deref(&self) -> &bool {
if self.get() {
Expand Down

0 comments on commit f20866c

Please sign in to comment.