Skip to content

Commit

Permalink
Spike: Adjust for new lint rules introduced by clippy (#769)
Browse files Browse the repository at this point in the history
  • Loading branch information
TilakMaddy authored Oct 18, 2024
1 parent fb9b73d commit 6aae4b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions aderyn/src/panic.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![allow(clippy::unwrap_used)]
use std::{io::Write, panic::PanicInfo};
use std::{io::Write, panic::PanicHookInfo};
use termcolor::{Color, ColorSpec, WriteColor};

use std::io::IsTerminal;
Expand All @@ -24,10 +24,12 @@ pub fn stderr_buffer_writer() -> BufferWriter {
}

pub fn add_handler() {
std::panic::set_hook(Box::new(move |info: &PanicInfo<'_>| print_compiler_bug_message(info)));
std::panic::set_hook(Box::new(move |info: &PanicHookInfo<'_>| {
print_compiler_bug_message(info)
}));
}

fn print_compiler_bug_message(info: &PanicInfo<'_>) {
fn print_compiler_bug_message(info: &PanicHookInfo<'_>) {
let message =
match (info.payload().downcast_ref::<&str>(), info.payload().downcast_ref::<String>()) {
(Some(s), _) => (*s).to_string(),
Expand Down
1 change: 1 addition & 0 deletions aderyn_core/src/ast/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ macro_rules! node_group {
($group:ident; $( $name:ident ),* $(,)*) => {
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash)]
#[serde(tag = "nodeType")]
#[allow(clippy::large_enum_variant)]
pub enum $group {
$(
$name($name),
Expand Down

0 comments on commit 6aae4b4

Please sign in to comment.