llvm-scratch 0.1.15

Free Standing library in Rust
Documentation
use std::fmt;
use std::fmt::Formatter;

#[derive(Eq, PartialEq, PartialOrd, Ord, Hash, Clone)]
pub struct LLVMString {
    value: String,
}

impl LLVMString {
    fn new(value: String) -> Self {
        Self { value }
    }
    pub fn is_empty(&self) -> bool {
        self.value.is_empty()
    }
}

impl fmt::Display for LLVMString {
    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
        write!(f, "{}", self.value)
    }
}

impl From<String> for LLVMString {
    fn from(v: String) -> Self {
        Self::new(v)
    }
}

impl From<&str> for LLVMString {
    fn from(v: &str) -> Self {
        Self::new(v.to_string())
    }
}