Skip to content

Commit

Permalink
0.16.0 Update to stable async await
Browse files Browse the repository at this point in the history
  • Loading branch information
DoumanAsh committed Dec 13, 2019
1 parent 9cb0a7b commit b819d14
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fie"
version = "0.15.0"
version = "0.16.0"
authors = ["Douman <[email protected]>"]
repository = "https://github.com/DoumanAsh/fie"
description = "Small and cute social media utility."
Expand All @@ -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]
Expand All @@ -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"]
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/cli/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/cli/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<()> {
Expand Down
8 changes: 4 additions & 4 deletions src/lib/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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[..]))?;
Expand All @@ -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[..]))?;
Expand All @@ -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[..]))?;
Expand All @@ -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[..]))?;

Expand Down
1 change: 0 additions & 1 deletion src/lib/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#![warn(missing_docs)]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::style))]
#![feature(async_closure)]

pub mod data;
pub mod config;
Expand Down

0 comments on commit b819d14

Please sign in to comment.