From 203e39e50cee8361603744477e260be64f4f00dd Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 5 Apr 2022 20:17:49 -0400 Subject: [PATCH] chore: upgrade to dprint-core 0.55.0 --- Cargo.toml | 4 ++-- src/generation/generate.rs | 18 +++++------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 20b57de..4127873 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" } diff --git a/src/generation/generate.rs b/src/generation/generate.rs index 4d66de0..564562e 100644 --- a/src/generation/generate.rs +++ b/src/generation/generate.rs @@ -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), @@ -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; }