8000 rust: xarray: fix example · Rust-for-Linux/linux@6641013 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6641013

Browse files
committed
rust: xarray: fix example
1 parent 2b9f55e commit 6641013

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rust/kernel/xarray.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ impl<'a, T: ForeignOwnable> Drop for Reservation<'a, T> {
150150
/// let arr = Box::pin_init(XArray::<Arc<Foo>>::new(flags::ALLOC1))
151151
/// .expect("Unable to allocate XArray");
152152
///
153-
/// let foo = Arc::try_new(Foo { a : 1, b: 2 }).expect("Unable to allocate Foo");
154-
/// let index = arr.alloc(foo).expect("Error allocating Index");
153+
/// let item = Arc::try_new(Foo { a : 1, b: 2 }).expect("Unable to allocate Foo");
154+
/// let index = arr.alloc(item).expect("Error allocating Index");
155155
///
156156
/// if let Some(guard) = arr.get_locked(index) {
157157
/// assert_eq!(guard.borrow().a, 1);
@@ -160,8 +160,8 @@ impl<'a, T: ForeignOwnable> Drop for Reservation<'a, T> {
160160
/// pr_info!("No value found in index {}", index);
161161
/// }
162162
///
163-
/// let foo = Arc::try_new(Foo { a : 3, b: 4 }).expect("Unable to allocate Foo");
164-
/// let index = arr.alloc(foo).expect("Error allocating Index");
163+
/// let item = Arc::try_new(Foo { a : 3, b: 4 }).expect("Unable to allocate Foo");
164+
/// let index = arr.alloc(item).expect("Error allocating Index");
165165
///
166166
/// if let Some(removed_data) = arr.remove(index) {
167167
/// assert_eq!(removed_data.a, 3);

0 commit comments

Comments
 (0)
0