-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deprecate borrow() in favor of reborrow(), to eliminate ambiguity wit…
…h std::borrow::Borrow
- Loading branch information
Showing
20 changed files
with
373 additions
and
311 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
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 |
---|---|---|
|
@@ -36,14 +36,14 @@ mod tests { | |
fn populate_address_book(address_book: address_book::Builder) { | ||
let mut people = address_book.init_people(2); | ||
{ | ||
let mut alice = people.borrow().get(0); | ||
let mut alice = people.reborrow().get(0); | ||
alice.set_id(123); | ||
alice.set_name("Alice"); | ||
alice.set_email("[email protected]"); | ||
{ | ||
let mut alice_phones = alice.borrow().init_phones(1); | ||
alice_phones.borrow().get(0).set_number("555-1212"); | ||
alice_phones.borrow().get(0).set_type(person::phone_number::Type::Mobile); | ||
let mut alice_phones = alice.reborrow().init_phones(1); | ||
alice_phones.reborrow().get(0).set_number("555-1212"); | ||
alice_phones.reborrow().get(0).set_type(person::phone_number::Type::Mobile); | ||
} | ||
alice.get_employment().set_school("MIT"); | ||
} | ||
|
@@ -54,11 +54,11 @@ mod tests { | |
bob.set_name("Bob"); | ||
bob.set_email("[email protected]"); | ||
{ | ||
let mut bob_phones = bob.borrow().init_phones(2); | ||
bob_phones.borrow().get(0).set_number("555-4567"); | ||
bob_phones.borrow().get(0).set_type(person::phone_number::Type::Home); | ||
bob_phones.borrow().get(1).set_number("555-7654"); | ||
bob_phones.borrow().get(1).set_type(person::phone_number::Type::Work); | ||
let mut bob_phones = bob.reborrow().init_phones(2); | ||
bob_phones.reborrow().get(0).set_number("555-4567"); | ||
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_type(person::phone_number::Type::Work); | ||
} | ||
bob.get_employment().set_unemployed(()); | ||
} | ||
|
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.