Skip to content
Merged
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
4 changes: 2 additions & 2 deletions src/cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ impl<'data> ProguardCache<'data> {
if let Some(line) = lines.next() {
match stacktrace::parse_throwable(line) {
None => match stacktrace::parse_frame(line) {
None => writeln!(&mut stacktrace, "{}", line)?,
None => writeln!(&mut stacktrace, "{line}")?,
Some(frame) => format_frames(&mut stacktrace, line, self.remap_frame(&frame))?,
},
Some(throwable) => {
Expand All @@ -348,7 +348,7 @@ impl<'data> ProguardCache<'data> {
.strip_prefix("Caused by: ")
.and_then(stacktrace::parse_throwable)
{
None => writeln!(&mut stacktrace, "{}", line)?,
None => writeln!(&mut stacktrace, "{line}")?,
Some(cause) => {
format_cause(&mut stacktrace, line, self.remap_throwable(&cause))?
}
Expand Down
12 changes: 6 additions & 6 deletions src/java.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ fn byte_code_type_to_java_type(byte_code_type: &str, mapper: &ProguardMapper) ->
let obfuscated = chrs.as_str().replace('/', ".");

if let Some(mapped) = mapper.remap_class(&obfuscated) {
return Some(format!("{}{}", mapped, suffix));
return Some(format!("{mapped}{suffix}"));
}

return Some(format!("{}{}", obfuscated, suffix));
return Some(format!("{obfuscated}{suffix}"));
} else if token == '[' {
suffix.push_str("[]");
continue;
} else if let Some(ty) = java_base_types(token) {
return Some(format!("{}{}", ty, suffix));
return Some(format!("{ty}{suffix}"));
}
}
None
Expand All @@ -57,15 +57,15 @@ fn byte_code_type_to_java_type_cache(
let obfuscated = chrs.as_str().replace('/', ".");

if let Some(mapped) = cache.remap_class(&obfuscated) {
return Some(format!("{}{}", mapped, suffix));
return Some(format!("{mapped}{suffix}"));
}

return Some(format!("{}{}", obfuscated, suffix));
return Some(format!("{obfuscated}{suffix}"));
} else if token == '[' {
suffix.push_str("[]");
continue;
} else if let Some(ty) = java_base_types(token) {
return Some(format!("{}{}", ty, suffix));
return Some(format!("{ty}{suffix}"));
}
}
None
Expand Down
16 changes: 8 additions & 8 deletions src/mapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ impl<'s> ProguardMapper<'s> {
if let Some(line) = lines.next() {
match stacktrace::parse_throwable(line) {
None => match stacktrace::parse_frame(line) {
None => writeln!(&mut stacktrace, "{}", line)?,
None => writeln!(&mut stacktrace, "{line}")?,
Some(frame) => format_frames(&mut stacktrace, line, self.remap_frame(&frame))?,
},
Some(throwable) => {
Expand All @@ -465,7 +465,7 @@ impl<'s> ProguardMapper<'s> {
.strip_prefix("Caused by: ")
.and_then(stacktrace::parse_throwable)
{
None => writeln!(&mut stacktrace, "{}", line)?,
None => writeln!(&mut stacktrace, "{line}")?,
Some(cause) => {
format_cause(&mut stacktrace, line, self.remap_throwable(&cause))?
}
Expand Down Expand Up @@ -517,9 +517,9 @@ pub(crate) fn format_throwable(
throwable: Option<Throwable<'_>>,
) -> Result<(), FmtError> {
if let Some(throwable) = throwable {
writeln!(stacktrace, "{}", throwable)
writeln!(stacktrace, "{throwable}")
} else {
writeln!(stacktrace, "{}", line)
writeln!(stacktrace, "{line}")
}
}

Expand All @@ -531,10 +531,10 @@ pub(crate) fn format_frames<'s>(
let mut remapped = remapped.peekable();

if remapped.peek().is_none() {
return writeln!(stacktrace, "{}", line);
return writeln!(stacktrace, "{line}");
}
for line in remapped {
writeln!(stacktrace, " {}", line)?;
writeln!(stacktrace, " {line}")?;
}

Ok(())
Expand All @@ -546,9 +546,9 @@ pub(crate) fn format_cause(
cause: Option<Throwable<'_>>,
) -> Result<(), FmtError> {
if let Some(cause) = cause {
writeln!(stacktrace, "Caused by: {}", cause)
writeln!(stacktrace, "Caused by: {cause}")
} else {
writeln!(stacktrace, "{}", line)
writeln!(stacktrace, "{line}")
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/stacktrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ impl<'s> StackTrace<'s> {
impl Display for StackTrace<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
if let Some(exception) = &self.exception {
writeln!(f, "{}", exception)?;
writeln!(f, "{exception}")?;
}

for frame in &self.frames {
writeln!(f, " {}", frame)?;
writeln!(f, " {frame}")?;
}

if let Some(cause) = &self.cause {
write!(f, "Caused by: {}", cause)?;
write!(f, "Caused by: {cause}")?;
}

Ok(())
Expand Down Expand Up @@ -346,7 +346,7 @@ impl Display for Throwable<'_> {
write!(f, "{}", self.class)?;

if let Some(message) = self.message {
write!(f, ": {}", message)?;
write!(f, ": {message}")?;
}

Ok(())
Expand Down
Loading