Skip to content

Commit b87b4fb

Browse files
committed
remove sketchy LikelyFalse error
This error would trigger on `l:0` on the basis that this is equivalent to `u:0` but always less efficient. There are no other "linting" errors like this in this library, and the C++ implementation doesn't have it, so we should drop it.
1 parent ef3abb6 commit b87b4fb

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

src/lib.rs

-4
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,6 @@ pub enum Error {
442442
MultiAt(String),
443443
/// Name of a fragment contained `@` but we were not parsing an OR
444444
AtOutsideOr(String),
445-
/// Encountered a `l:0` which is syntactically equal to `u:0` except stupid
446-
LikelyFalse,
447445
/// Encountered a wrapping character that we don't recognize
448446
UnknownWrapper(char),
449447
/// Parsed a miniscript and the result was not of type T
@@ -526,7 +524,6 @@ impl fmt::Display for Error {
526524
Error::MultiColon(ref s) => write!(f, "«{}» has multiple instances of «:»", s),
527525
Error::MultiAt(ref s) => write!(f, "«{}» has multiple instances of «@»", s),
528526
Error::AtOutsideOr(ref s) => write!(f, "«{}» contains «@» in non-or() context", s),
529-
Error::LikelyFalse => write!(f, "0 is not very likely (use «u:0»)"),
530527
Error::UnknownWrapper(ch) => write!(f, "unknown wrapper «{}:»", ch),
531528
Error::NonTopLevel(ref s) => write!(f, "non-T miniscript: {}", s),
532529
Error::Trailing(ref s) => write!(f, "trailing tokens: {}", s),
@@ -599,7 +596,6 @@ impl error::Error for Error {
599596
| MultiColon(_)
600597
| MultiAt(_)
601598
| AtOutsideOr(_)
602-
| LikelyFalse
603599
| UnknownWrapper(_)
604600
| NonTopLevel(_)
605601
| Trailing(_)

src/miniscript/astelem.rs

-3
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,6 @@ impl_from_tree!(
412412
)
413413
}
414414
'l' => {
415-
if ms.node == Terminal::False {
416-
return Err(Error::LikelyFalse);
417-
}
418415
unwrapped = Terminal::OrI(
419416
Arc::new(Miniscript::from_ast(Terminal::False)?),
420417
Arc::new(ms),

0 commit comments

Comments
 (0)