~vpzom/hancock

120cbe9baf32f126dfad980dd4f3317cd937178e — Colin Reeder 1 year, 5 months ago 6ecad6d
Rename Error to SignError
1 files changed, 3 insertions(+), 3 deletions(-)

M src/lib.rs
M src/lib.rs => src/lib.rs +3 -3
@@ 1,5 1,5 @@
#[derive(Debug, thiserror::Error)]
pub enum Error<T: std::fmt::Debug> {
pub enum SignError<T: std::fmt::Debug> {
    #[error("IO error occurred")]
    IO(#[from] std::io::Error),
    #[error("Formatting error occurred")]


@@ 15,7 15,7 @@ pub fn create_signature<E: std::fmt::Debug>(
    lifetime_secs: u64,
    headers: &mut http::header::HeaderMap,
    signer: impl FnOnce(Vec<u8>) -> Result<Vec<u8>, E>,
) -> Result<http::header::HeaderValue, Error<E>> {
) -> Result<http::header::HeaderValue, SignError<E>> {
    use std::io::Write;

    let created = std::time::SystemTime::now()


@@ 50,7 50,7 @@ pub fn create_signature<E: std::fmt::Debug>(
        }
    }

    let signature = signer(body).map_err(Error::User)?;
    let signature = signer(body).map_err(SignError::User)?;

    {
        use std::fmt::Write;