Skip to content

drop dependency on async-std #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 22 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,32 @@ edition = "2018"
keywords = []
categories = []
authors = [
"Yoshua Wuyts <yoshuawuyts@gmail.com>"
"Yoshua Wuyts <yoshuawuyts@gmail.com>",
"Jacob Rothstein <hi@jbr.me>"
]

[features]

[dependencies]
async-trait = "0.1.24"
async-std = "1.6.0"
serde = { version = "1.0.114", features = ["rc", "derive"] }
async-trait = "0.1.50"
rand = "0.8.3"
base64 = "0.13.0"
sha2 = "0.9.1"
hmac = "0.10.1"
serde_json = "1.0.56"
kv-log-macro = "1.0.7"
bincode = "1.3.1"
chrono = { version = "0.4.13", default-features = false, features = ["clock", "serde", "std"] }
anyhow = "1.0.31"
blake3 = "0.3.5"
sha2 = "0.9.5"
hmac = "0.11.0"
serde_json = "1.0.64"
bincode = "1.3.3"
anyhow = "1.0.40"
blake3 = "0.3.8"
async-lock = "2.4.0"
log = "0.4.14"

[dependencies.serde]
version = "1.0.126"
features = ["rc", "derive"]

[dependencies.chrono]
version = "0.4.19"
default-features = false
features = ["clock", "serde", "std"]

[dev-dependencies]
async-std = { version = "1.6.2", features = ["attributes"] }
[dev-dependencies.async-std]
version = "1.9.0"
features = ["attributes"]
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,16 @@
</h3>
</div>

## Installation
```sh
$ cargo add async-session
```
## Available session stores

* [async-sqlx-session](https://crates.io/crates/async-sqlx-session) postgres & sqlite
* [async-redis-session](https://crates.io/crates/async-redis-session)
* [async-mongodb-session](https://crates.io/crates/async-mongodb-session)

## Framework implementations

* [`tide::sessions`](https://docs.rs/tide/latest/tide/sessions/index.html)
* [warp-sessions](https://docs.rs/warp-sessions/latest/warp_sessions/)

## Safety
This crate uses ``#![deny(unsafe_code)]`` to ensure everything is implemented in
Expand Down
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
// #![forbid(unsafe_code, future_incompatible)]
// #![deny(missing_debug_implementations, nonstandard_style)]
// #![warn(missing_docs, missing_doc_code_examples, unreachable_pub)]
#![forbid(unsafe_code, future_incompatible)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, what becomes future incompatible? that is kind of a problem, as 2021 edition is going to be here in only a few months.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code isn't future-incompatible, but the lint itself was blowing up on nightly. I don't remember the exact message but it sounded like it was no longer necessary (or allowed?)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, related to rust-lang/rust#81670 which I can't quite say I understand clearly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does #![deny(future_incompatible)] work fine on nightly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh! Yep, I'll switch it to deny

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved in 89cd086

#![forbid(unsafe_code)]
#![deny(
future_incompatible,
missing_debug_implementations,
nonstandard_style,
missing_docs,
Expand Down Expand Up @@ -64,7 +65,7 @@ pub use base64;
pub use blake3;
pub use chrono;
pub use hmac;
pub use kv_log_macro as log;
pub use log;
pub use serde;
pub use serde_json;
pub use sha2;
4 changes: 2 additions & 2 deletions src/memory_store.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{async_trait, log, Result, Session, SessionStore};
use async_std::sync::{Arc, RwLock};
use std::collections::HashMap;
use async_lock::RwLock;
use std::{collections::HashMap, sync::Arc};

/// # in-memory session store
/// Because there is no external
Expand Down