-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(UTF-8): adds support for invalid utf8 in values
Closes #269
- Loading branch information
Showing
11 changed files
with
434 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1 @@ | ||
// use std::ffi::OsStr; | ||
// use std::borrow::Cow; | ||
// | ||
// pub trait Utf8Rule { type Out; fn into(&OsStr) -> <Self as Utf8Rule>::Out; } | ||
// | ||
// #[derive(Copy, Clone, Debug, PartialEq)] | ||
// pub struct Strict<'a>; | ||
// impl<'a> Utf8Rule for Strict<'a> { type Out = &'a str; } | ||
// | ||
// #[derive(Copy, Clone, Debug, PartialEq)] | ||
// pub struct Lossy<'a>; | ||
// impl<'a> Utf8Rule for Lossy<'a> { type Out = Cow<'a, str>; } | ||
// | ||
// #[derive(Copy, Clone, Debug, PartialEq)] | ||
// pub struct AllowInvalid<'a>; | ||
// impl<'a> Utf8Rule for AllowInvalid<'a> { type Out = &'a OsStr; } | ||
// | ||
// #[derive(Copy, Clone, Debug, PartialEq)] | ||
// pub enum Utf8 { | ||
// Strict, | ||
// Lossy, | ||
// AllowInvalid, | ||
// } | ||
// | ||
// impl Utf8 { | ||
// pub fn into<U: UtfRule>(&self) -> U::Out { | ||
// match *self { | ||
// Utf::Strict => Strict::, | ||
// Utf::Lossy =>, | ||
// Utf::AllowInvalid =>, | ||
// } | ||
// } | ||
// } | ||
|
||
pub const INVALID_UTF8: &'static str = "unexpected invalid UTF-8 code point"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.