ramosbugs / openidconnect-rs

OpenID Connect Library for Rust
MIT License
426 stars 103 forks source link

Examples: reqwest::blocking is private? #157

Closed richchurcher closed 7 months ago

richchurcher commented 7 months ago

OK, I'm stuck. Have tried a variety of permutations and getting nowhere! I seem not to be able to refer to openidconnect::reqwest::blocking::ClientBuilder as suggested in this example, as module blocking is private. Am I misunderstanding something fundamental here?

Reproduction:

use openidconnect::reqwest;

fn main() {
    let _ = reqwest::blocking::ClientBuilder::new();
}

with dependencies:

[package]
name = "oidc_test"
version = "0.1.0"
edition = "2021"

[dependencies]
openidconnect = "3.5.0"

Rust:

info: The currently active `rustc` version is `rustc 1.77.1 (7cf61ebde 2024-03-27)`

Output:

λ cargo build
   Compiling oidc_test v0.1.0 (/home/basie/w/eg/oidc_test)
error[E0433]: failed to resolve: could not find `ClientBuilder` in `blocking`
 --> src/main.rs:4:32
  |
4 |     let _ = reqwest::blocking::ClientBuilder::new();
  |                                ^^^^^^^^^^^^^ could not find `ClientBuilder` in `blocking`

error[E0603]: module `blocking` is private
  --> src/main.rs:4:22
   |
4  |     let _ = reqwest::blocking::ClientBuilder::new();
   |                      ^^^^^^^^ private module
   |
note: the module `blocking` is defined here
  --> /home/basie/.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/oauth2-4.4.2/src/reqwest.rs:41:1
   |
41 | mod blocking {
   | ^^^^^^^^^^^^
ramosbugs commented 7 months ago

The example on the main branch is for the upcoming 4.0 release. See the one in the 3.5.0 tag for an example that works with that version.

richchurcher commented 7 months ago

Ah. Thank you! I was wondering if it had been updated, but didn't think to go looking for the tagged version.