Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy lints #2338

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/std/src/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ impl<'de> Deserialize<'de> for Binary {

struct Base64Visitor;

impl<'de> de::Visitor<'de> for Base64Visitor {
impl de::Visitor<'_> for Base64Visitor {
type Value = Binary;

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

struct BytesVisitor;

impl<'de> de::Visitor<'de> for BytesVisitor {
impl de::Visitor<'_> for BytesVisitor {
type Value = Binary;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
4 changes: 2 additions & 2 deletions packages/std/src/checksum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl<'de> Deserialize<'de> for Checksum {

struct ChecksumVisitor;

impl<'de> de::Visitor<'de> for ChecksumVisitor {
impl de::Visitor<'_> for ChecksumVisitor {
type Value = Checksum;

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

struct ChecksumBytesVisitor;

impl<'de> de::Visitor<'de> for ChecksumBytesVisitor {
impl de::Visitor<'_> for ChecksumBytesVisitor {
type Value = Checksum;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
4 changes: 2 additions & 2 deletions packages/std/src/coins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,13 @@ impl<'a> Iterator for CoinsIter<'a> {
}
}

impl<'a> DoubleEndedIterator for CoinsIter<'a> {
impl DoubleEndedIterator for CoinsIter<'_> {
fn next_back(&mut self) -> Option<Self::Item> {
self.0.next_back().map(|(_, coin)| coin)
}
}

impl<'a> ExactSizeIterator for CoinsIter<'a> {
impl ExactSizeIterator for CoinsIter<'_> {
fn len(&self) -> usize {
self.0.len()
}
Expand Down
5 changes: 2 additions & 3 deletions packages/std/src/deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub struct Deps<'a, C: CustomQuery = Empty> {
// See "There is a small difference between the two: the derive strategy will also
// place a Copy bound on type parameters, which isn’t always desired."
// https://doc.rust-lang.org/std/marker/trait.Copy.html
impl<'a, C: CustomQuery> Copy for Deps<'a, C> {}
impl<C: CustomQuery> Copy for Deps<'_, C> {}

impl<S: Storage, A: Api, Q: Querier, C: CustomQuery> OwnedDeps<S, A, Q, C> {
pub fn as_ref(&'_ self) -> Deps<'_, C> {
Expand Down Expand Up @@ -123,11 +123,10 @@ mod tests {
#[derive(Clone, Serialize, Deserialize)]
struct MyQuery;
impl CustomQuery for MyQuery {}
impl CustomQuery for u64 {}

#[test]
fn deps_implements_copy() {
impl CustomQuery for u64 {}

// With C: Copy
let owned = OwnedDeps::<_, _, _, u64> {
storage: MockStorage::default(),
Expand Down
4 changes: 2 additions & 2 deletions packages/std/src/hex_binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ impl<'de> Deserialize<'de> for HexBinary {

struct HexVisitor;

impl<'de> de::Visitor<'de> for HexVisitor {
impl de::Visitor<'_> for HexVisitor {
type Value = HexBinary;

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

struct BytesVisitor;

impl<'de> de::Visitor<'de> for BytesVisitor {
impl de::Visitor<'_> for BytesVisitor {
type Value = HexBinary;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion packages/std/src/math/decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ impl<'de> Deserialize<'de> for Decimal {

struct DecimalVisitor;

impl<'de> de::Visitor<'de> for DecimalVisitor {
impl de::Visitor<'_> for DecimalVisitor {
type Value = Decimal;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion packages/std/src/math/decimal256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ impl<'de> Deserialize<'de> for Decimal256 {

struct Decimal256Visitor;

impl<'de> de::Visitor<'de> for Decimal256Visitor {
impl de::Visitor<'_> for Decimal256Visitor {
type Value = Decimal256;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion packages/std/src/math/signed_decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ impl<'de> Deserialize<'de> for SignedDecimal {

struct SignedDecimalVisitor;

impl<'de> de::Visitor<'de> for SignedDecimalVisitor {
impl de::Visitor<'_> for SignedDecimalVisitor {
type Value = SignedDecimal;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion packages/std/src/math/signed_decimal_256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ impl<'de> Deserialize<'de> for SignedDecimal256 {

struct SignedDecimal256Visitor;

impl<'de> de::Visitor<'de> for SignedDecimal256Visitor {
impl de::Visitor<'_> for SignedDecimal256Visitor {
type Value = SignedDecimal256;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion packages/std/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ pub struct QuerierWrapper<'a, C: CustomQuery = Empty> {
// See "There is a small difference between the two: the derive strategy will also
// place a Copy bound on type parameters, which isn’t always desired."
// https://doc.rust-lang.org/std/marker/trait.Copy.html
impl<'a, C: CustomQuery> Copy for QuerierWrapper<'a, C> {}
impl<C: CustomQuery> Copy for QuerierWrapper<'_, C> {}

/// This allows us to use self.raw_query to access the querier.
/// It also allows external callers to access the querier easily.
Expand Down
Loading