annihilate warnings
Some checks failed
Build and Test / spacebot (push) Failing after 7m52s

This commit is contained in:
kittentm 2026-08-08 20:12:55 +02:00
commit 40a576ff0b
Signed by: kitten
GPG key ID: 394B4EABE4405A83
3 changed files with 4 additions and 37 deletions

View file

@ -1,28 +1,7 @@
use std::fmt::Write;
use std::{env, fs};
use std::fs::FileType;
use std::iter::Map;
use serde::Deserialize;
use serde_json::Value;
#[derive(Deserialize)]
struct CategoryInfo{
name: String,
description: String,
system: String,
}
#[derive(Deserialize)]
struct ErrorInfo{
name: String,
message: String,
short_description: String,
long_description: String,
short_solution: String,
long_solution: String,
support_link: String,
}
fn main(){
println!("cargo:rerun-if-changed=./error-codes");
@ -173,13 +152,6 @@ fn main(){
let long_solution = long_solution.replace("\"", "\\\"")
.replace("\\n", "\n");
let Value::String(support_link) = &error["support_link"] else {
panic!("unable to parse error json");
};
let support_link = support_link.replace("\"", "\\\"")
.replace("\\n", "\n");
code.write_str(
&format!("\
({},{}) => super::ErrorInfo{{\
@ -189,9 +161,8 @@ fn main(){
long_description: \"{}\",
short_solution: \"{}\",
long_solution: \"{}\",
support_link: \"{}\",
}},\
", category_num, error_num, name, message, short_description, long_description, short_solution, long_solution, support_link)
", category_num, error_num, name, message, short_description, long_description, short_solution, long_solution)
).expect("unable to write");
}
}

View file

@ -35,7 +35,6 @@ struct ErrorInfo {
long_description: &'static str,
short_solution: &'static str,
long_solution: &'static str,
support_link: &'static str,
}
impl Default for ErrorInfo {
@ -47,15 +46,12 @@ impl Default for ErrorInfo {
long_solution: "unknown",
short_description: "unknown",
short_solution: "unknown",
support_link: "unknown",
}
}
}
static ERROR_CODE_REGEX: Lazy<Regex> =
Lazy::new(|| Regex::new("\\b\\d\\d\\d-\\d\\d\\d\\d\\b").expect("invalid regex"));
static WORD_BOUNDARY_START: Lazy<Regex> = Lazy::new(|| Regex::new("^\\b").expect("invalid regex"));
static WORD_BOUNDARY_END: Lazy<Regex> = Lazy::new(|| Regex::new("\\b$").expect("invalid regex"));
pub struct ErrorCodeHandler;

View file

@ -1,5 +1,5 @@
use serenity::all::{ActivityData, ActivityType, ChannelId, Colour, Command, CommandId, Context, CreateCommand, CreateEmbed, CreateEmbedAuthor, CreateInputText, CreateInteractionResponse, CreateInteractionResponseMessage, CreateMessage, CreateQuickModal, EventHandler, Guild, GuildId, InputTextStyle, Interaction, Message, Ready, Timestamp};
use serenity::all::{ChannelId, Colour, Command, CommandId, Context, CreateCommand, CreateEmbed, CreateEmbedAuthor, CreateInteractionResponse, CreateInteractionResponseMessage, CreateMessage, CreateQuickModal, EventHandler, Interaction, Ready, Timestamp};
use serenity::async_trait;
use tokio::sync::OnceCell;
@ -10,7 +10,7 @@ pub struct MiiverseModApplicationHandler{
#[async_trait]
impl EventHandler for MiiverseModApplicationHandler {
async fn ready(&self, ctx: Context, data_about_bot: Ready) {
async fn ready(&self, ctx: Context, _data_about_bot: Ready) {
let command = CreateCommand::new("mod-application")
.description("Apply for moderator");
@ -56,7 +56,7 @@ impl EventHandler for MiiverseModApplicationHandler {
let emergency_channel = ChannelId::new(1504018819071610970);
let mut author = CreateEmbedAuthor::from(response.interaction.user);
let author = CreateEmbedAuthor::from(response.interaction.user);
let embed = CreateEmbed::new()
.title("Moderator Application")