Skip to content

Commit

Permalink
Use RefCell instead of Cell
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed Aug 16, 2019
1 parent 89d7948 commit 5ac5341
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/container_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ mod tests {

#[test]
fn non_copy() {
use core::cell::Cell;
use core::cell::RefCell;

#[repr(C)]
struct Foo {
a: Cell<u8>,
a: RefCell<u8>,
}

let x = Foo { a: Cell::new(0) };
let x = Foo { a: RefCell::new(0) };
unsafe {
assert_eq!(container_of!(&x.a, Foo, a), &x as *const _);
}
Expand Down

0 comments on commit 5ac5341

Please sign in to comment.