fix NotAConstant error help message (#8293)

```
Error: nu::parser::not_a_constant (link)

  × Not a constant.
   ╭─[entry #23:1:1]
 1 │ let file = "/home/user/file"; source $file
   ·                                      ──┬──
   ·                                        ╰── Value is not a parse-time constant
   ╰────
  help: Only a subset of expressions are allowed
        constants during parsing. Try using the 'let'
        command or typing the value literally.
```
this pr changes the help message to 'Try using the `const` command ...'
This commit is contained in:
mike 2023-03-03 04:07:25 +03:00 committed by GitHub
parent c1d76bfac7
commit e01eb42e74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -393,7 +393,7 @@ pub enum ParseError {
#[error("Not a constant.")]
#[diagnostic(
code(nu::parser::not_a_constant),
help("Only a subset of expressions are allowed constants during parsing. Try using the 'let' command or typing the value literally.")
help("Only a subset of expressions are allowed constants during parsing. Try using the 'const' command or typing the value literally.")
)]
NotAConstant(#[label = "Value is not a parse-time constant"] Span),