From bfec1278b75d4dbabf7d61d2c2eff31e5fdca60a Mon Sep 17 00:00:00 2001 From: Ian Manske Date: Fri, 14 Jun 2024 20:32:36 -0700 Subject: [PATCH] Fix infinite recursion converions --- crates/nu-path/src/path.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/nu-path/src/path.rs b/crates/nu-path/src/path.rs index b5b902dfeb..c080511b97 100644 --- a/crates/nu-path/src/path.rs +++ b/crates/nu-path/src/path.rs @@ -1065,7 +1065,7 @@ macro_rules! impl_as_ref { impl AsRef> for Path
{ #[inline] - fn as_ref(&self) -> &Path { + fn as_ref(&self) -> &Self { self } } @@ -1328,21 +1328,21 @@ impl, To: PathForm> From<&Path> for Rc> { impl> From<&T> for RelativePathBuf { #[inline] fn from(s: &T) -> Self { - s.as_ref().into() + Self::new_unchecked(s.as_ref().into()) } } impl> From<&T> for AbsolutePathBuf { #[inline] fn from(s: &T) -> Self { - s.as_ref().into() + Self::new_unchecked(s.as_ref().into()) } } impl> From<&T> for CanonicalPathBuf { #[inline] fn from(s: &T) -> Self { - s.as_ref().into() + Self::new_unchecked(s.as_ref().into()) } }