From d99ba9c5b3c5f73ad148679a866698c811eec495 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 10 Mar 2015 18:03:35 +0100 Subject: [PATCH] fix(mako): fix name clashes Scopes could be invalid, previosly, and the hub type could clash with other types provided as Schema. Also, we used reserved identifiers --- gen/youtube3/src/lib.rs | 18 +++++++++--------- src/mako/lib.rs.mako | 4 ++-- src/mako/lib/mbuild.mako | 4 ++-- src/mako/lib/rbuild.mako | 2 +- src/mako/lib/util.py | 24 +++++++++++++++++------- 5 files changed, 31 insertions(+), 21 deletions(-) diff --git a/gen/youtube3/src/lib.rs b/gen/youtube3/src/lib.rs index e35061f83a..bd5ca4579d 100644 --- a/gen/youtube3/src/lib.rs +++ b/gen/youtube3/src/lib.rs @@ -133,7 +133,7 @@ use std::marker::PhantomData; use std::borrow::BorrowMut; use std::cell::RefCell; use std::default::Default; -use std::io::{Read, Seek}; +use std::io; use std::fs; use std::collections::BTreeMap; @@ -5264,7 +5264,7 @@ impl<'a, C, NC, A> ChannelBannerInsertMethodBuilder<'a, C, NC, A> where NC: hype /// Perform the operation you have build so far. - fn doit(mut self, stream: Option<(R, u64, mime::Mime)>, resumeable_stream: Option<(RS, u64, mime::Mime)>) -> Result where R: Read, RS: ReadSeek { + fn doit(mut self, stream: Option<(R, u64, mime::Mime)>, resumeable_stream: Option<(RS, u64, mime::Mime)>) -> Result where R: io::Read, RS: ReadSeek { let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); if self._on_behalf_of_content_owner.is_some() { params.push(("onBehalfOfContentOwner", self._on_behalf_of_content_owner.unwrap().to_string())); @@ -5304,7 +5304,7 @@ impl<'a, C, NC, A> ChannelBannerInsertMethodBuilder<'a, C, NC, A> where NC: hype /// * *multipart*: yes /// * *valid mime types*: 'application/octet-stream', 'image/jpeg' and 'image/png' pub fn upload(mut self, stream: R, size: u64, mime_type: mime::Mime) -> Result - where R: Read { + where R: io::Read { self.doit(Some((stream, size, mime_type)), None::<(fs::File, u64, mime::Mime)>, ) } /// Upload media in a resumeable fashion. @@ -7271,7 +7271,7 @@ impl<'a, C, NC, A> ThumbnailSetMethodBuilder<'a, C, NC, A> where NC: hyper::net: /// Perform the operation you have build so far. - fn doit(mut self, stream: Option<(R, u64, mime::Mime)>, resumeable_stream: Option<(RS, u64, mime::Mime)>) -> Result where R: Read, RS: ReadSeek { + fn doit(mut self, stream: Option<(R, u64, mime::Mime)>, resumeable_stream: Option<(RS, u64, mime::Mime)>) -> Result where R: io::Read, RS: ReadSeek { let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("videoId", self._video_id.to_string())); if self._on_behalf_of_content_owner.is_some() { @@ -7312,7 +7312,7 @@ impl<'a, C, NC, A> ThumbnailSetMethodBuilder<'a, C, NC, A> where NC: hyper::net: /// * *multipart*: yes /// * *valid mime types*: 'application/octet-stream', 'image/jpeg' and 'image/png' pub fn upload(mut self, stream: R, size: u64, mime_type: mime::Mime) -> Result - where R: Read { + where R: io::Read { self.doit(Some((stream, size, mime_type)), None::<(fs::File, u64, mime::Mime)>, ) } /// Upload media in a resumeable fashion. @@ -8540,7 +8540,7 @@ impl<'a, C, NC, A> VideoInsertMethodBuilder<'a, C, NC, A> where NC: hyper::net:: /// Perform the operation you have build so far. - fn doit(mut self, stream: Option<(R, u64, mime::Mime)>, resumeable_stream: Option<(RS, u64, mime::Mime)>) -> Result