-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Makes text::Reader a wrapper around &[u8] and defers utf-8 validation until `to_str()` or `to_string()` is called. This means that users will only need to pay the utf8 validation cost if they actually need it. This also allows users to access (broken) non-utf8 Text data. Previously such data was inaccessible.
- Loading branch information
Showing
21 changed files
with
361 additions
and
202 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
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 |
---|---|---|
|
@@ -35,32 +35,32 @@ mod tests { | |
{ | ||
let mut alice = people.reborrow().get(0); | ||
alice.set_id(123); | ||
alice.set_name("Alice"); | ||
alice.set_email("[email protected]"); | ||
alice.set_name("Alice".into()); | ||
alice.set_email("[email protected]".into()); | ||
{ | ||
let mut alice_phones = alice.reborrow().init_phones(1); | ||
alice_phones.reborrow().get(0).set_number("555-1212"); | ||
alice_phones.reborrow().get(0).set_number("555-1212".into()); | ||
alice_phones | ||
.reborrow() | ||
.get(0) | ||
.set_type(person::phone_number::Type::Mobile); | ||
} | ||
alice.get_employment().set_school("MIT"); | ||
alice.get_employment().set_school("MIT".into()); | ||
} | ||
|
||
{ | ||
let mut bob = people.get(1); | ||
bob.set_id(456); | ||
bob.set_name("Bob"); | ||
bob.set_email("[email protected]"); | ||
bob.set_name("Bob".into()); | ||
bob.set_email("[email protected]".into()); | ||
{ | ||
let mut bob_phones = bob.reborrow().init_phones(2); | ||
bob_phones.reborrow().get(0).set_number("555-4567"); | ||
bob_phones.reborrow().get(0).set_number("555-4567".into()); | ||
bob_phones | ||
.reborrow() | ||
.get(0) | ||
.set_type(person::phone_number::Type::Home); | ||
bob_phones.reborrow().get(1).set_number("555-7654"); | ||
bob_phones.reborrow().get(1).set_number("555-7654".into()); | ||
bob_phones | ||
.reborrow() | ||
.get(1) | ||
|
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
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
Oops, something went wrong.