|
78 | 78 | //! use std::cell::RefCell; |
79 | 79 | //! |
80 | 80 | //! struct Graph { |
81 | | -//! edges: Vec<(uint, uint)>, |
82 | | -//! span_tree_cache: RefCell<Option<Vec<(uint, uint)>>> |
| 81 | +//! edges: Vec<(i32, i32)>, |
| 82 | +//! span_tree_cache: RefCell<Option<Vec<(i32, i32)>>> |
83 | 83 | //! } |
84 | 84 | //! |
85 | 85 | //! impl Graph { |
86 | | -//! fn minimum_spanning_tree(&self) -> Vec<(uint, uint)> { |
| 86 | +//! fn minimum_spanning_tree(&self) -> Vec<(i32, i32)> { |
87 | 87 | //! // Create a new scope to contain the lifetime of the |
88 | 88 | //! // dynamic borrow |
89 | 89 | //! { |
|
104 | 104 | //! // This is the major hazard of using `RefCell`. |
105 | 105 | //! self.minimum_spanning_tree() |
106 | 106 | //! } |
107 | | -//! # fn calc_span_tree(&self) -> Vec<(uint, uint)> { vec![] } |
| 107 | +//! # fn calc_span_tree(&self) -> Vec<(i32, i32)> { vec![] } |
108 | 108 | //! } |
109 | 109 | //! ``` |
110 | 110 | //! |
|
125 | 125 | //! |
126 | 126 | //! struct RcBox<T> { |
127 | 127 | //! value: T, |
128 | | -//! refcount: Cell<uint> |
| 128 | +//! refcount: Cell<usize> |
129 | 129 | //! } |
130 | 130 | //! |
131 | 131 | //! impl<T> Clone for Rc<T> { |
@@ -279,8 +279,8 @@ pub enum BorrowState { |
279 | 279 | } |
280 | 280 |
|
281 | 281 | // Values [1, MAX-1] represent the number of `Ref` active |
282 | | -// (will not outgrow its range since `uint` is the size of the address space) |
283 | | -type BorrowFlag = uint; |
| 282 | +// (will not outgrow its range since `usize` is the size of the address space) |
| 283 | +type BorrowFlag = usize; |
284 | 284 | const UNUSED: BorrowFlag = 0; |
285 | 285 | const WRITING: BorrowFlag = -1; |
286 | 286 |
|
|
0 commit comments