summaryrefslogtreecommitdiff
path: root/crates/nu-engine/src/compile/mod.rs
diff options
context:
space:
mode:
authorPiepmatz <git+github@cptpiepmatz.de>2024-10-01 13:23:27 +0200
committerGitHub <noreply@github.com>2024-10-01 13:23:27 +0200
commitb2d0d9cf13f95fb51684cb1335c2754219261a12 (patch)
treed35aeef614ca75a6e806bca039bab0cd0e3db8ee /crates/nu-engine/src/compile/mod.rs
parent46589faaca9afae60c4b969f6dcd4315a3def9ed (diff)
Make `SpanId` and `RegId` also use new ID struct (#13963)
# Description In the PR #13832 I used some newtypes for the old IDs. `SpanId` and `RegId` already used newtypes, to streamline the code, I made them into the same style as the other marker-based IDs. Since `RegId` should be a bit smaller (it uses a `u32` instead of `usize`) according to @devyn, I made the `Id` type generic with `usize` as the default inner value. The question still stands how `Display` should be implemented if even. # User-Facing Changes Users of the internal values of `RegId` or `SpanId` have breaking changes but who outside nushell itself even uses these? # After Submitting The IDs will be streamlined and all type-safe.
Diffstat (limited to 'crates/nu-engine/src/compile/mod.rs')
-rw-r--r--crates/nu-engine/src/compile/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/nu-engine/src/compile/mod.rs b/crates/nu-engine/src/compile/mod.rs
index 0beea18dd..1bdc2c6b4 100644
--- a/crates/nu-engine/src/compile/mod.rs
+++ b/crates/nu-engine/src/compile/mod.rs
@@ -18,7 +18,7 @@ use expression::compile_expression;
use operator::*;
use redirect::*;
-const BLOCK_INPUT: RegId = RegId(0);
+const BLOCK_INPUT: RegId = RegId::new(0);
/// Compile Nushell pipeline abstract syntax tree (AST) to internal representation (IR) instructions
/// for evaluation.