Skip to content

Commit 6b71fe6

Browse files
committed
Remove as_inner
`self` and the referenced type returned by `as_inner` are both `Copy` types. There is no need to provide an reference getter method to a `Copy` type since implementing `Copy` implies that copying is cheap.
1 parent 8a997b1 commit 6b71fe6

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/util/address.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ impl Payload {
473473
pub fn p2tr_tweaked(output_key: TweakedPublicKey) -> Payload {
474474
Payload::WitnessProgram {
475475
version: WitnessVersion::V1,
476-
program: output_key.as_inner().serialize().to_vec(),
476+
program: output_key.to_inner().serialize().to_vec(),
477477
}
478478
}
479479

src/util/schnorr.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,6 @@ impl TweakedPublicKey {
165165
self.0
166166
}
167167

168-
/// Returns a reference to underlying public key.
169-
pub fn as_inner(&self) -> &crate::XOnlyPublicKey {
170-
&self.0
171-
}
172-
173168
/// Serialize the key as a byte-encoded pair of values. In compressed form
174169
/// the y-coordinate is represented by only a single bit, as x determines
175170
/// it up to one bit.

0 commit comments

Comments
 (0)