Make 'for' implicitly filter out nothings (#4536)

* Make 'for' implicitly filter out nothings

* Fix test
This commit is contained in:
JT
2022-02-18 13:41:41 -05:00
committed by GitHub
parent f65955ccc5
commit 786e4ab971
3 changed files with 7 additions and 1 deletions

View File

@ -562,6 +562,10 @@ impl Value {
}
}
pub fn is_nothing(&self) -> bool {
matches!(self, Value::Nothing { .. })
}
/// Create a new `Nothing` value
pub fn nothing(span: Span) -> Value {
Value::Nothing { span }