fix(rustup): rustc (be9bd7c93 2015-04-05)

* using std::convert
* update to latest hyper (and other dependencies)

Related to #46
This commit is contained in:
Sebastian Thiel
2015-04-07 11:53:47 +02:00
parent 919ae4d8ae
commit 91861dcb71
354 changed files with 62261 additions and 24815 deletions

View File

@@ -67,8 +67,8 @@
//!
//! ```test_harness,no_run
//! extern crate hyper;
//! extern crate "yup-oauth2" as oauth2;
//! extern crate "google-cloudlatencytest2" as cloudlatencytest2;
//! extern crate yup_oauth2 as oauth2;
//! extern crate google_cloudlatencytest2 as cloudlatencytest2;
//! use cloudlatencytest2::Stats;
//! use cloudlatencytest2::{Result, Error};
//! # #[test] fn egal() {
@@ -167,20 +167,20 @@
//! [google-go-api]: https://github.com/google/google-api-go-client
//!
//!
#![feature(core,io,thread_sleep)]
#![feature(std_misc)]
// Unused attributes happen thanks to defined, but unused structures
// We don't warn about this, as depending on the API, some data structures or facilities are never used.
// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any
// unused imports in fully featured APIs. Same with unused_mut ... .
#![allow(unused_imports, unused_mut, dead_code)]
// Required for serde annotations
#![feature(custom_derive, custom_attribute, plugin)]
#![feature(custom_derive, custom_attribute, plugin, slice_patterns)]
#![plugin(serde_macros)]
#[macro_use]
extern crate hyper;
extern crate serde;
extern crate "yup-oauth2" as oauth2;
extern crate yup_oauth2 as oauth2;
extern crate mime;
extern crate url;
@@ -195,7 +195,7 @@ use std::marker::PhantomData;
use serde::json;
use std::io;
use std::fs;
use std::thread::sleep;
use std::thread::sleep_ms;
pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, Hub, ReadSeek, Part, ResponseResult, RequestValue, NestedType, Delegate, DefaultDelegate, MethodsBuilder, Resource, JsonServerError};
@@ -213,8 +213,8 @@ pub enum Scope {
MonitoringReadonly,
}
impl Str for Scope {
fn as_slice(&self) -> &str {
impl AsRef<str> for Scope {
fn as_ref(&self) -> &str {
match *self {
Scope::MonitoringReadonly => "https://www.googleapis.com/auth/monitoring.readonly",
}
@@ -241,8 +241,8 @@ impl Default for Scope {
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate "yup-oauth2" as oauth2;
/// extern crate "google-cloudlatencytest2" as cloudlatencytest2;
/// extern crate yup_oauth2 as oauth2;
/// extern crate google_cloudlatencytest2 as cloudlatencytest2;
/// use cloudlatencytest2::Stats;
/// use cloudlatencytest2::{Result, Error};
/// # #[test] fn egal() {
@@ -471,8 +471,8 @@ impl ResponseResult for StatsReply {}
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate "yup-oauth2" as oauth2;
/// extern crate "google-cloudlatencytest2" as cloudlatencytest2;
/// extern crate yup_oauth2 as oauth2;
/// extern crate google_cloudlatencytest2 as cloudlatencytest2;
///
/// # #[test] fn egal() {
/// use std::default::Default;
@@ -554,8 +554,8 @@ impl<'a, C, NC, A> StatscollectionMethods<'a, C, NC, A> {
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate "yup-oauth2" as oauth2;
/// # extern crate "google-cloudlatencytest2" as cloudlatencytest2;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_cloudlatencytest2 as cloudlatencytest2;
/// use cloudlatencytest2::AggregatedStats;
/// # #[test] fn egal() {
/// # use std::default::Default;
@@ -620,13 +620,13 @@ impl<'a, C, NC, A> StatscollectionUpdateaggregatedstatCall<'a, C, NC, A> where N
let mut url = "https://cloudlatencytest-pa.googleapis.com/v2/statscollection/updateaggregatedstats".to_string();
if self._scopes.len() == 0 {
self._scopes.insert(Scope::MonitoringReadonly.as_slice().to_string(), ());
self._scopes.insert(Scope::MonitoringReadonly.as_ref().to_string(), ());
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_ref()))));
}
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
@@ -649,7 +649,7 @@ impl<'a, C, NC, A> StatscollectionUpdateaggregatedstatCall<'a, C, NC, A> where N
request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
let mut req_result = {
let mut client = &mut *self.hub.client.borrow_mut();
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_slice())
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_ref())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone())
.header(ContentType(json_mime_type.clone()))
@@ -663,7 +663,7 @@ impl<'a, C, NC, A> StatscollectionUpdateaggregatedstatCall<'a, C, NC, A> where N
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -674,7 +674,7 @@ impl<'a, C, NC, A> StatscollectionUpdateaggregatedstatCall<'a, C, NC, A> where N
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -738,8 +738,8 @@ impl<'a, C, NC, A> StatscollectionUpdateaggregatedstatCall<'a, C, NC, A> where N
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> StatscollectionUpdateaggregatedstatCall<'a, C, NC, A>
where T: Str {
self._additional_params.insert(name.as_slice().to_string(), value.as_slice().to_string());
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
@@ -755,8 +755,8 @@ impl<'a, C, NC, A> StatscollectionUpdateaggregatedstatCall<'a, C, NC, A> where N
/// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
/// sufficient, a read-write scope will do as well.
pub fn add_scope<T>(mut self, scope: T) -> StatscollectionUpdateaggregatedstatCall<'a, C, NC, A>
where T: Str {
self._scopes.insert(scope.as_slice().to_string(), ());
where T: AsRef<str> {
self._scopes.insert(scope.as_ref().to_string(), ());
self
}
}
@@ -773,8 +773,8 @@ impl<'a, C, NC, A> StatscollectionUpdateaggregatedstatCall<'a, C, NC, A> where N
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate "yup-oauth2" as oauth2;
/// # extern crate "google-cloudlatencytest2" as cloudlatencytest2;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_cloudlatencytest2 as cloudlatencytest2;
/// use cloudlatencytest2::Stats;
/// # #[test] fn egal() {
/// # use std::default::Default;
@@ -839,13 +839,13 @@ impl<'a, C, NC, A> StatscollectionUpdatestatCall<'a, C, NC, A> where NC: hyper::
let mut url = "https://cloudlatencytest-pa.googleapis.com/v2/statscollection/updatestats".to_string();
if self._scopes.len() == 0 {
self._scopes.insert(Scope::MonitoringReadonly.as_slice().to_string(), ());
self._scopes.insert(Scope::MonitoringReadonly.as_ref().to_string(), ());
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_ref()))));
}
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
@@ -868,7 +868,7 @@ impl<'a, C, NC, A> StatscollectionUpdatestatCall<'a, C, NC, A> where NC: hyper::
request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
let mut req_result = {
let mut client = &mut *self.hub.client.borrow_mut();
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_slice())
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_ref())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone())
.header(ContentType(json_mime_type.clone()))
@@ -882,7 +882,7 @@ impl<'a, C, NC, A> StatscollectionUpdatestatCall<'a, C, NC, A> where NC: hyper::
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -893,7 +893,7 @@ impl<'a, C, NC, A> StatscollectionUpdatestatCall<'a, C, NC, A> where NC: hyper::
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -957,8 +957,8 @@ impl<'a, C, NC, A> StatscollectionUpdatestatCall<'a, C, NC, A> where NC: hyper::
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> StatscollectionUpdatestatCall<'a, C, NC, A>
where T: Str {
self._additional_params.insert(name.as_slice().to_string(), value.as_slice().to_string());
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
@@ -974,8 +974,8 @@ impl<'a, C, NC, A> StatscollectionUpdatestatCall<'a, C, NC, A> where NC: hyper::
/// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
/// sufficient, a read-write scope will do as well.
pub fn add_scope<T>(mut self, scope: T) -> StatscollectionUpdatestatCall<'a, C, NC, A>
where T: Str {
self._scopes.insert(scope.as_slice().to_string(), ());
where T: AsRef<str> {
self._scopes.insert(scope.as_ref().to_string(), ());
self
}
}