Skip to content

Commit

Permalink
Merge pull request #128 from softprops/main-result
Browse files Browse the repository at this point in the history
replace quick_main macro with vanilla mains
  • Loading branch information
softprops committed May 12, 2018
2 parents 904ef91 + dd77593 commit aacd4c9
Show file tree
Hide file tree
Showing 19 changed files with 28 additions and 104 deletions.
6 changes: 1 addition & 5 deletions examples/assignees.rs
@@ -1,6 +1,4 @@
extern crate env_logger;
#[macro_use(quick_main)]
extern crate error_chain;
extern crate futures;
extern crate hubcaps;
extern crate tokio_core;
Expand All @@ -11,9 +9,7 @@ use tokio_core::reactor::Core;

use hubcaps::{Credentials, Github, Result};

quick_main!(run);

fn run() -> Result<()> {
fn main() -> Result<()> {
drop(env_logger::init());
match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
Expand Down
8 changes: 2 additions & 6 deletions examples/branches.rs
@@ -1,6 +1,4 @@
extern crate env_logger;
#[macro_use(quick_main)]
extern crate error_chain;
extern crate futures;
extern crate hubcaps;
extern crate tokio_core;
Expand All @@ -10,12 +8,10 @@ use std::env;
use futures::Stream;
use tokio_core::reactor::Core;

use hubcaps::{Credentials, Github, Result};
use hubcaps::branches::Protection;
use hubcaps::{Credentials, Github, Result};

quick_main!(run);

fn run() -> Result<()> {
fn main() -> Result<()> {
drop(env_logger::init());
match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
Expand Down
10 changes: 3 additions & 7 deletions examples/comments.rs
@@ -1,6 +1,4 @@
extern crate env_logger;
#[macro_use(quick_main)]
extern crate error_chain;
extern crate futures;
extern crate hubcaps;
extern crate tokio_core;
Expand All @@ -9,14 +7,12 @@ use std::env;

use tokio_core::reactor::Core;

use hubcaps::{Credentials, Github, Result};
use hubcaps::comments::CommentOptions;
use hubcaps::{Credentials, Github, Result};

const USER_AGENT: &'static str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"));

quick_main!(run);
const USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"));

fn run() -> Result<()> {
fn main() -> Result<()> {
drop(env_logger::init());
match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
Expand Down
6 changes: 1 addition & 5 deletions examples/deployments.rs
@@ -1,5 +1,3 @@
#[macro_use(quick_main)]
extern crate error_chain;
extern crate hubcaps;
extern crate tokio_core;

Expand All @@ -9,9 +7,7 @@ use tokio_core::reactor::Core;

use hubcaps::{Credentials, Github, Result};

quick_main!(run);

fn run() -> Result<()> {
fn main() -> Result<()> {
match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
let mut core = Core::new()?;
Expand Down
6 changes: 1 addition & 5 deletions examples/gists.rs
@@ -1,6 +1,4 @@
extern crate env_logger;
#[macro_use(quick_main)]
extern crate error_chain;
extern crate hubcaps;
extern crate tokio_core;

Expand All @@ -10,9 +8,7 @@ use tokio_core::reactor::Core;

use hubcaps::{Credentials, Github, Result};

quick_main!(run);

fn run() -> Result<()> {
fn main() -> Result<()> {
drop(env_logger::init());
match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
Expand Down
8 changes: 2 additions & 6 deletions examples/gists_create.rs
@@ -1,6 +1,4 @@
extern crate env_logger;
#[macro_use(quick_main)]
extern crate error_chain;
extern crate hubcaps;
extern crate tokio_core;

Expand All @@ -9,12 +7,10 @@ use std::env;

use tokio_core::reactor::Core;

use hubcaps::{Credentials, Github, Result};
use hubcaps::gists::{Content, GistOptions};
use hubcaps::{Credentials, Github, Result};

quick_main!(run);

fn run() -> Result<()> {
fn main() -> Result<()> {
drop(env_logger::init());
match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
Expand Down
6 changes: 1 addition & 5 deletions examples/git.rs
@@ -1,6 +1,4 @@
extern crate env_logger;
#[macro_use(quick_main)]
extern crate error_chain;
extern crate hubcaps;
extern crate tokio_core;

Expand All @@ -10,9 +8,7 @@ use tokio_core::reactor::Core;

use hubcaps::{Credentials, Github, Result};

quick_main!(run);

fn run() -> Result<()> {
fn main() -> Result<()> {
drop(env_logger::init());
match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
Expand Down
8 changes: 2 additions & 6 deletions examples/hooks.rs
@@ -1,19 +1,15 @@
extern crate env_logger;
#[macro_use(quick_main)]
extern crate error_chain;
extern crate hubcaps;
extern crate tokio_core;

use std::env;

use tokio_core::reactor::Core;

use hubcaps::{Credentials, Github, Result};
use hubcaps::hooks::{HookCreateOptions, WebHookContentType};
use hubcaps::{Credentials, Github, Result};

quick_main!(run);

fn run() -> Result<()> {
fn main() -> Result<()> {
drop(env_logger::init());
match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
Expand Down
8 changes: 2 additions & 6 deletions examples/issues.rs
@@ -1,6 +1,4 @@
extern crate env_logger;
#[macro_use(quick_main)]
extern crate error_chain;
extern crate futures;
extern crate hubcaps;
extern crate tokio_core;
Expand All @@ -10,12 +8,10 @@ use std::env;
use futures::Stream;
use tokio_core::reactor::Core;

use hubcaps::{Credentials, Github, Result};
use hubcaps::issues::{IssueListOptions, State};
use hubcaps::{Credentials, Github, Result};

quick_main!(run);

fn run() -> Result<()> {
fn main() -> Result<()> {
drop(env_logger::init());
match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
Expand Down
6 changes: 1 addition & 5 deletions examples/labels.rs
@@ -1,6 +1,4 @@
extern crate env_logger;
#[macro_use(quick_main)]
extern crate error_chain;
extern crate futures;
extern crate hubcaps;
extern crate tokio_core;
Expand All @@ -12,9 +10,7 @@ use tokio_core::reactor::Core;

use hubcaps::{Credentials, Github, Result};

quick_main!(run);

fn run() -> Result<()> {
fn main() -> Result<()> {
drop(env_logger::init());
match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
Expand Down
8 changes: 2 additions & 6 deletions examples/orgs.rs
@@ -1,19 +1,15 @@
extern crate env_logger;
#[macro_use(quick_main)]
extern crate error_chain;
extern crate hubcaps;
extern crate tokio_core;

use std::env;

use tokio_core::reactor::Core;

use hubcaps::{Credentials, Github, Result};
use hubcaps::repositories::{OrgRepoType, OrganizationRepoListOptions};
use hubcaps::{Credentials, Github, Result};

quick_main!(run);

fn run() -> Result<()> {
fn main() -> Result<()> {
drop(env_logger::init());
match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
Expand Down
6 changes: 1 addition & 5 deletions examples/pulls.rs
@@ -1,6 +1,4 @@
extern crate env_logger;
#[macro_use(quick_main)]
extern crate error_chain;
extern crate futures;
extern crate hubcaps;
extern crate tokio_core;
Expand All @@ -12,9 +10,7 @@ use tokio_core::reactor::Core;

use hubcaps::{Credentials, Github, Result};

quick_main!(run);

fn run() -> Result<()> {
fn main() -> Result<()> {
drop(env_logger::init());
match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
Expand Down
6 changes: 1 addition & 5 deletions examples/redir.rs
@@ -1,6 +1,4 @@
extern crate env_logger;
#[macro_use(quick_main)]
extern crate error_chain;
extern crate futures;
extern crate hubcaps;
extern crate tokio_core;
Expand All @@ -11,9 +9,7 @@ use tokio_core::reactor::Core;

use hubcaps::{Credentials, Github, Result};

quick_main!(run);

fn run() -> Result<()> {
fn main() -> Result<()> {
drop(env_logger::init());
match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
Expand Down
6 changes: 1 addition & 5 deletions examples/repos.rs
@@ -1,6 +1,4 @@
extern crate env_logger;
#[macro_use(quick_main)]
extern crate error_chain;
extern crate futures;
extern crate hubcaps;
extern crate tokio_core;
Expand All @@ -12,9 +10,7 @@ use tokio_core::reactor::Core;

use hubcaps::{Credentials, Github, Result};

quick_main!(run);

fn run() -> Result<()> {
fn main() -> Result<()> {
drop(env_logger::init());
match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
Expand Down
8 changes: 2 additions & 6 deletions examples/search_issues.rs
@@ -1,6 +1,4 @@
extern crate env_logger;
#[macro_use(quick_main)]
extern crate error_chain;
extern crate futures;
extern crate hubcaps;
extern crate tokio_core;
Expand All @@ -10,12 +8,10 @@ use std::env;
use futures::Stream;
use tokio_core::reactor::Core;

use hubcaps::{Credentials, Github, Result};
use hubcaps::search::SearchIssuesOptions;
use hubcaps::{Credentials, Github, Result};

quick_main!(run);

fn run() -> Result<()> {
fn main() -> Result<()> {
drop(env_logger::init());
match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
Expand Down
8 changes: 2 additions & 6 deletions examples/search_repos.rs
@@ -1,6 +1,4 @@
extern crate env_logger;
#[macro_use(quick_main)]
extern crate error_chain;
extern crate futures;
extern crate hubcaps;
extern crate tokio_core;
Expand All @@ -10,12 +8,10 @@ use std::env;
use futures::Stream;
use tokio_core::reactor::Core;

use hubcaps::{Credentials, Github, Result};
use hubcaps::search::SearchReposOptions;
use hubcaps::{Credentials, Github, Result};

quick_main!(run);

fn run() -> Result<()> {
fn main() -> Result<()> {
drop(env_logger::init());
match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
Expand Down
6 changes: 1 addition & 5 deletions examples/stars.rs
@@ -1,6 +1,4 @@
extern crate env_logger;
#[macro_use(quick_main)]
extern crate error_chain;
extern crate futures;
extern crate hubcaps;
extern crate tokio_core;
Expand All @@ -12,9 +10,7 @@ use tokio_core::reactor::Core;

use hubcaps::{Credentials, Github, Result};

quick_main!(run);

fn run() -> Result<()> {
fn main() -> Result<()> {
drop(env_logger::init());
match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
Expand Down
6 changes: 1 addition & 5 deletions examples/teams.rs
@@ -1,6 +1,4 @@
extern crate env_logger;
#[macro_use(quick_main)]
extern crate error_chain;
extern crate futures;
extern crate hubcaps;
extern crate tokio_core;
Expand All @@ -12,9 +10,7 @@ use tokio_core::reactor::Core;

use hubcaps::{Credentials, Github, Result};

quick_main!(run);

fn run() -> Result<()> {
fn main() -> Result<()> {
drop(env_logger::init());
match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
Expand Down
6 changes: 1 addition & 5 deletions examples/users.rs
@@ -1,6 +1,4 @@
extern crate env_logger;
#[macro_use(quick_main)]
extern crate error_chain;
extern crate hubcaps;
extern crate tokio_core;

Expand All @@ -10,9 +8,7 @@ use tokio_core::reactor::Core;

use hubcaps::{Credentials, Github, Result};

quick_main!(run);

fn run() -> Result<()> {
fn main() -> Result<()> {
drop(env_logger::init());
match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
Expand Down

0 comments on commit aacd4c9

Please sign in to comment.