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.
This commit is contained in:
Tobin C. Harding 2022-05-31 09:58:15 +10:00
parent 99ae48ab01
commit 6874ce91e2
2 changed files with 1 additions and 6 deletions

View File

@ -473,7 +473,7 @@ impl Payload {
pub fn p2tr_tweaked(output_key: TweakedPublicKey) -> Payload {
Payload::WitnessProgram {
version: WitnessVersion::V1,
program: output_key.as_inner().serialize().to_vec(),
program: output_key.to_inner().serialize().to_vec(),
}
}

View File

@ -165,11 +165,6 @@ impl TweakedPublicKey {
self.0
}
/// Returns a reference to underlying public key.
pub fn as_inner(&self) -> &crate::XOnlyPublicKey {
&self.0
}
/// Serialize the key as a byte-encoded pair of values. In compressed form
/// the y-coordinate is represented by only a single bit, as x determines
/// it up to one bit.