Lines Matching refs:owned

5206     let owned = String::from("owned");
5207 match (Cow::from(owned.clone()), Cow::from(borrowed)) {
5208 (Cow::Owned(o), Cow::Borrowed(b)) => assert!(o == owned && b == borrowed),
5645 let owned: Option<std::string::String> = "string".parse().ok();
5646 assert_eq!(owned.as_ref().map(|s| &**s), Some("string"));
6479 let owned = <$ty>::from(Cow::Owned($value.to_owned()));
6481 assert_eq!($value, &*owned);
7630 let owned = vec!["owned", "(vec)"];
7631 match (Cow::from(owned.clone()), Cow::from(borrowed)) {
7632 (Cow::Owned(o), Cow::Borrowed(b)) => assert!(o == owned && b == borrowed),
7640 let owned = vec!["owned", "(vec)"];
7642 assert_eq!(Vec::from(Cow::Owned(owned)), vec!["owned", "(vec)"]);
8948 let owned: Cow<'_, str> = Cow::Owned(String::from("Hi, "));
8953 assert_eq!("Hi, World!", owned.clone() + "World!");
9013 let mut owned: Cow<'_, str> = Cow::Owned(String::from("Hi, "));
9035 owned += "World!";
9038 assert_eq!("Hi, World!", owned);
14928 /// Frees the memory owned by the `RawVec` *without* trying to drop its contents.
18542 /// It is notable that the `str` slice is owned.
18562 /// Converts the given `String` to a boxed `str` slice that is owned.
18845 /// Some types make it possible to go from borrowed to owned, usually by
18847 /// to `T`. The `ToOwned` trait generalizes `Clone` to construct owned data
18856 /// Creates owned data from borrowed data, usually by cloning.
18873 /// Uses borrowed data to replace owned data, usually by cloning.
18919 /// is desired, `to_mut` will obtain a mutable reference to an owned
18936 /// // Clones into a vector if not already owned.
18952 /// // No clone occurs because `input` is already owned.
18981 /// // Mutates the data from slice into owned vec and pushes a new value on top
18987 /// Items { values: Cow::Owned(_) } => println!("clone_on_write contains owned data"),
18988 /// _ => panic!("expect owned data"),
19049 /// Returns true if the data is owned, i.e. if `to_mut` would be a no-op.
19069 /// Acquires a mutable reference to the owned form of the data.
19071 /// Clones the data if it is not already owned.
19093 Owned(ref mut owned) => owned,
19096 Owned(ref mut owned) => owned,
19100 /// Extracts the owned data.
19102 /// Clones the data if it is not already owned.
19138 Owned(owned) => owned,
19150 Owned(ref owned) => owned.borrow(),
19223 /// Creates an owned Cow<'a, B> with the default value for the contained owned value.
19580 //! Consider a scenario where a set of `Gadget`s are owned by a given `Owner`.
19629 //! println!("Gadget {} owned by {}", gadget1.id, gadget1.owner.name);
19630 //! println!("Gadget {} owned by {}", gadget2.id, gadget2.owner.name);
19717 //! println!("Gadget {} owned by {}", gadget.id, gadget.owner.name);
19838 // There is an implicit weak pointer owned by all the strong
19987 // There is an implicit weak pointer owned by all the strong
26945 //! A doubly-linked list with owned nodes.
26973 /// A doubly-linked list with owned nodes.
35875 // Empty but root is owned (Some(...)):
38044 /// A managed, non-null pointer to a node. This is either an owned pointer to
38045 /// `LeafNode<K, V>` or an owned pointer to `InternalNode<K, V>`.
38116 /// The root node of an owned tree.
38469 /// Returns a new owned tree, with its own root node that is initially empty.
38514 /// Mutably borrows the owned root node. Unlike `reborrow_mut`, this is safe
38521 /// Slightly mutably borrows the owned root node.
46680 // Adapter<Adapter<Adapter<IntoIter>>> (all owned by core/std). Additional bounds
47150 /// and from a [`Box<[T]>`][owned slice] without reallocating or moving the elements.
47179 /// [owned slice]: Box
47749 /// Converts the vector into [`Box<[T]>`][owned slice].
47753 /// [owned slice]: Box
50884 /// After calling this function, the raw pointer is owned by the
50933 /// After calling this function, the raw pointer is owned by the