Merge pull request #1326 from durka/assoc-type-density

honor type_punctuation_density for assoc. types
This commit is contained in:
Nick Cameron 2017-02-23 15:00:47 +13:00 committed by GitHub
commit a84f42d13c

View File

@ -160,7 +160,10 @@ impl<'a> Rewrite for SegmentParam<'a> {
SegmentParam::LifeTime(lt) => lt.rewrite(context, shape),
SegmentParam::Type(ty) => ty.rewrite(context, shape),
SegmentParam::Binding(binding) => {
let mut result = format!("{} = ", binding.ident);
let mut result = match context.config.type_punctuation_density {
TypeDensity::Wide => format!("{} = ", binding.ident),
TypeDensity::Compressed => format!("{}=", binding.ident),
};
let budget = try_opt!(shape.width.checked_sub(result.len()));
let rewrite =
try_opt!(binding.ty