deps: bump async_std

This commit is contained in:
Kat Marchán 2019-10-18 22:24:42 -04:00
parent 086cbfe379
commit fde3521cce
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
4 changed files with 15 additions and 16 deletions

12
Cargo.lock generated
View File

@ -28,7 +28,7 @@ dependencies = [
[[package]] [[package]]
name = "async-std" name = "async-std"
version = "0.99.9" version = "0.99.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"async-macros 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "async-macros 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -39,7 +39,7 @@ dependencies = [
"crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"futures-core-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", "futures-core-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)",
"futures-io-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", "futures-io-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)",
"futures-timer 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures-timer 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"kv-log-macro 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "kv-log-macro 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -173,7 +173,7 @@ name = "cacache"
version = "2.0.1" version = "2.0.1"
dependencies = [ dependencies = [
"async-attributes 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "async-attributes 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"async-std 0.99.9 (registry+https://github.com/rust-lang/crates.io-index)", "async-std 0.99.10 (registry+https://github.com/rust-lang/crates.io-index)",
"chownr 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "chownr 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -444,7 +444,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "futures-timer" name = "futures-timer"
version = "0.4.0" version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"futures-core-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", "futures-core-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1085,7 +1085,7 @@ dependencies = [
"checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" "checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9"
"checksum async-attributes 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5266d863e013ece9c8793b69fe6d3a70679f7adea32c92d0aa5eb6e2a55d4d06" "checksum async-attributes 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5266d863e013ece9c8793b69fe6d3a70679f7adea32c92d0aa5eb6e2a55d4d06"
"checksum async-macros 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e421d59b24c1feea2496e409b3e0a8de23e5fc130a2ddc0b012e551f3b272bba" "checksum async-macros 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e421d59b24c1feea2496e409b3e0a8de23e5fc130a2ddc0b012e551f3b272bba"
"checksum async-std 0.99.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e274b0689dffa49d9c128a7bd1a86707b6bc8ea319af0899caae654e221656f4" "checksum async-std 0.99.10 (registry+https://github.com/rust-lang/crates.io-index)" = "78e8ea9961931e674433891032bb92e7d5f43ab59f9c0ff77da140eb76de39de"
"checksum async-task 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de6bd58f7b9cc49032559422595c81cbfcf04db2f2133592f70af19e258a1ced" "checksum async-task 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de6bd58f7b9cc49032559422595c81cbfcf04db2f2133592f70af19e258a1ced"
"checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90"
"checksum autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875" "checksum autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875"
@ -1129,7 +1129,7 @@ dependencies = [
"checksum futures-io-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "f4914ae450db1921a56c91bde97a27846287d062087d4a652efc09bb3a01ebda" "checksum futures-io-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "f4914ae450db1921a56c91bde97a27846287d062087d4a652efc09bb3a01ebda"
"checksum futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "3b1dce2a0267ada5c6ff75a8ba864b4e679a9e2aa44262af7a3b5516d530d76e" "checksum futures-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "3b1dce2a0267ada5c6ff75a8ba864b4e679a9e2aa44262af7a3b5516d530d76e"
"checksum futures-sink-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "86f148ef6b69f75bb610d4f9a2336d4fc88c4b5b67129d1a340dd0fd362efeec" "checksum futures-sink-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "86f148ef6b69f75bb610d4f9a2336d4fc88c4b5b67129d1a340dd0fd362efeec"
"checksum futures-timer 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "878f1d2fc31355fa02ed2372e741b0c17e58373341e6a122569b4623a14a7d33" "checksum futures-timer 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2879f3aa8fd2f60d17ede13349e11d0c132d0daa1b44e061f133f8928ddfaeea"
"checksum futures-util-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "5ce968633c17e5f97936bd2797b6e38fb56cf16a7422319f7ec2e30d3c470e8d" "checksum futures-util-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "5ce968633c17e5f97936bd2797b6e38fb56cf16a7422319f7ec2e30d3c470e8d"
"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" "checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec"
"checksum getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "473a1265acc8ff1e808cd0a1af8cee3c2ee5200916058a2ca113c29f2d903571" "checksum getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "473a1265acc8ff1e808cd0a1af8cee3c2ee5200916058a2ca113c29f2d903571"

View File

@ -32,7 +32,7 @@ walkdir = "2.2.7"
either = "1.5.2" either = "1.5.2"
mkdirp = "1.0.0" mkdirp = "1.0.0"
futures-preview = "0.3.0-alpha.18" futures-preview = "0.3.0-alpha.18"
async-std = { version = "0.99.9", features = ["unstable"]} async-std = { version = "0.99.10", features = ["unstable"]}
[target.'cfg(unix)'.dependencies] [target.'cfg(unix)'.dependencies]
chownr = "2.0.0" chownr = "2.0.0"

View File

@ -6,7 +6,7 @@ use std::sync::Mutex;
use async_std::fs as afs; use async_std::fs as afs;
use async_std::future::Future; use async_std::future::Future;
use async_std::task::{blocking, Context, JoinHandle, Poll}; use async_std::task::{self, Context, JoinHandle, Poll};
use futures::io::AsyncWrite; use futures::io::AsyncWrite;
use futures::prelude::*; use futures::prelude::*;
use ssri::{Algorithm, Integrity, IntegrityOpts}; use ssri::{Algorithm, Integrity, IntegrityOpts};
@ -91,7 +91,7 @@ impl AsyncWriter {
Ok(AsyncWriter(Mutex::new(State::Idle(Some(Inner { Ok(AsyncWriter(Mutex::new(State::Idle(Some(Inner {
cache: cache_path, cache: cache_path,
builder: IntegrityOpts::new().algorithm(algo), builder: IntegrityOpts::new().algorithm(algo),
tmpfile: blocking(async move { NamedTempFile::new_in(tmp_path) }).await?, tmpfile: task::spawn_blocking(|| NamedTempFile::new_in(tmp_path) ).await?,
buf: vec![], buf: vec![],
last_op: None, last_op: None,
}))))) })))))
@ -115,7 +115,7 @@ impl AsyncWriter {
let cpath = path::content_path(&inner.cache, &sri); let cpath = path::content_path(&inner.cache, &sri);
// Start the operation asynchronously. // Start the operation asynchronously.
*state = State::Busy(blocking(async move { *state = State::Busy(task::spawn(async move {
let res = afs::DirBuilder::new() let res = afs::DirBuilder::new()
.recursive(true) .recursive(true)
// Safe unwrap. cpath always has multiple segments // Safe unwrap. cpath always has multiple segments
@ -186,7 +186,7 @@ impl AsyncWrite for AsyncWriter {
inner.buf[..buf.len()].copy_from_slice(buf); inner.buf[..buf.len()].copy_from_slice(buf);
// Start the operation asynchronously. // Start the operation asynchronously.
*state = State::Busy(blocking(async move { *state = State::Busy(task::spawn_blocking(|| {
inner.builder.input(&inner.buf); inner.builder.input(&inner.buf);
let res = inner.tmpfile.write(&inner.buf); let res = inner.tmpfile.write(&inner.buf);
inner.last_op = Some(Operation::Write(res)); inner.last_op = Some(Operation::Write(res));
@ -220,7 +220,7 @@ impl AsyncWrite for AsyncWriter {
let mut inner = opt.take().unwrap(); let mut inner = opt.take().unwrap();
// Start the operation asynchronously. // Start the operation asynchronously.
*state = State::Busy(blocking(async move { *state = State::Busy(task::spawn_blocking(|| {
let res = inner.tmpfile.flush(); let res = inner.tmpfile.flush();
inner.last_op = Some(Operation::Flush(res)); inner.last_op = Some(Operation::Flush(res));
State::Idle(Some(inner)) State::Idle(Some(inner))
@ -247,7 +247,7 @@ impl AsyncWrite for AsyncWriter {
}; };
// Start the operation asynchronously. // Start the operation asynchronously.
*state = State::Busy(blocking(async move { *state = State::Busy(task::spawn_blocking(|| {
drop(inner); drop(inner);
State::Idle(None) State::Idle(None)
})); }));

View File

@ -5,8 +5,7 @@ use std::io::{ErrorKind, Write};
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::time::{SystemTime, UNIX_EPOCH}; use std::time::{SystemTime, UNIX_EPOCH};
use async_std::fs as afs; use async_std::{fs as afs, task};
use async_std::task::blocking;
#[cfg(unix)] #[cfg(unix)]
use chownr; use chownr;
use digest::Digest; use digest::Digest;
@ -104,7 +103,7 @@ pub async fn insert_async<'a>(
let tmpbucket = bucket.clone(); let tmpbucket = bucket.clone();
#[cfg(unix)] #[cfg(unix)]
let PutOpts { uid, gid, .. } = opts; let PutOpts { uid, gid, .. } = opts;
blocking(async move { task::spawn_blocking(move || {
let parent = tmpbucket.parent().unwrap(); let parent = tmpbucket.parent().unwrap();
#[cfg(unix)] #[cfg(unix)]
{ {