snix/tvix/eval/src/value/string.rs
Vincent Ambo c7ba2dec04 test(tvix/value): add simple attrset construction tests
These do not yet test nested attribute sets; we need to add some more
inspection primitives first.

Change-Id: Icfc99bf17c73ebefc0d882a84f0ca73ec688a54d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6110
Reviewed-by: eta <tvl@eta.st>
Tested-by: BuildkiteCI
2022-08-24 18:19:52 +00:00

19 lines
471 B
Rust

use std::fmt::Display;
/// This module implements Nix language strings and their different
/// backing implementations.
#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct NixString(pub String);
impl Display for NixString {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.0.as_str())
}
}
impl From<&str> for NixString {
fn from(s: &str) -> Self {
NixString(s.to_string())
}
}