Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use is.character over inherits(character) #693

Merged
merged 3 commits into from Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Expand Up @@ -29,6 +29,8 @@
- empty lines are now removed between pipes (#645).
- overhaul pgkdown site: Add search (#623), group function in Reference (#625).
- always strip trailing spaces and make cache insensitive to it (#626).
- `style_text()` can now style all input that `is.character()`, not just if it
inherits from classes `character`, `utf8` or `vertical` (#693).
- minor documentation improvements (#643, #618, #614, #677, #651, #667, #672,
#687).
- The internal `create_tree()` only used in testing of styler now works when the
Expand Down
2 changes: 1 addition & 1 deletion R/io.R
Expand Up @@ -75,7 +75,7 @@ read_utf8 <- function(path) {
warning = function(w) w,
error = function(e) e
)
if (inherits(out, "character")) {
if (is.character(out)) {
list(
text = out,
missing_EOF_line_break = FALSE
Expand Down
2 changes: 1 addition & 1 deletion R/vertical.R
Expand Up @@ -5,7 +5,7 @@
#' @param x A character vector or an object of class "vertical".
#' @keywords internal
construct_vertical <- function(x) {
stopifnot(inherits(x, what = c("utf8", "character", "vertical")))
stopifnot(is.character(x))
structure(x, class = "vertical")
}

Expand Down