rustfmt

parent 7b546da4
Pipeline #14830 failed with stages
in 57 minutes and 37 seconds
......@@ -18,8 +18,8 @@ mod slots;
use self::class::ClassContext;
use self::interface::InterfaceContext;
use ident_ext::IdentExt;
use hir::Program;
use ident_ext::IdentExt;
pub fn codegen(program: &Program) -> TokenStream {
let class_tokens = program
......
......@@ -2,8 +2,8 @@ use syn::Ident;
use glib_utils::*;
use gen::WithSuffix;
use super::super::ident_ext::IdentExt;
use gen::WithSuffix;
/// Utilities to generate names useful for code generation of a GObject
///
......
......@@ -5,7 +5,7 @@ use ident_ext::IdentExt;
pub fn properties_enum<'ast>(properties: &[Property<'ast>]) -> TokenStream {
if properties.is_empty() {
return quote! {};
return quote!{};
}
let properties: Vec<TokenStream> = properties
......
......@@ -6,9 +6,9 @@ use syn::Path;
use glib_utils::*;
use hir::{FnArg, Signal, Ty};
use super::super::ident_ext::IdentExt;
use super::cstringliteral::CStringLiteral;
use super::names::Names;
use super::super::ident_ext::IdentExt;
pub fn signal_emit_methods<'ast>(
signals: impl Iterator<Item = &'ast Signal<'ast>>,
......
......@@ -236,7 +236,9 @@ impl<'ast> ToTokens for FnArgsWithGlibTypes<'ast> {
fn to_tokens(&self, tokens: &mut TokenStream) {
for arg in self.0.inputs[1..].iter() {
match *arg {
FnArg::Arg { ref name, ref ty, .. } => {
FnArg::Arg {
ref name, ref ty, ..
} => {
name.to_tokens(tokens);
Token!(:)([Span::call_site()]).to_tokens(tokens);
ToGlibType(ty, self.0).to_tokens(tokens);
......@@ -274,7 +276,9 @@ impl<'ast> ToTokens for ArgNamesToGlib<'ast> {
fn to_tokens(&self, tokens: &mut TokenStream) {
for arg in self.0 {
match *arg {
FnArg::Arg { ref ty, ref name, .. } => {
FnArg::Arg {
ref ty, ref name, ..
} => {
ToGlib(ty, name).to_tokens(tokens);
Token!(,)([Span::call_site()]).to_tokens(tokens);
}
......
......@@ -515,7 +515,8 @@ impl<'ast> Ty<'ast> {
pub fn to_gparam_spec_constructor(&self) -> TokenStream {
match *self {
Ty::Unit => unreachable!("there is no g_param_spec_*() for the Unit type"),
Ty::Char(_) => quote! { gobject_ffi::g_param_spec_uint }, // <char as ToGlib>::GlibType = u32
Ty::Char(_) => quote! { gobject_ffi::g_param_spec_uint }, /* <char as ToGlib>::
* GlibType = u32 */
Ty::Bool(_) => quote! { gobject_ffi::g_param_spec_boolean },
Ty::Borrowed(_) => unimplemented!(),
......@@ -543,7 +544,8 @@ impl<'ast> Ty<'ast> {
pub fn to_gparam_spec_min_max_default(&self) -> TokenStream {
match *self {
Ty::Unit => unreachable!("there is no g_param_spec_*() for the Unit type"),
Ty::Char(_) => quote! { std::u32::MIN, std::u32::MAX, 0 }, // <char as ToGlib>::GlibType = u32
Ty::Char(_) => quote! { std::u32::MIN, std::u32::MAX, 0 }, /* <char as ToGlib>::
* GlibType = u32 */
// g_param_spec_bool() takes no min/max, just a default
Ty::Bool(_) => quote! { glib_ffi::GFALSE },
......@@ -572,7 +574,8 @@ impl<'ast> Ty<'ast> {
pub fn to_gvalue_setter(&self) -> TokenStream {
match *self {
Ty::Unit => unreachable!("there is no g_value_set_*() for the Unit type"),
Ty::Char(_) => quote! { gobject_ffi::g_value_set_uint }, // <char as ToGlib>::GlibType = u32
Ty::Char(_) => quote! { gobject_ffi::g_value_set_uint }, /* <char as ToGlib>::
* GlibType = u32 */
Ty::Bool(_) => quote! { gobject_ffi::g_value_set_bool },
Ty::Borrowed(_) => unimplemented!(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment