Skip to content

Commit 4e0706c

Browse files
committed
Enable use_self lint
Tighten up the linting by enabling `use_self` and fix all warnings. I got claude to do the fixes. It eventually found its way to using cargo clippy --fix --allow-dirty --allow-staged --workspace \ --all-targets --all-features -- -D clippy::use-self
1 parent a2ddb20 commit 4e0706c

43 files changed

Lines changed: 1093 additions & 1093 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/descriptor/bare.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ impl<Pk: FromStrKey> FromTree for Bare<Pk> {
172172
fn from_tree(root: expression::TreeIterItem) -> Result<Self, Error> {
173173
let sub = Miniscript::<Pk, BareCtx>::from_tree(root)?;
174174
BareCtx::top_level_checks(&sub)?;
175-
Bare::new(sub)
175+
Self::new(sub)
176176
}
177177
}
178178

@@ -202,7 +202,7 @@ impl<Pk: MiniscriptKey> Pkh<Pk> {
202202
pub fn new(pk: Pk) -> Result<Self, ScriptContextError> {
203203
// do the top-level checks
204204
match BareCtx::check_pk(&pk) {
205-
Ok(()) => Ok(Pkh { pk }),
205+
Ok(()) => Ok(Self { pk }),
206206
Err(e) => Err(e),
207207
}
208208
}
@@ -359,7 +359,7 @@ impl<Pk: FromStrKey> FromTree for Pkh<Pk> {
359359
let pk = root
360360
.verify_terminal_parent("pkh", "public key")
361361
.map_err(Error::Parse)?;
362-
Pkh::new(pk).map_err(Error::ContextError)
362+
Self::new(pk).map_err(Error::ContextError)
363363
}
364364
}
365365

src/descriptor/checksum.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ pub enum Error {
6161
impl fmt::Display for Error {
6262
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6363
match *self {
64-
Error::InvalidCharacter { ch, pos } => {
64+
Self::InvalidCharacter { ch, pos } => {
6565
write!(f, "invalid character '{}' (position {})", ch, pos)
6666
}
67-
Error::InvalidChecksumLength { actual, expected } => {
67+
Self::InvalidChecksumLength { actual, expected } => {
6868
write!(f, "invalid checksum (length {}, expected {})", actual, expected)
6969
}
70-
Error::InvalidChecksum { actual, expected } => {
70+
Self::InvalidChecksum { actual, expected } => {
7171
f.write_str("invalid checksum ")?;
7272
for ch in actual {
7373
ch.fmt(f)?;
@@ -135,13 +135,13 @@ pub struct Engine {
135135
}
136136

137137
impl Default for Engine {
138-
fn default() -> Engine { Engine::new() }
138+
fn default() -> Self { Self::new() }
139139
}
140140

141141
impl Engine {
142142
/// Constructs an engine with no input.
143143
pub fn new() -> Self {
144-
Engine { inner: bech32::primitives::checksum::Engine::new(), cls: 0, clscount: 0 }
144+
Self { inner: bech32::primitives::checksum::Engine::new(), cls: 0, clscount: 0 }
145145
}
146146

147147
/// Inputs some data into the checksum engine.

0 commit comments

Comments
 (0)