Skip to content

Commit

Permalink
Require a mutable reference for the glib::List mutable iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
sdroege committed Sep 27, 2023
1 parent 59bb7e0 commit a638d94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion glib/src/collections/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ pub struct IterMut<'a, T: TransparentPtrType> {

impl<'a, T: TransparentPtrType> IterMut<'a, T> {
#[inline]
fn new(list: &'a List<T>) -> IterMut<'a, T> {
fn new(list: &'a mut List<T>) -> IterMut<'a, T> {
debug_assert_eq!(
mem::size_of::<T>(),
mem::size_of::<<T as GlibPtrDefault>::GlibType>()
Expand Down
2 changes: 1 addition & 1 deletion glib/src/collections/slist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ pub struct IterMut<'a, T: TransparentPtrType> {

impl<'a, T: TransparentPtrType> IterMut<'a, T> {
#[inline]
fn new(list: &'a SList<T>) -> IterMut<'a, T> {
fn new(list: &'a mut SList<T>) -> IterMut<'a, T> {
debug_assert_eq!(
mem::size_of::<T>(),
mem::size_of::<<T as GlibPtrDefault>::GlibType>()
Expand Down

0 comments on commit a638d94

Please sign in to comment.