Remove unnecessary Option<>
Add missing comment, fix typo
This commit is contained in:
parent
dc0a7824c0
commit
1a6dd19c01
15
src/main.rs
15
src/main.rs
|
@ -164,11 +164,11 @@ fn embed(ctx: &mut Context, message: &Message, args: Args) -> CommandResult {
|
|||
|
||||
#[derive(Deserialize)]
|
||||
struct EmbedProperties {
|
||||
author: Option<(String, Option<String>)>,
|
||||
author: Option<(String, String)>,
|
||||
colour: String,
|
||||
description: Option<String>,
|
||||
fields: Option<Vec<(String, String, bool)>>,
|
||||
footer: Option<(String, Option<String>)>,
|
||||
footer: Option<(String, String)>,
|
||||
image: Option<String>,
|
||||
timestamp: Option<String>,
|
||||
title: Option<String>,
|
||||
|
@ -194,11 +194,9 @@ fn embed(ctx: &mut Context, message: &Message, args: Args) -> CommandResult {
|
|||
if input_embed.author != None {
|
||||
let auth = input_embed.author.unwrap();
|
||||
e.author(|a| {
|
||||
//assumin first array element is name and second is icon url
|
||||
//assuming first array element is name and second is icon url
|
||||
a.name(auth.0);
|
||||
if auth.1 != None {
|
||||
a.icon_url(auth.1.unwrap());
|
||||
}
|
||||
a.icon_url(auth.1);
|
||||
|
||||
a
|
||||
});
|
||||
|
@ -222,10 +220,9 @@ fn embed(ctx: &mut Context, message: &Message, args: Args) -> CommandResult {
|
|||
if input_embed.footer != None {
|
||||
let foot = input_embed.footer.unwrap();
|
||||
e.footer(|f| {
|
||||
//assuming first array element is name and second is icon url
|
||||
f.text(foot.0);
|
||||
if foot.1 != None {
|
||||
f.icon_url(foot.1.unwrap());
|
||||
}
|
||||
f.icon_url(foot.1);
|
||||
|
||||
f
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue