Lines Matching refs:Some

39 //! assert_eq!(lazycell.borrow(), Some(&1));
40 //! assert_eq!(lazycell.into_inner(), Some(1));
80 *slot = Some(value);
96 mem::replace(unsafe { &mut *self.inner.get() }, Some(value))
107 /// This function will return `Some` if the cell has been previously
116 /// This function will return `Some` if the cell has been previously
132 if let Some(value) = self.borrow() {
170 if let Some(value) = self.borrow() {
211 /// This function will return `Some` if the cell has been previously initialized,
261 unsafe { *self.inner.get() = Some(t) };
285 mem::replace(unsafe { &mut *self.inner.get() }, Some(value))
296 /// This function will return `Some` if the cell has been previously
318 /// This function will return `Some` if the cell has been previously initialized,
338 inner: UnsafeCell::new(Some(v.clone())),
373 assert_eq!(value, Some(&1));
376 assert_eq!(value, Some(1));
385 assert_eq!(lazycell.borrow_mut(), Some(&mut 1));
388 assert_eq!(lazycell.borrow_mut(), Some(&mut 2));
545 assert_eq!(value, Some(1));
568 assert_eq!(value, Some(&1));
571 assert_eq!(value, Some(1));
588 assert_eq!(value, Some(1));
595 assert_eq!(cell.replace(2), Some(1));
596 assert_eq!(cell.replace(3), Some(2));
597 assert_eq!(cell.borrow(), Some(&3));
607 assert_eq!(cell.replace(2), Some(1));
608 assert_eq!(cell.replace(3), Some(2));
609 assert_eq!(cell.borrow(), Some(&3));
620 assert_eq!(clone2.borrow(), Some(&1));
621 assert_eq!(cell.replace(2), Some(1));
623 assert_eq!(clone2.borrow(), Some(&1));
625 assert_eq!(clone2.replace(4), Some(1));
626 assert_eq!(clone1.borrow(), Some(&3));
627 assert_eq!(clone2.borrow(), Some(&4));
628 assert_eq!(cell.borrow(), Some(&2));
639 assert_eq!(clone2.borrow(), Some(&1));
640 assert_eq!(cell.replace(2), Some(1));
642 assert_eq!(clone2.borrow(), Some(&1));
644 assert_eq!(clone2.replace(4), Some(1));
645 assert_eq!(clone1.borrow(), Some(&3));
646 assert_eq!(clone2.borrow(), Some(&4));
647 assert_eq!(cell.borrow(), Some(&2));