diff --git a/examples/low-level/pebble-schema.rs b/examples/low-level/pebble-schema.rs index 0ea234b..de1e6d4 100644 --- a/examples/low-level/pebble-schema.rs +++ b/examples/low-level/pebble-schema.rs @@ -80,7 +80,7 @@ async fn main() -> Result<(), Box> { .build()?; tracing::info!("Loading private key from {PRIVATE_KEY_PATH:?}"); - let key = Arc::new(ecdsa::SigningKey::from(read_private_key(PRIVATE_KEY_PATH)?)); + let key = Arc::new((read_private_key(PRIVATE_KEY_PATH)?)); // Step 1: Get an account tracing::info!("Requesting account"); @@ -181,7 +181,7 @@ async fn main() -> Result<(), Box> { let challenge = client .post::<_, _, _, Challenge>( challenge.url(), - ChallengeReadyRequest::default(), + ChallengeReadyRequest, account_key.clone(), ) .await?; diff --git a/examples/low-level/show-request.rs b/examples/low-level/show-request.rs index 98fd013..cbdfcfb 100644 --- a/examples/low-level/show-request.rs +++ b/examples/low-level/show-request.rs @@ -70,7 +70,7 @@ async fn main() -> Result<(), Box> { .build()?; tracing::info!("Loading private key from {PRIVATE_KEY_PATH:?}"); - let key = Arc::new(ecdsa::SigningKey::from(read_private_key(PRIVATE_KEY_PATH)?)); + let key = Arc::new((read_private_key(PRIVATE_KEY_PATH)?)); // Step 1: Get an account tracing::info!("Requesting account"); diff --git a/src/pebble.rs b/src/pebble.rs index 95f2b8a..65dc645 100644 --- a/src/pebble.rs +++ b/src/pebble.rs @@ -217,7 +217,7 @@ impl Pebble { && output .stdout .iter() - .map(|&b| (b == '\n' as u8) as u32) + .map(|&b| (b == b'\n') as u32) .sum::() > 2 { diff --git a/src/protocol/client.rs b/src/protocol/client.rs index 8ae5b6a..4f0f2e1 100644 --- a/src/protocol/client.rs +++ b/src/protocol/client.rs @@ -104,7 +104,7 @@ impl ClientBuilder { /// /// ```no_run /// # use std::sync::Arc; -/// # use yacme::protocol::Client; +/// # use yacme::protocol::AcmeClient; /// # use yacme::protocol::Request; /// # use yacme::protocol::Response; /// # use signature::rand_core::OsRng; diff --git a/src/protocol/mod.rs b/src/protocol/mod.rs index 3fd96ab..6a5e8cd 100644 --- a/src/protocol/mod.rs +++ b/src/protocol/mod.rs @@ -3,7 +3,7 @@ //! Most ACME requests are authenticated as a JWT, signed by the //! account key. This module provides the implementation of that //! protocol, and the deserialization of the corresponding responses, -//! as well as providing a [`Client`] type which can be used to +//! as well as providing a [`AcmeClient`] type which can be used to //! track the correct Nonce through a series of requests. #![deny(unsafe_code)] #![deny(missing_docs)] diff --git a/src/protocol/request.rs b/src/protocol/request.rs index 4696f03..0075a59 100644 --- a/src/protocol/request.rs +++ b/src/protocol/request.rs @@ -231,7 +231,7 @@ impl From<(Arc, AccountKeyIdentifier)> for Key { /// ACME prescribes that all requests are POST JWS requests in the flattened /// JSON format. This structure contains all of the materials *except* the /// anti-replay [nonce][Nonce] which are required to create an appropriate HTTP -/// request. The [nonce][Nonce] is left out of this object that if the [`super::Client`] +/// request. The [nonce][Nonce] is left out of this object so that if the [`super::AcmeClient`] /// encounters a bad [nonce][Nonce], it can re-try the same request with a new [nonce][Nonce] /// value without having to re-build the request object. /// @@ -372,8 +372,8 @@ where /// Sign and finalize this request so that it can be sent over HTTP. /// /// The resulting [`SignedRequest`] can be converted to a [`reqwest::Request`] - /// for transmission. Normally, this method is not necessary - the [`crate::protocol::Client`] - /// provides [`crate::protocol::Client::execute`] for executing [`Request`] objects natively. + /// for transmission. Normally, this method is not necessary - the [`crate::protocol::AcmeClient`] + /// provides [`crate::protocol::AcmeClient::execute`] for executing [`Request`] objects natively. pub fn sign(&self, nonce: Nonce) -> Result { let signed_token = self.signed_token(nonce)?; let mut request = reqwest::Request::new(reqwest::Method::POST, self.url.clone().into()); diff --git a/src/protocol/response.rs b/src/protocol/response.rs index 1f7cec1..0b18de3 100644 --- a/src/protocol/response.rs +++ b/src/protocol/response.rs @@ -109,7 +109,7 @@ impl Response { /// Get the [`Nonce`] from this response. /// - /// Normally, this is unnecessay, as [`super::Client`] will automatically handle + /// Normally, this is unnecessay, as [`super::AcmeClient`] will automatically handle /// and track [`Nonce`] values. pub fn nonce(&self) -> Option { super::client::extract_nonce(&self.headers).ok() diff --git a/tests/examples.rs b/tests/examples.rs index f811a3c..cc9f01d 100644 --- a/tests/examples.rs +++ b/tests/examples.rs @@ -1,6 +1,6 @@ fn run_example(name: &str) -> std::process::Output { let output = std::process::Command::new("cargo") - .args(&["run", "--features=pebble", "--example", name]) + .args(["run", "--features=pebble", "--example", name]) .output() .unwrap(); diff --git a/tests/pebble.rs b/tests/pebble.rs index 88b7c1e..374df07 100644 --- a/tests/pebble.rs +++ b/tests/pebble.rs @@ -27,9 +27,7 @@ async fn http01() { } fn random_key() -> Arc> { - Arc::new(ecdsa::SigningKey::from( - ecdsa::SigningKey::::random(&mut OsRng), - )) + Arc::new(ecdsa::SigningKey::::random(&mut OsRng)) } #[tracing::instrument("http01")]