From e01eb42e74f6a5cf7cc0408a2688a6741f2597e2 Mon Sep 17 00:00:00 2001 From: mike <98623181+1Kinoti@users.noreply.github.com> Date: Fri, 3 Mar 2023 04:07:25 +0300 Subject: [PATCH] fix `NotAConstant` error help message (#8293) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` 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 ...' --- crates/nu-parser/src/errors.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/nu-parser/src/errors.rs b/crates/nu-parser/src/errors.rs index 99e11d4c0..140b7ea2e 100644 --- a/crates/nu-parser/src/errors.rs +++ b/crates/nu-parser/src/errors.rs @@ -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),