Skip to content

Instantly share code, notes, and snippets.

use std::collections::HashMap;
use std::fmt;
use std::path::Path;
use mio_httpc::{CallBuilder, Headers, Httpc, HttpcCfg, SimpleCall};
use mio::{Events, Poll};
use url::Url;
@AlecTaylor
AlecTaylor / main.rs
Created March 5, 2019 01:10
structopt
#[macro_use]
extern crate structopt;
use std::path::PathBuf;
use structopt::StructOpt;
// env!("CARGO_PKG_NAME")
#[derive(Debug, StructOpt)]
use std::collections::HashMap;
use std::fmt;
use std::path::Path;
use mio_httpc::{CallBuilder, Headers, Httpc, HttpcCfg, SimpleCall};
use mio::{Events, Poll};
use url::Url;
use std::collections::HashMap;
use std::fmt;
use std::path::Path;
use mio_httpc::{CallBuilder, Headers, Httpc, HttpcCfg, SimpleCall};
use mio::{Events, Poll};
use url::Url;
use std::collections::HashMap;
use std::fmt;
use std::path::Path;
use mio_httpc::{CallBuilder, Headers, Httpc, HttpcCfg, SimpleCall};
use mio::{Events, Poll};
use url::Url;
use std::collections::HashMap;
use std::fmt;
use std::path::Path;
use mio_httpc::{CallBuilder, Headers, Httpc, HttpcCfg, SimpleCall};
use mio::{Events, Poll};
use url::Url;
use std::collections::HashMap;
use std::fmt;
use std::path::Path;
use mio_httpc::{CallBuilder, Headers, Httpc, HttpcCfg, SimpleCall};
use mio::{Events, Poll};
use url::Url;
pub fn env_or<T>(key: &str, default_env: T) -> std::ffi::OsString
where
T: Into<std::ffi::OsString>,
{
match std::env::var_os(key) {
Some(val) => val,
None => default_env.into(),
}
}
use mio::{Events, Poll};
use mio_httpc::{CallBuilder, Httpc, HttpcCfg, SimpleCall, Headers, Response};
use url::Url;
use failure::Error;
#[derive(Clone)]
struct StatusHeadersText<'a> {
status: u16,
use mio::{Events, Poll};
use mio_httpc::{CallBuilder, Httpc, HttpcCfg, SimpleCall, Headers, Response};
use url::Url;
use failure::Error;
#[derive(Clone)]
struct StatusHeadersText<'a> {
status: u16,