Skip to content

Commit 2a8e5bc

Browse files
hadleysckott
andauthored
Eliminate partial match warnings (#147)
I'm reasonably certain that this is correct based on my reading on httr2 and httr source code. Co-authored-by: Scott Chamberlain <sckott@fastmail.com>
1 parent bbca3e5 commit 2a8e5bc

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ importFrom(rlang,abort)
6363
importFrom(rlang,caller_arg)
6464
importFrom(rlang,caller_env)
6565
importFrom(rlang,check_installed)
66+
importFrom(rlang,has_name)
6667
importFrom(rlang,is_empty)
6768
importFrom(rlang,is_error)
6869
importFrom(rlang,is_function)

R/pluck_body.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pluck_body <- function(x) {
2222
return(x$fields)
2323

2424
# json/raw-encoded body
25-
} else if (!is.null(x$options$postfields) && is.raw(x$options$postfields)) {
25+
} else if (has_name(x$options, "postfields") && is.raw(x$options$postfields)) {
2626
return(rawToChar(x$options$postfields))
2727

2828
# upload not in a list
@@ -49,5 +49,6 @@ assert_request <- function(x) {
4949

5050
is_body_empty <- function(x) {
5151
is.null(x$fields) &&
52-
(is.null(x$options$postfieldsize) || x$options$postfieldsize == 0L)
52+
(!has_name(x$options, "postfieldsize_large") || x$options$postfieldsize_large == 0L) &&
53+
(!has_name(x$options, "postfieldsize") || x$options$postfieldsize == 0L)
5354
}

R/webmockr-package.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
#' @importFrom fauxpas HTTPRequestTimeout
2323
#' @importFrom R6 R6Class
2424
#' @importFrom rlang abort warn check_installed is_list is_function is_error
25-
#' caller_arg try_fetch caller_env is_installed
25+
#' caller_arg try_fetch caller_env is_installed has_name
2626
## usethis namespace: end
2727
NULL

0 commit comments

Comments
 (0)