mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 02:39:20 +00:00
fix: infinite recursion bug
add `Immutable` trait (Type: !Immutable)
This commit is contained in:
parent
de92e295dc
commit
f9eb562848
26 changed files with 415 additions and 163 deletions
|
@ -6,6 +6,7 @@ use std::path::{Component, Path, PathBuf};
|
|||
|
||||
use crate::consts::PYTHON_MODE;
|
||||
use crate::env::erg_pkgs_path;
|
||||
use crate::traits::Immutable;
|
||||
use crate::{normalize_path, Str};
|
||||
|
||||
/// Guaranteed equivalence path.
|
||||
|
@ -16,6 +17,8 @@ use crate::{normalize_path, Str};
|
|||
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, PartialOrd, Ord)]
|
||||
pub struct NormalizedPathBuf(PathBuf);
|
||||
|
||||
impl Immutable for NormalizedPathBuf {}
|
||||
|
||||
impl fmt::Display for NormalizedPathBuf {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "{}", self.display())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue