Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ManagedVecRefMut rename #1884

Merged
merged 3 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ mod managed_vec_item;
mod managed_vec_item_nested_tuple;
mod managed_vec_item_payload;
mod managed_vec_owned_iter;
mod managed_vec_ref;
mod managed_vec_ref_iter;
mod managed_vec_ref_mut;
pub(crate) mod preloaded_managed_buffer;
mod randomness_source;
mod token_identifier;
Expand Down Expand Up @@ -53,8 +53,8 @@ pub use managed_vec_item::{
pub use managed_vec_item_nested_tuple::ManagedVecItemNestedTuple;
pub use managed_vec_item_payload::*;
pub use managed_vec_owned_iter::ManagedVecOwnedIterator;
pub use managed_vec_ref::ManagedVecRef;
pub use managed_vec_ref_iter::ManagedVecRefIterator;
pub use managed_vec_ref_mut::ManagedVecRefMut;
pub use randomness_source::RandomnessSource;
pub use token_identifier::TokenIdentifier;

Expand Down
8 changes: 4 additions & 4 deletions framework/base/src/types/managed/wrapped/managed_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use crate::{
TopEncodeMultiOutput, TopEncodeOutput,
},
types::{
ManagedBuffer, ManagedBufferNestedDecodeInput, ManagedType, ManagedVecItem, ManagedVecRef,
ManagedVecRefIterator, MultiValueEncoded, MultiValueManagedVec,
ManagedBuffer, ManagedBufferNestedDecodeInput, ManagedType, ManagedVecItem,
ManagedVecRefIterator, ManagedVecRefMut, MultiValueEncoded, MultiValueManagedVec,
},
};
use alloc::{format, vec::Vec};
Expand Down Expand Up @@ -182,8 +182,8 @@ where
}
}

pub fn get_mut(&mut self, index: usize) -> ManagedVecRef<M, T> {
ManagedVecRef::new(self.get_handle(), index)
pub fn get_mut(&mut self, index: usize) -> ManagedVecRefMut<M, T> {
ManagedVecRefMut::new(self.get_handle(), index)
}

pub(super) unsafe fn get_unsafe(&self, index: usize) -> T {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

use super::{ManagedRef, ManagedRefMut};

pub struct ManagedVecRef<'a, M, T>
pub struct ManagedVecRefMut<'a, M, T>
where
M: ManagedTypeApi,
T: ManagedVecItem,
Expand All @@ -22,7 +22,7 @@
item: ManuallyDrop<T>,
}

impl<'a, M, T> ManagedVecRef<'a, M, T>
impl<'a, M, T> ManagedVecRefMut<'a, M, T>

Check warning on line 25 in framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs#L25

warning: the following explicit lifetimes could be elided: 'a --> framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:25:6 | 25 | impl<'a, M, T> ManagedVecRefMut<'a, M, T> | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 25 - impl<'a, M, T> ManagedVecRefMut<'a, M, T> 25 + impl<M, T> ManagedVecRefMut<'_, M, T> |
Raw output
framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:25:6:w:warning: the following explicit lifetimes could be elided: 'a
  --> framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:25:6
   |
25 | impl<'a, M, T> ManagedVecRefMut<'a, M, T>
   |      ^^                         ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
   |
25 - impl<'a, M, T> ManagedVecRefMut<'a, M, T>
25 + impl<M, T> ManagedVecRefMut<'_, M, T>
   |


__END__

Check warning on line 25 in framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs#L25

warning: the following explicit lifetimes could be elided: 'a --> framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:25:6 | 25 | impl<'a, M, T> ManagedVecRefMut<'a, M, T> | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 25 - impl<'a, M, T> ManagedVecRefMut<'a, M, T> 25 + impl<M, T> ManagedVecRefMut<'_, M, T> |
Raw output
framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:25:6:w:warning: the following explicit lifetimes could be elided: 'a
  --> framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:25:6
   |
25 | impl<'a, M, T> ManagedVecRefMut<'a, M, T>
   |      ^^                         ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
   |
25 - impl<'a, M, T> ManagedVecRefMut<'a, M, T>
25 + impl<M, T> ManagedVecRefMut<'_, M, T>
   |


__END__
where
M: ManagedTypeApi,
T: ManagedVecItem,
Expand All @@ -47,7 +47,7 @@
}
}

impl<'a, M, T> Drop for ManagedVecRef<'a, M, T>
impl<'a, M, T> Drop for ManagedVecRefMut<'a, M, T>

Check warning on line 50 in framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs#L50

warning: the following explicit lifetimes could be elided: 'a --> framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:50:6 | 50 | impl<'a, M, T> Drop for ManagedVecRefMut<'a, M, T> | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 50 - impl<'a, M, T> Drop for ManagedVecRefMut<'a, M, T> 50 + impl<M, T> Drop for ManagedVecRefMut<'_, M, T> |
Raw output
framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:50:6:w:warning: the following explicit lifetimes could be elided: 'a
  --> framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:50:6
   |
50 | impl<'a, M, T> Drop for ManagedVecRefMut<'a, M, T>
   |      ^^                                  ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
   |
