diff --git a/ipc/codegen/build.rs b/ipc/codegen/build.rs index db9f5ac7e..82f990188 100644 --- a/ipc/codegen/build.rs +++ b/ipc/codegen/build.rs @@ -17,29 +17,29 @@ #[cfg(feature = "with-syntex")] mod inner { - extern crate syntex; - extern crate quasi_codegen; + extern crate syntex; + extern crate quasi_codegen; - use std::env; - use std::path::Path; + use std::env; + use std::path::Path; - pub fn main() { - let out_dir = env::var_os("OUT_DIR").unwrap(); - let mut registry = syntex::Registry::new(); - quasi_codegen::register(&mut registry); + pub fn main() { + let out_dir = env::var_os("OUT_DIR").unwrap(); + let mut registry = syntex::Registry::new(); + quasi_codegen::register(&mut registry); - let src = Path::new("src/lib.rs.in"); - let dst = Path::new(&out_dir).join("lib.rs"); + let src = Path::new("src/lib.rs.in"); + let dst = Path::new(&out_dir).join("lib.rs"); - registry.expand("", &src, &dst).unwrap(); - } + registry.expand("", &src, &dst).unwrap(); + } } #[cfg(not(feature = "with-syntex"))] mod inner { - pub fn main() {} + pub fn main() {} } fn main() { - inner::main(); + inner::main(); } diff --git a/ipc/codegen/src/codegen.rs b/ipc/codegen/src/codegen.rs index 922fefb7b..56e0ae01a 100644 --- a/ipc/codegen/src/codegen.rs +++ b/ipc/codegen/src/codegen.rs @@ -42,22 +42,22 @@ pub fn expand_ipc_implementation( annotatable: &Annotatable, push: &mut FnMut(Annotatable) ) { - let item = match *annotatable { - Annotatable::Item(ref item) => item, - _ => { - cx.span_err(meta_item.span, "`#[derive(Ipc)]` may only be applied to struct implementations"); - return; - } - }; + let item = match *annotatable { + Annotatable::Item(ref item) => item, + _ => { + cx.span_err(meta_item.span, "`#[derive(Ipc)]` may only be applied to struct implementations"); + return; + } + }; - let builder = aster::AstBuilder::new().span(span); + let builder = aster::AstBuilder::new().span(span); - let impl_item = match implement_interface(cx, &builder, &item, push) { - Ok(item) => item, - Err(Error) => { return; } - }; + let impl_item = match implement_interface(cx, &builder, &item, push) { + Ok(item) => item, + Err(Error) => { return; } + }; - push(Annotatable::Item(impl_item)) + push(Annotatable::Item(impl_item)) } fn field_name(builder: &aster::AstBuilder, arg: &Arg) -> ast::Ident { diff --git a/ipc/codegen/src/lib.rs b/ipc/codegen/src/lib.rs index 8129842ba..44ac093d9 100644 --- a/ipc/codegen/src/lib.rs +++ b/ipc/codegen/src/lib.rs @@ -52,16 +52,16 @@ include!("lib.rs.in"); #[cfg(feature = "with-syntex")] pub fn register(reg: &mut syntex::Registry) { - reg.add_attr("feature(custom_derive)"); - reg.add_attr("feature(custom_attribute)"); + reg.add_attr("feature(custom_derive)"); + reg.add_attr("feature(custom_attribute)"); - reg.add_decorator("derive_Ipc", codegen::expand_ipc_implementation); + reg.add_decorator("derive_Ipc", codegen::expand_ipc_implementation); } #[cfg(not(feature = "with-syntex"))] pub fn register(reg: &mut rustc_plugin::Registry) { - reg.register_syntax_extension( - syntax::parse::token::intern("derive_Ipc"), - syntax::ext::base::MultiDecorator( - Box::new(ser::expand_derive_serialize))); + reg.register_syntax_extension( + syntax::parse::token::intern("derive_Ipc"), + syntax::ext::base::MultiDecorator( + Box::new(ser::expand_derive_serialize))); }