Skip to content

Commit 79fd178

Browse files
authored
Fix spacing (#515)
1 parent aa63997 commit 79fd178

26 files changed

+119
-125
lines changed

R/oauth-client.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,3 @@ oauth_client_get_token <- function(client,
240240
resp <- oauth_flow_fetch(req, "client$token_url", error_call = error_call)
241241
exec(oauth_token, !!!resp)
242242
}
243-

R/oauth-flow.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
oauth_flow_fetch <- function(req, source, error_call = caller_env()) {
2-
req <- req_error(req, is_error = ~ FALSE)
2+
req <- req_error(req, is_error = ~FALSE)
33
resp <- req_perform(req, error_call = current_call())
44

55
oauth_flow_parse(resp, source, error_call = error_call)

R/req-cache.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ cache_exists <- function(req) {
9191
if (!req_policy_exists(req, "cache_path")) {
9292
return(FALSE)
9393
}
94-
94+
9595
path <- req_cache_path(req)
9696
if (!file.exists(path)) {
9797
return(FALSE)

R/req-cookies.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,3 @@ req_cookie_preserve <- function(req, path) {
3535
cookiefile = path
3636
)
3737
}
38-

R/req-perform-stream.R

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
21
#' Perform a request and handle data as it streams back
3-
#'
2+
#'
43
#' @description
54
#' After preparing a request, call `req_perform_stream()` to perform the request
65
#' and handle the result with a streaming callback. This is useful for
76
#' streaming HTTP APIs where potentially the stream never ends.
8-
#'
9-
#' The `callback` will only be called if the result is successful. If you need
7+
#'
8+
#' The `callback` will only be called if the result is successful. If you need
109
#' to stream an error response, you can use [req_error()] to suppress error
1110
#' handling so that the body is streamed to you.
1211
#'
@@ -73,10 +72,10 @@ req_perform_stream <- function(req,
7372
continue <- TRUE
7473
incomplete <- TRUE
7574
buf <- raw()
76-
77-
while(continue && isIncomplete(stream) && Sys.time() < stop_time) {
75+
76+
while (continue && isIncomplete(stream) && Sys.time() < stop_time) {
7877
buf <- c(buf, readBin(stream, raw(), buffer_kb * 1024))
79-
78+
8079
if (length(buf) > 0) {
8180
cut <- cut_points(buf)
8281
n <- length(cut)

R/req-perform.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#' `options(httr2_progress = FALSE)`.
3131
#'
3232
#' @param req A [request].
33-
#' @param path Optionally, path to save body of the response. This is useful
33+
#' @param path Optionally, path to save body of the response. This is useful
3434
#' for large responses since it avoids storing the response in memory.
3535
#' @param mock A mocking function. If supplied, this function is called
3636
#' with the request. It should return either `NULL` (if it doesn't want to
@@ -105,7 +105,7 @@ req_perform <- function(
105105
throttle_delay(req)
106106

107107
delay <- 0
108-
while(tries < max_tries && Sys.time() < deadline) {
108+
while (tries < max_tries && Sys.time() < deadline) {
109109
sys_sleep(delay, "for retry backoff")
110110
n <- n + 1
111111

R/req-retries.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
#'
5757
#' # use a constant 10s delay after every failure
5858
#' request("http://example.com") |>
59-
#' req_retry(backoff = ~ 10)
59+
#' req_retry(backoff = ~10)
6060
#'
6161
#' # When rate-limited, GitHub's API returns a 403 with
6262
#' # `X-RateLimit-Remaining: 0` and an Unix time stored in the

R/resp-url.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,3 @@ resp_url_queries <- function(resp) {
4747

4848
url_parse(resp$url)$query
4949
}
50-

R/resp.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ new_response <- function(method,
102102

103103

104104
#' @export
105-
print.httr2_response <- function(x,...) {
105+
print.httr2_response <- function(x, ...) {
106106
cli::cli_text("{.cls {class(x)}}")
107107
cli::cli_text("{.strong {x$method}} {x$url}")
108108
cli::cli_text("{.field Status}: {x$status_code} {resp_status_desc(x)}")

R/url.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,11 @@ format_query_param <- function(x,
190190
unclass(x)
191191
} else {
192192
x <- format(x, scientific = FALSE, trim = TRUE, justify = "none")
193-
curl::curl_escape(x)
193+
curl::curl_escape(x)
194194
}
195195
}
196196
check_query_param <- function(x, name, multi = FALSE, error_call = caller_env()) {
197-
if (inherits(x, "AsIs") ) {
197+
if (inherits(x, "AsIs")) {
198198
if (multi) {
199199
ok <- is.character(x)
200200
expected <- "a character vector"

0 commit comments

Comments
 (0)