parent
9f3f48c85c
commit
61a401ae51
3 changed files with 12 additions and 1 deletions
|
|
@ -247,7 +247,8 @@ impl Rewrite for ast::MetaItem {
|
||||||
config: context.config,
|
config: context.config,
|
||||||
};
|
};
|
||||||
let item_str = write_list(&item_vec, &fmt)?;
|
let item_str = write_list(&item_vec, &fmt)?;
|
||||||
let one_line_budget = shape.offset_left(name.len())?.sub_width(2)?.width;
|
// 3 = "()" and "]"
|
||||||
|
let one_line_budget = shape.offset_left(name.len())?.sub_width(3)?.width;
|
||||||
if context.config.indent_style() == IndentStyle::Visual
|
if context.config.indent_style() == IndentStyle::Visual
|
||||||
|| (!item_str.contains('\n') && item_str.len() <= one_line_budget)
|
|| (!item_str.contains('\n') && item_str.len() <= one_line_budget)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -157,3 +157,7 @@ pub struct HP(pub u8);
|
||||||
|
|
||||||
// Long `#[doc = "..."]`
|
// Long `#[doc = "..."]`
|
||||||
struct A { #[doc = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"] b: i32 }
|
struct A { #[doc = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"] b: i32 }
|
||||||
|
|
||||||
|
// #2647
|
||||||
|
#[cfg(feature = "this_line_is_101_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")]
|
||||||
|
pub fn foo() {}
|
||||||
|
|
|
||||||
|
|
@ -165,3 +165,9 @@ struct A {
|
||||||
#[doc = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]
|
#[doc = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]
|
||||||
b: i32,
|
b: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// #2647
|
||||||
|
#[cfg(
|
||||||
|
feature = "this_line_is_101_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||||
|
)]
|
||||||
|
pub fn foo() {}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue