Skip to content

Remove explicit return() calls in content_embedding.R#6

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-style-issues-in-r-content-embedding
Draft

Remove explicit return() calls in content_embedding.R#6
Copilot wants to merge 2 commits intomainfrom
copilot/fix-style-issues-in-r-content-embedding

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 22, 2026

Four functions in R/content_embedding.R used explicit return(), which is unnecessary in R due to implicit return behavior (last evaluated expression is returned automatically).

Changes

  • slide_url: return(var_url)var_url
  • try_include_tweet: return(try(...))try(...)
  • embed_youtube_alt (HTML branch): return(knitr::include_url(url))knitr::include_url(url)
  • embed_youtube_alt (non-HTML branch): return(knitr::include_graphics(...))knitr::include_graphics(...)
# Before
slide_url <- function(df_url, title, slide = NULL) {
  var_url <- paste0(df_url$link[df_url$title == title], slide)
  return(var_url)
}

# After
slide_url <- function(df_url, title, slide = NULL) {
  var_url <- paste0(df_url$link[df_url$title == title], slide)
  var_url
}
Original prompt

This section details on the original issue you should resolve

<issue_title>Fix 4 Style issues in R\content_embedding.R</issue_title>
<issue_description>CodeFactor found multiple issues:

Use implicit return behavior; explicit return() is not needed.

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix style issues in R content_embedding.R Remove explicit return() calls in content_embedding.R Feb 22, 2026
Copilot AI requested a review from smasongarrison February 22, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix 4 Style issues in R\content_embedding.R

2 participants