Skip to content

Commit

Permalink
perf: Upgrade to dprint_core 0.35.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Jan 18, 2021
1 parent 8fd0e5e commit 9210b35
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 20 deletions.
36 changes: 25 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "dprint-plugin-markdown"
description = "Markdown formatter for dprint."
version = "0.4.3"
version = "0.4.4"
authors = ["David Sherret <[email protected]>"]
license = "MIT"
edition = "2018"
Expand All @@ -23,10 +23,10 @@ panic = "abort"
wasm = ["serde_json", "dprint-core/wasm"]

[dependencies]
dprint-core = { version = "0.31.1", features = ["formatting"] }
dprint-core = { version = "0.35.0", features = ["formatting"] }
lazy_static = "1.4.0"
pulldown-cmark = { version = "0.8.0", default-features = false }
serde = { version = "1.0.88", features = ["derive"] }
serde = { version = "1.0.119", features = ["derive"] }
serde_json = { version = "1.0", optional = true }
regex = "1"

Expand Down
11 changes: 6 additions & 5 deletions src/format_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ pub fn format_text(
));
}
};
let mut context = Context::new(markdown_text, config, format_code_block_text);
let print_items = parse_node(&source_file.into(), &mut context);

// println!("{}", print_items.get_as_text());

Ok(print(print_items, PrintOptions {
Ok(dprint_core::formatting::format(|| {
let mut context = Context::new(markdown_text, config, format_code_block_text);
let print_items = parse_node(&source_file.into(), &mut context);
// println!("{}", print_items.get_as_text());
print_items
}, PrintOptions {
indent_width: 1, // force
max_width: config.line_width,
use_tabs: false, // ignore tabs, always use spaces
Expand Down
2 changes: 1 addition & 1 deletion src/parsing/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ fn parse_block_quote(block_quote: &BlockQuote, context: &mut Context) -> PrintIt
{
let mut items = PrintItems::new();
items.push_str("> ");
items.push_item(PrintItem::String(text.clone()));
items.push_item(PrintItem::String(text));
items
},
{
Expand Down

0 comments on commit 9210b35

Please sign in to comment.