-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Context
Currently, we use this match pattern in our backend
let discord_message =
match db_third_party::discord::DiscordMessage::create(client, &payload).await {
Ok(discord_message) => discord_message,
Err(error) => {
return Err((
StatusCode::INTERNAL_SERVER_ERROR,
format!(
"Something went wrong when create discord message: {}",
error
),
)
.into_response())
}
};In order to reduce the overhead of coming up a variable name for Ok(), I purpose that we unify that as below
let discord_message =
match db_third_party::discord::DiscordMessage::create(client, &payload).await {
Ok(result) => result,
Err(error) => {
return Err((
StatusCode::INTERNAL_SERVER_ERROR,
format!(
"Something went wrong when create discord message: {}",
error
),
)
.into_response())
}
};Instead of coming up a new name, we use result
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers