feat: added linting
This commit is contained in:
+14
-5
@@ -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}");
|
||||
|
||||
Reference in New Issue
Block a user