feat: added linting

This commit is contained in:
2026-07-07 18:27:45 +02:00
parent 9c0f296aa8
commit d2f03dcd2f
9 changed files with 44 additions and 29 deletions
+14 -5
View File
@@ -1,3 +1,9 @@
#![warn(clippy::pedantic)]
#![warn(clippy::nursery)]
#![warn(clippy::unwrap_used)]
#![warn(clippy::todo)]
#![warn(clippy::panic)]
mod config;
mod dns;
mod ext;
@@ -11,7 +17,10 @@ use dotenv::dotenv;
use tokio::net::UdpSocket;
use tracing::{Instrument, Level};
use crate::{config::ConfigData, dns::*};
use crate::{
config::ConfigData,
dns::{Answer, CLASS_IN, Message, Question, RECORD_TYPE_A, RESPONSE_CODE_NXDOMAIN},
};
#[tokio::main]
async fn main() -> Result<()> {
@@ -61,17 +70,17 @@ async fn handle_datagram(
let mut response = message.prepare_response();
for question in message.questions {
if question.question_class != CLASS_IN {
if question.class != CLASS_IN {
tracing::error!(
"only IN class records are supported yet, requested: {}",
question.question_class
question.class
);
return Ok(());
}
match question.question_type {
match question.qtype {
RECORD_TYPE_A => {
handle_type_a_question(&config, &question, &mut response);
handle_type_a_question(config, &question, &mut response);
}
qt => {
tracing::error!("unsupported question type, requested: {qt}");