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

refactor: remove redundant lifetime annotations #56

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion debugger/src/debugger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl FunctionCache {
self.cache.get(sb_fn_id)
}

fn insert<'a, F>(&'a mut self, sb_fn_id: &SBFunctionId, get_type: F)
fn insert<F>(&mut self, sb_fn_id: &SBFunctionId, get_type: F)
where
F: FnOnce() -> SBType,
{
Expand Down
4 changes: 2 additions & 2 deletions debugger/src/value/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ pub(crate) fn enumerate_value<'a>(
Ok((parent, variant))
}

fn value_to_str<'a>(v: &'a SBValue) -> Result<&'a str> {
fn value_to_str(v: &SBValue) -> Result<&str> {
match v.value() {
Some(s) => s.to_str().map_err(|_| WriteErr),
None => Err(WriteErr),
Expand Down Expand Up @@ -680,7 +680,7 @@ where
Ok(bytes)
}

impl<'a> RValueWriter<'a> {
impl RValueWriter<'_> {
fn pointer_to(&mut self, ty: &str, addr: u64, pointee: &SBType, r: usize) -> Result<Bytes> {
let sb_value = sb_value_from_addr("0", addr, pointee)?;
let addr = Addr::from(addr);
Expand Down
2 changes: 1 addition & 1 deletion parser/tests/common/free_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ mod module_a {
}

mod module_a_a_a {
fn free_func_f<'a>(i: &'a u64) -> &'a u64 {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't result in any user-facing changes.

The goal here is just to improve code readability and maintainability.

fn free_func_f(i: &u64) -> &u64 {
i
}
}
Expand Down
2 changes: 1 addition & 1 deletion protocol/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ impl Display for RValue {
/// A wrapper type only for implementing `Display`.
pub struct ArgumentList<'a>(pub &'a [(String, RValue)]);

impl<'a> Display for ArgumentList<'a> {
impl Display for ArgumentList<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let pretty = f.alternate();
for (name, value) in self.0.iter() {
Expand Down