Assert against empty conjunctions and disjunctions
This commit is contained in:
parent
6163c5b259
commit
25c567af06
@ -491,6 +491,8 @@ impl Formula
|
||||
{
|
||||
pub fn and(arguments: Formulas) -> Self
|
||||
{
|
||||
assert!(!arguments.is_empty());
|
||||
|
||||
Self::And(arguments)
|
||||
}
|
||||
|
||||
@ -566,6 +568,8 @@ impl Formula
|
||||
|
||||
pub fn or(arguments: Formulas) -> Self
|
||||
{
|
||||
assert!(!arguments.is_empty());
|
||||
|
||||
Self::Or(arguments)
|
||||
}
|
||||
|
||||
|
@ -240,6 +240,8 @@ impl<'formula> std::fmt::Debug for FormulaDisplay<'formula>
|
||||
{
|
||||
let mut separator = "";
|
||||
|
||||
assert!(!arguments.is_empty());
|
||||
|
||||
for argument in arguments
|
||||
{
|
||||
write!(format, "{}{:?}", separator, display_formula(argument, precedence))?;
|
||||
@ -251,6 +253,8 @@ impl<'formula> std::fmt::Debug for FormulaDisplay<'formula>
|
||||
{
|
||||
let mut separator = "";
|
||||
|
||||
assert!(!arguments.is_empty());
|
||||
|
||||
for argument in arguments
|
||||
{
|
||||
write!(format, "{}{:?}", separator, display_formula(argument, precedence))?;
|
||||
|
Loading…
Reference in New Issue
Block a user