Skip to content

Commit

Permalink
fix: add function main when not have
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioRibera committed Aug 5, 2024
1 parent cbde236 commit 13d1d59
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/general_commands/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ pub async fn compile(ctx: &Context, msg: &Message) -> CommandResult {
"{INVALID_LANGUAGE} {}",
LANGUAGES.join(", ")
)).await?;
if !code_block.contains("fn main") {
code_block = format!("fn main() {\n{code_block}\n}");
}
return Ok(());
}

Expand Down

0 comments on commit 13d1d59

Please sign in to comment.