Skip to content

Commit

Permalink
fix: correctly find slice_end
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Jan 6, 2023
1 parent f754cd3 commit 7e2db94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/code_embed/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub async fn handle_code_url(ctx: &serenity::Context, new_message: &serenity::Me

if let Some(end) = new_slice
.find(' ')
.or_else(|| new_slice.find('\n'))
.or(Some(new_slice.len()))
.map(|slice_end| start + slice_end)
{
debug!("HTTP url end: {}", end);
Expand Down Expand Up @@ -72,7 +72,7 @@ pub async fn handle_code_url(ctx: &serenity::Context, new_message: &serenity::Me
for code_preview in code_previews {
message = message.add_embed(|e| {
let mut e = e
.title("Code preview")
.title("Source code")
.url(code_preview.code.original_code_url)
.color(configuration.general.embed_color)
.field(
Expand Down

0 comments on commit 7e2db94

Please sign in to comment.