Skip to content

Commit

Permalink
chore: upgrade to dprint-core 0.55.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Apr 6, 2022
1 parent 59019a8 commit 203e39e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ tracing = ["dprint-core/tracing"]

[dependencies]
anyhow = "1.0.56"
dprint-core = { version = "0.54.1", features = ["formatting"] }
dprint-core = { version = "0.55.0", features = ["formatting"] }
pulldown-cmark = { version = "0.9.1", default-features = false }
regex = "1"
serde = { version = "1.0.136", features = ["derive"] }
serde_json = { version = "1.0", optional = true }

[dev-dependencies]
dprint-development = "0.8.0"
dprint-development = "0.9.0"
serde_json = { version = "1.0" }
18 changes: 5 additions & 13 deletions src/generation/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,19 +265,11 @@ fn gen_block_quote(block_quote: &BlockQuote, context: &mut Context) -> PrintItem
for print_item in gen_nodes(&block_quote.children, context).iter() {
match print_item {
PrintItem::String(text) => {
items.push_condition(if_true(
"angleBracketIfStartOfLine",
condition_resolvers::is_start_of_line(),
"> ".into(),
));
items.push_condition(if_true("angleBracketIfStartOfLine", condition_resolvers::is_start_of_line(), "> ".into()));
items.push_item(PrintItem::String(text));
}
PrintItem::Signal(Signal::NewLine) => {
items.push_condition(if_true(
"angleBracketIfStartOfLine",
condition_resolvers::is_start_of_line(),
">".into(),
));
items.push_condition(if_true("angleBracketIfStartOfLine", condition_resolvers::is_start_of_line(), ">".into()));
items.push_signal(Signal::NewLine);
}
_ => items.push_item(print_item),
Expand Down Expand Up @@ -624,14 +616,14 @@ fn gen_list(list: &List, is_alternate: bool, context: &mut Context) -> PrintItem
let indent_increment = (prefix_text.chars().count() + 1) as u32;
context.indent_level += indent_increment;
items.push_string(prefix_text);
let after_child = Info::new("afterChild");
let after_child = LineAndColumn::new("afterChild");
items.push_condition(if_true(
"spaceIfHasChild",
Rc::new(move |context| Some(!condition_helpers::is_at_same_position(context, &after_child)?)),
Rc::new(move |context| Some(!condition_helpers::is_at_same_position(context, after_child)?)),
Signal::SpaceIfNotTrailing.into(),
));
items.extend(with_indent_times(generate(child, context), indent_increment));
items.push_info(after_child);
items.push_line_and_column(after_child);
context.indent_level -= indent_increment;
}

Expand Down

0 comments on commit 203e39e

Please sign in to comment.