Skip to content

Commit

Permalink
Merged in branch 01-hotfix
Browse files Browse the repository at this point in the history
commit 50a2682
Author: Rogerio Oliveira <[email protected]>
Date:   Tue Apr 11 00:24:02 2023 +0200

    removed some pub modifiers from internal functions;
    fixed the warn on "impl Reply" [rust-lang/rust#107729];

Changes to be committed:
	modified:   mock-server/src/lib.rs
	modified:   src/lib.rs
	modified:   src/routes/authentication.rs
  • Loading branch information
roger-oliver committed Apr 10, 2023
1 parent 512c14b commit 27b4c22
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mock-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl MockServer {
}
}

fn build_routes(&self) -> impl Filter<Extract = impl Reply> + Clone {
fn build_routes(&self) -> impl Filter<Extract = (impl Reply,)> + Clone {
warp::post()
.and(warp::path("bad_words"))
.and(warp::query())
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub struct OneshotHandler {
pub sender: Sender<i32>,
}

async fn build_routes(store: store::Store) -> impl Filter<Extract = impl Reply> + Clone {
async fn build_routes(store: store::Store) -> impl Filter<Extract = (impl Reply,)> + Clone {
let store_filter = warp::any().map(move || store.clone());

let cors = warp::cors()
Expand Down
4 changes: 2 additions & 2 deletions src/routes/authentication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub async fn register(store: Store, account: Account) -> Result<impl warp::Reply
}
}

pub fn hash_password(password: &[u8]) -> String {
fn hash_password(password: &[u8]) -> String {
let salt = rand::thread_rng().gen::<[u8; 32]>();
let config = Config::default();
argon2::hash_encoded(password, &salt, &config).unwrap()
Expand Down Expand Up @@ -66,7 +66,7 @@ fn issue_token(account_id: AccountId) -> String {
.expect("Failed to construct paseto token w/ builder!")
}

pub fn verify_token(token: String) -> Result<Session, Error> {
fn verify_token(token: String) -> Result<Session, Error> {
let key = env::var("PASETO_KEY").unwrap();
let token = paseto::tokens::validate_local_token(
&token,
Expand Down

0 comments on commit 27b4c22

Please sign in to comment.