fix clippy warnings
This commit is contained in:
		
							
								
								
									
										10
									
								
								src/main.rs
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								src/main.rs
									
									
									
									
									
								
							@@ -1,5 +1,4 @@
 | 
				
			|||||||
use poise::serenity_prelude::{self as serenity, GatewayIntents};
 | 
					use poise::serenity_prelude::{self as serenity, GatewayIntents};
 | 
				
			||||||
use dotenv;
 | 
					 | 
				
			||||||
mod command;
 | 
					mod command;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pub struct Data {} // User data, which is stored and accessible in all command invocations
 | 
					pub struct Data {} // User data, which is stored and accessible in all command invocations
 | 
				
			||||||
@@ -101,10 +100,15 @@ fn read_env() -> BotEnv {
 | 
				
			|||||||
    dotenv::dotenv().ok();
 | 
					    dotenv::dotenv().ok();
 | 
				
			||||||
    // ==================== ID ===========================
 | 
					    // ==================== ID ===========================
 | 
				
			||||||
    let id: String = std::env::var(DISCORD_ID)
 | 
					    let id: String = std::env::var(DISCORD_ID)
 | 
				
			||||||
        .expect(&format!("WARN: Missing {DISCORD_ID}\n> This isn't really that problematic, just that the generated invite link won't work."));
 | 
					        .unwrap_or_else(|_| {
 | 
				
			||||||
 | 
					            println!(r#"
 | 
				
			||||||
 | 
					WARN: Missing {DISCORD_ID}
 | 
				
			||||||
 | 
					> This isn't really that problematic, just that the generated invite link won't work."#);
 | 
				
			||||||
 | 
					            String::from("")
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
    // ==================== Token ========================
 | 
					    // ==================== Token ========================
 | 
				
			||||||
    let token: String = std::env::var(DISCORD_TOKEN)
 | 
					    let token: String = std::env::var(DISCORD_TOKEN)
 | 
				
			||||||
        .expect(&format!("ERROR: Missing {DISCORD_TOKEN}"));
 | 
					        .unwrap_or_else(|_| panic!("ERROR: Missing {DISCORD_TOKEN}"));
 | 
				
			||||||
    // ==================== Intents ======================
 | 
					    // ==================== Intents ======================
 | 
				
			||||||
    let intents_env: String = std::env::var(DISCORD_INTENTS)
 | 
					    let intents_env: String = std::env::var(DISCORD_INTENTS)
 | 
				
			||||||
        .unwrap_or_else(|msg| {
 | 
					        .unwrap_or_else(|msg| {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user