Skip to content

Unicase::new(&str) != Unicase::from(&str), from impl ignores ASCII #76

@samadDotDev

Description

@samadDotDev

The following test fails since the from implementation doesn't check for ASCII vs Unicode encoding, and always maps to unicode even for ASCII strings.

#[cfg(test)]
mod tests {
    use unicase::UniCase;

    #[test]
    fn unicase_ascii() {
        let unicase = UniCase::new("Hello");
        assert!(unicase.is_ascii());

        let unicase: UniCase<&str> = UniCase::from("Hello");
        assert!(unicase.is_ascii());
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions