Skip to content

Commit

Permalink
Remove unnecessary helper function
Browse files Browse the repository at this point in the history
The `_translate_pk` helper function adds nothing to the code. It comes
from a day past when the signature of `translate_pk` and `_translate_pk`
differed (see commit ef1d69c).
  • Loading branch information
tcharding committed Oct 12, 2023
1 parent 29b612c commit 927735e
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/policy/semantic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,6 @@ impl<Pk: MiniscriptKey> Policy<Pk> {
/// assert_eq!(real_policy, expected_policy);
/// ```
pub fn translate_pk<Q, E, T>(&self, t: &mut T) -> Result<Policy<Q>, E>
where
T: Translator<Pk, Q, E>,
Q: MiniscriptKey,
{
self._translate_pk(t)
}

fn _translate_pk<Q, E, T>(&self, t: &mut T) -> Result<Policy<Q>, E>
where
T: Translator<Pk, Q, E>,
Q: MiniscriptKey,
Expand All @@ -151,7 +143,7 @@ impl<Pk: MiniscriptKey> Policy<Pk> {
Policy::Older(n) => Ok(Policy::Older(n)),
Policy::Threshold(k, ref subs) => {
let new_subs: Result<Vec<Policy<Q>>, _> =
subs.iter().map(|sub| sub._translate_pk(t)).collect();
subs.iter().map(|sub| sub.translate_pk(t)).collect();
new_subs.map(|ok| Policy::Threshold(k, ok))
}
}
Expand Down

0 comments on commit 927735e

Please sign in to comment.