From b819d14abaf362f67f5fe092eb3de4cf0604f2e4 Mon Sep 17 00:00:00 2001 From: Douman Date: Fri, 13 Dec 2019 06:39:41 +0100 Subject: [PATCH] 0.16.0 Update to stable async await --- .travis.yml | 4 ++-- Cargo.toml | 12 ++++++------ README.md | 10 +++++----- appveyor.yml | 2 +- src/cli/cli.rs | 2 +- src/cli/main.rs | 4 ++-- src/lib/api/mod.rs | 8 ++++---- src/lib/lib.rs | 1 - 8 files changed, 21 insertions(+), 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2ad4230..a511176 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,11 +7,11 @@ env: matrix: include: - os: osx - rust: nightly + rust: stable env: TARGET=x86_64-apple-darwin cache: cargo - os: linux - rust: nightly + rust: stable env: TARGET=x86_64-unknown-linux-gnu cache: cargo diff --git a/Cargo.toml b/Cargo.toml index 034860d..5f15475 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fie" -version = "0.15.0" +version = "0.16.0" authors = ["Douman "] repository = "https://github.com/DoumanAsh/fie" description = "Small and cute social media utility." @@ -15,18 +15,18 @@ include = [ edition = "2018" [dependencies.yukikaze] -version = "1.0.0-alpha" +version = "1.0.0" features = ["encoding"] [dependencies.structopt] -version = "0.2" +version = "0.3" optional = true features = ["wrap_help", "suggestions"] [dependencies.tokio] -version = "0.2.0-alpha" +version = "0.2" default-features = false -features = ["rt-full"] +features = ["rt-core", "macros"] optional = true [dependencies] @@ -44,7 +44,7 @@ mime_guess = "2" toml = { version = "0.5", optional = true } dirs = { version = "2", optional = true } -futures-util-preview = { version = "0.3.0-alpha", features = ["nightly", "async-await", "join-macro"] } +futures-util = { version = "0.3" } [features] cli = ["structopt", "toml", "dirs", "tokio"] diff --git a/README.md b/README.md index 55eec7a..e39ccac 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Build status](https://ci.appveyor.com/api/projects/status/oc937oppd38x1y4y/branch/master?svg=true)](https://ci.appveyor.com/project/DoumanAsh/fie/branch/master) [![Build Status](https://travis-ci.org/DoumanAsh/fie.svg?branch=master)](https://travis-ci.org/DoumanAsh/fie) [![Crates.io](https://img.shields.io/crates/v/fie.svg)](https://crates.io/crates/fie) -[![Dependency status](https://deps.rs/crate/fie/0.15.0/status.svg)](https://deps.rs/crate/fie) +[![Dependency status](https://deps.rs/crate/fie/0.16.0/status.svg)](https://deps.rs/crate/fie) Small and cute social media CLI. @@ -13,10 +13,10 @@ Small and cute social media CLI. ### Download links -* Windows [32bit](https://github.com/DoumanAsh/fie/releases/download/0.15.0/fie-0.15.0-i686-pc-windows-msvc.zip) -* Windows [64bit](https://github.com/DoumanAsh/fie/releases/download/0.15.0/fie-0.15.0-x86_64-pc-windows-msvc.zip) -* Linux [64bit](https://github.com/DoumanAsh/fie/releases/download/0.15.0/fie-0.15.0-x86_64-unknown-linux-gnu.zip) -* OSX [64bit](https://github.com/DoumanAsh/fie/releases/download/0.15.0/fie-0.15.0-x86_64-apple-darwin.zip) +* Windows [32bit](https://github.com/DoumanAsh/fie/releases/download/0.16.0/fie-0.16.0-i686-pc-windows-msvc.zip) +* Windows [64bit](https://github.com/DoumanAsh/fie/releases/download/0.16.0/fie-0.16.0-x86_64-pc-windows-msvc.zip) +* Linux [64bit](https://github.com/DoumanAsh/fie/releases/download/0.16.0/fie-0.16.0-x86_64-unknown-linux-gnu.zip) +* OSX [64bit](https://github.com/DoumanAsh/fie/releases/download/0.16.0/fie-0.16.0-x86_64-apple-darwin.zip) ### Cargo diff --git a/appveyor.yml b/appveyor.yml index 52a0c2e..96e81ea 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,7 @@ environment: PROJECT_NAME: fie matrix: - TARGET: x86_64-pc-windows-msvc - CHANNEL: nightly + CHANNEL: stable # Install Rust and Cargo # (Based on from https://github.com/rust-lang/libc/blob/master/appveyor.yml) diff --git a/src/cli/cli.rs b/src/cli/cli.rs index 83933d2..3d40d14 100644 --- a/src/cli/cli.rs +++ b/src/cli/cli.rs @@ -5,7 +5,7 @@ use structopt::StructOpt; use fie::config::Platforms; #[derive(Debug, StructOpt)] -#[structopt(name = "fie", raw(setting = "structopt::clap::AppSettings::ArgRequiredElseHelp"), raw(setting = "structopt::clap::AppSettings::VersionlessSubcommands"))] +#[structopt(name = "fie", setting(structopt::clap::AppSettings::ArgRequiredElseHelp), setting(structopt::clap::AppSettings::VersionlessSubcommands))] pub struct Args { #[structopt(flatten)] pub flags: Flags, diff --git a/src/cli/main.rs b/src/cli/main.rs index 993f03d..f28a9f4 100644 --- a/src/cli/main.rs +++ b/src/cli/main.rs @@ -97,8 +97,8 @@ fn use_twitter_builtin_consumer(twitter: &mut fie::config::Twitter) { } #[inline(always)] -fn runtime() -> tokio::runtime::current_thread::Runtime { - tokio::runtime::current_thread::Runtime::new().unwrap() +fn runtime() -> tokio::runtime::Runtime { + tokio::runtime::Builder::new().basic_scheduler().build().expect("To create async runtime") } fn command_post(config: Config, post: cli::Post) -> io::Result<()> { diff --git a/src/lib/api/mod.rs b/src/lib/api/mod.rs index ef9d914..01d562a 100644 --- a/src/lib/api/mod.rs +++ b/src/lib/api/mod.rs @@ -255,7 +255,7 @@ impl API { let images = &images[..]; - let twitter = post_result(self.twitter.as_ref().map(async move |twitter| { + let twitter = post_result(self.twitter.as_ref().map(|twitter| async move { let mut uploads = vec![]; for image in images.iter() { let upload = matsu!(twitter.upload_image(&image.name, &image.mime, &image.mmap[..]))?; @@ -265,7 +265,7 @@ impl API { matsu!(twitter.post(&message, &uploads, &flags)) })); - let gab = post_result(self.gab.as_ref().map(async move |gab| { + let gab = post_result(self.gab.as_ref().map(|gab| async move { let mut uploads = vec![]; for image in images.iter() { let upload = matsu!(gab.upload_image(&image.name, &image.mime, &image.mmap[..]))?; @@ -275,7 +275,7 @@ impl API { matsu!(gab.post(&message, &uploads, &flags)) })); - let mastodon = post_result(self.mastodon.as_ref().map(async move |mastodon| { + let mastodon = post_result(self.mastodon.as_ref().map(|mastodon| async move { let mut uploads = vec![]; for image in images.iter() { let upload = matsu!(mastodon.upload_image(&image.name, &image.mime, &image.mmap[..]))?; @@ -285,7 +285,7 @@ impl API { matsu!(mastodon.post(&message, &uploads, &flags)) })); - let minds = post_result(self.minds.as_ref().map(async move |minds| { + let minds = post_result(self.minds.as_ref().map(|minds| async move { let image = unsafe { images.get_unchecked(0) }; let upload = matsu!(minds.upload_image(&image.name, &image.mime, &image.mmap[..]))?; diff --git a/src/lib/lib.rs b/src/lib/lib.rs index 87d6ea8..52776a3 100644 --- a/src/lib/lib.rs +++ b/src/lib/lib.rs @@ -2,7 +2,6 @@ #![warn(missing_docs)] #![cfg_attr(feature = "cargo-clippy", allow(clippy::style))] -#![feature(async_closure)] pub mod data; pub mod config;