From d411a1e9e6857be587743165704c4f06159c9818 Mon Sep 17 00:00:00 2001 From: Bahex <17417311+Bahex@users.noreply.github.com> Date: Sun, 4 May 2025 10:38:00 +0300 Subject: [PATCH] fix(cell-path): incorrect serialization of empty cell-paths can round trip `$. | to nuon | from nuon` --- crates/nu-protocol/src/ast/cell_path.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/nu-protocol/src/ast/cell_path.rs b/crates/nu-protocol/src/ast/cell_path.rs index 350474a53d..7b28196e5c 100644 --- a/crates/nu-protocol/src/ast/cell_path.rs +++ b/crates/nu-protocol/src/ast/cell_path.rs @@ -250,6 +250,10 @@ impl Display for CellPath { } } } + // Empty cell-paths are `$.` not `$` + if self.members.is_empty() { + write!(f, ".")?; + } Ok(()) } }