We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 29bed7e + 00e40e8 commit f26bf42Copy full SHA for f26bf42
src/descriptor/mod.rs
@@ -739,12 +739,13 @@ where
739
type Err = Error;
740
741
fn from_str(s: &str) -> Result<Descriptor<Pk>, Error> {
742
- let desc_str = verify_checksum(s)?;
743
// tr tree parsing has special code
744
- if desc_str.starts_with("tr") {
745
- let tr = Tr::from_str(desc_str)?;
746
- Ok(Descriptor::Tr(tr))
+ // Tr::from_str will check the checksum
+ // match "tr(" to handle more extensibly
+ if s.starts_with("tr(") {
+ Ok(Descriptor::Tr(Tr::from_str(s)?))
747
} else {
748
+ let desc_str = verify_checksum(s)?;
749
let top = expression::Tree::from_str(desc_str)?;
750
expression::FromTree::from_tree(&top)
751
}
0 commit comments