Lines Matching defs:borrowed

5205     let borrowed = "borrowed";
5207 match (Cow::from(owned.clone()), Cow::from(borrowed)) {
5208 (Cow::Owned(o), Cow::Borrowed(b)) => assert!(o == owned && b == borrowed),
6478 let borrowed = <$ty>::from(Cow::Borrowed($value));
6480 assert_eq!($value, &*borrowed);
7629 let borrowed: &[_] = &["borrowed", "(slice)"];
7631 match (Cow::from(owned.clone()), Cow::from(borrowed)) {
7632 (Cow::Owned(o), Cow::Borrowed(b)) => assert!(o == owned && b == borrowed),
7639 let borrowed: &[_] = &["borrowed", "(slice)"];
7641 assert_eq!(Vec::from(Cow::Borrowed(borrowed)), vec!["borrowed", "(slice)"]);
8945 let borrowed = Cow::Borrowed("Hello, ");
8951 assert_eq!("Hello, World!", borrowed.clone() + "World!");
8955 if let Cow::Owned(_) = borrowed.clone() + "" {
9010 let mut borrowed = Cow::Borrowed("Hello, ");
9016 let mut s = borrowed.clone();
9036 borrowed += "World!";
9039 assert_eq!("Hello, World!", borrowed);
13279 assert_eq!(format!("{:?}", refcell), "RefCell { value: <borrowed> }");
14975 //! Unlike its `String` counterpart, its contents are borrowed.
16235 /// contents of the string. It has a close relationship with its borrowed
18219 /// The string on the right-hand side is only borrowed; its contents are copied into the returned
18816 //! A module for working with borrowed data.
18843 /// A generalization of `Clone` to borrowed data.
18845 /// Some types make it possible to go from borrowed to owned, usually by
18856 /// Creates owned data from borrowed data, usually by cloning.
18873 /// Uses borrowed data to replace owned data, usually by cloning.
18913 /// can enclose and provide immutable access to borrowed data, and clone the
18915 /// work with general borrowed data via the `Borrow` trait.
18972 /// // Creates a container from borrowed values of a slice
18974 /// let borrowed = Items::new((&readonly[..]).into());
18975 /// match borrowed {
18976 /// Items { values: Cow::Borrowed(b) } => println!("borrowed {:?}", b),
18977 /// _ => panic!("expect borrowed value"),
18980 /// let mut clone_on_write = borrowed;
19026 /// Returns true if the data is borrowed, i.e. if `to_mut` would require additional work.
19089 Borrowed(borrowed) => {
19090 *self = Owned(borrowed.to_owned());
19137 Borrowed(borrowed) => borrowed.to_owned(),
19149 Borrowed(borrowed) => borrowed,
30310 /// The key may be any borrowed form of the map's key type, but the ordering
30311 /// on the borrowed form *must* match the ordering on the key type.
30340 /// The supplied key may be any borrowed form of the map's key type, but the ordering
30341 /// on the borrowed form *must* match the ordering on the key type.
30535 /// The key may be any borrowed form of the map's key type, but the ordering
30536 /// on the borrowed form *must* match the ordering on the key type.
30561 /// The key may be any borrowed form of the map's key type, but the ordering
30562 /// on the borrowed form *must* match the ordering on the key type.
30669 /// The key may be any borrowed form of the map's key type, but the ordering
30670 /// on the borrowed form *must* match the ordering on the key type.
30697 /// The key may be any borrowed form of the map's key type, but the ordering
30698 /// on the borrowed form *must* match the ordering on the key type.
31417 /// Reference to the length field in the borrowed map, updated live.
31419 /// Buried reference to the root field in the borrowed map.
32633 /// The value may be any borrowed form of the set's value type,
32634 /// but the ordering on the borrowed form *must* match the
32657 /// The value may be any borrowed form of the set's value type,
32658 /// but the ordering on the borrowed form *must* match the
32964 /// The value may be any borrowed form of the set's value type,
32965 /// but the ordering on the borrowed form *must* match the
32991 /// The value may be any borrowed form of the set's value type,
32992 /// but the ordering on the borrowed form *must* match the
35376 // Now that we have finished growing the tree using borrowed references,
38099 /// the borrow checker guarantees that the `NodeRef` remains borrowed as long
38294 // SAFETY: there can be no mutable references into this tree borrowed as `Immut`.
38500 // SAFETY: we borrowed `self` exclusively and its borrow type is exclusive.