Remove Value::MatchPattern (#11356)

# Description
`Value::MatchPattern` implies that `MatchPattern`s are first-class
values. This PR removes this case, and commands must now instead use
`Expr::MatchPattern` to extract `MatchPattern`s just like how the
`match` command does using `Expr::MatchBlock`.

# User-Facing Changes
Breaking API change for `nu_protocol` crate.
This commit is contained in:
Ian Manske
2023-12-17 18:25:34 +00:00
committed by GitHub
parent 2264682443
commit c9c93f5b4d
14 changed files with 7 additions and 134 deletions

View File

@ -259,6 +259,5 @@ pub fn debug_string_without_formatting(value: &Value) -> String {
Value::Binary { val, .. } => format!("{val:?}"),
Value::CellPath { val, .. } => val.to_string(),
Value::CustomValue { val, .. } => val.value_string(),
Value::MatchPattern { val, .. } => format!("{:?}", val),
}
}