Use nested_shape for indenting types of lazy_static

This commit is contained in:
Shotaro Yamada 2018-03-07 10:51:28 +09:00
parent 61919022dd
commit b3fa50db73
3 changed files with 19 additions and 1 deletions

View File

@ -916,7 +916,7 @@ fn format_lazy_static(context: &RewriteContext, shape: Shape, ts: &TokenStream)
"{}static ref {}: {} =",
vis,
id,
ty.rewrite(context, shape)?
ty.rewrite(context, nested_shape)?
));
result.push_str(&::expr::rewrite_assign_rhs(
context,

View File

@ -35,3 +35,11 @@ let ptr = :: remacs_sys :: xmalloc (
remacs_sys :: Lisp_Subr ; :: std :: ptr :: copy_nonoverlapping (
& subr , ptr , 1 ) ; :: std :: mem :: forget ( subr ) ; :: lisp :: ExternalPtr
:: new ( ptr ) } } ; }
lazy_static! {
static ref FOO: HashMap<String,
(&'static str,
fn(Foo) -> Result<Box<Bar>, Either<FooError, BarError>>
),> = HashMap::new();
}

View File

@ -37,3 +37,13 @@ lazy_static! {
}
};
}
lazy_static! {
static ref FOO: HashMap<
String,
(
&'static str,
fn(Foo) -> Result<Box<Bar>, Either<FooError, BarError>>
),
> = HashMap::new();
}