Use trim_start_matches

Now that we are bumping the MSRV to greater than 1.30 we can use
`trim_start_matches`.

Use `trim_start_matches` and remove the clippy directive.
This commit is contained in:
Tobin C. Harding 2022-04-21 11:18:47 +10:00
parent 0a19710906
commit 3a0097ba49
1 changed files with 1 additions and 2 deletions

View File

@ -166,7 +166,6 @@ impl fmt::Display for PsbtSighashType {
} }
} }
#[allow(deprecated)] // TODO: Swap `trim_left_matches` for `trim_start_matches` once MSRV >= 1.30.
impl FromStr for PsbtSighashType { impl FromStr for PsbtSighashType {
type Err = SighashTypeParseError; type Err = SighashTypeParseError;
@ -184,7 +183,7 @@ impl FromStr for PsbtSighashType {
} }
// We accept non-standard sighash values. // We accept non-standard sighash values.
if let Ok(inner) = u32::from_str_radix(s.trim_left_matches("0x"), 16) { if let Ok(inner) = u32::from_str_radix(s.trim_start_matches("0x"), 16) {
return Ok(PsbtSighashType { inner }); return Ok(PsbtSighashType { inner });
} }