50 - impl<'a, M, T> Drop for ManagedVecRefMut<'a, M, T>
50 + impl<M, T> Drop for ManagedVecRefMut<'_, M, T>
   |


__END__

Check warning on line 50 in framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs#L50

warning: the following explicit lifetimes could be elided: 'a --> framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:50:6 | 50 | impl<'a, M, T> Drop for ManagedVecRefMut<'a, M, T> | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 50 - impl<'a, M, T> Drop for ManagedVecRefMut<'a, M, T> 50 + impl<M, T> Drop for ManagedVecRefMut<'_, M, T> |
Raw output
framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:50:6:w:warning: the following explicit lifetimes could be elided: 'a
  --> framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:50:6
   |
50 | impl<'a, M, T> Drop for ManagedVecRefMut<'a, M, T>
   |      ^^                                  ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
   |
50 - impl<'a, M, T> Drop for ManagedVecRefMut<'a, M, T>
50 + impl<M, T> Drop for ManagedVecRefMut<'_, M, T>
   |


__END__
where
M: ManagedTypeApi,
T: ManagedVecItem,
Expand All @@ -63,7 +63,7 @@
}
}

impl<'a, M, T> Deref for ManagedVecRef<'a, M, T>
impl<'a, M, T> Deref for ManagedVecRefMut<'a, M, T>

Check warning on line 66 in framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs#L66

warning: the following explicit lifetimes could be elided: 'a --> framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:66:6 | 66 | impl<'a, M, T> Deref for ManagedVecRefMut<'a, M, T> | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 66 - impl<'a, M, T> Deref for ManagedVecRefMut<'a, M, T> 66 + impl<M, T> Deref for ManagedVecRefMut<'_, M, T> |
Raw output
framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:66:6:w:warning: the following explicit lifetimes could be elided: 'a
  --> framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:66:6
   |
66 | impl<'a, M, T> Deref for ManagedVecRefMut<'a, M, T>
   |      ^^                                   ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
   |
66 - impl<'a, M, T> Deref for ManagedVecRefMut<'a, M, T>
66 + impl<M, T> Deref for ManagedVecRefMut<'_, M, T>
   |


__END__

Check warning on line 66 in framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs#L66

warning: the following explicit lifetimes could be elided: 'a --> framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:66:6 | 66 | impl<'a, M, T> Deref for ManagedVecRefMut<'a, M, T> | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 66 - impl<'a, M, T> Deref for ManagedVecRefMut<'a, M, T> 66 + impl<M, T> Deref for ManagedVecRefMut<'_, M, T> |
Raw output
framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:66:6:w:warning: the following explicit lifetimes could be elided: 'a
  --> framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:66:6
   |
66 | impl<'a, M, T> Deref for ManagedVecRefMut<'a, M, T>
   |      ^^                                   ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
   |
66 - impl<'a, M, T> Deref for ManagedVecRefMut<'a, M, T>
66 + impl<M, T> Deref for ManagedVecRefMut<'_, M, T>
   |


__END__
where
M: ManagedTypeApi,
T: ManagedVecItem,
Expand All @@ -75,7 +75,7 @@
}
}

impl<'a, M, T> DerefMut for ManagedVecRef<'a, M, T>
impl<'a, M, T> DerefMut for ManagedVecRefMut<'a, M, T>

Check warning on line 78 in framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs#L78

warning: the following explicit lifetimes could be elided: 'a --> framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:78:6 | 78 | impl<'a, M, T> DerefMut for ManagedVecRefMut<'a, M, T> | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 78 - impl<'a, M, T> DerefMut for ManagedVecRefMut<'a, M, T> 78 + impl<M, T> DerefMut for ManagedVecRefMut<'_, M, T> |
Raw output
framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:78:6:w:warning: the following explicit lifetimes could be elided: 'a
  --> framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:78:6
   |
78 | impl<'a, M, T> DerefMut for ManagedVecRefMut<'a, M, T>
   |      ^^                                      ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
   |
78 - impl<'a, M, T> DerefMut for ManagedVecRefMut<'a, M, T>
78 + impl<M, T> DerefMut for ManagedVecRefMut<'_, M, T>
   |


__END__

Check warning on line 78 in framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs#L78

warning: the following explicit lifetimes could be elided: 'a --> framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:78:6 | 78 | impl<'a, M, T> DerefMut for ManagedVecRefMut<'a, M, T> | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 78 - impl<'a, M, T> DerefMut for ManagedVecRefMut<'a, M, T> 78 + impl<M, T> DerefMut for ManagedVecRefMut<'_, M, T> |
Raw output
framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:78:6:w:warning: the following explicit lifetimes could be elided: 'a
  --> framework/base/src/types/managed/wrapped/managed_vec_ref_mut.rs:78:6
   |
78 | impl<'a, M, T> DerefMut for ManagedVecRefMut<'a, M, T>
   |      ^^                                      ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
   |
78 - impl<'a, M, T> DerefMut for ManagedVecRefMut<'a, M, T>
78 + impl<M, T> DerefMut for ManagedVecRefMut<'_, M, T>
   |


__END__
where
M: ManagedTypeApi,
T: ManagedVecItem,
Expand Down
Loading