Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
saying121 committed Nov 19, 2024
1 parent 2763328 commit 3509cf4
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 69 deletions.
101 changes: 41 additions & 60 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ serde = { version = "^1", default-features = false, features = ["derive"] }
serde_json = { version = "^1", default-features = false }
toml = { version = "^0.8", default-features = true }

html2text = { version = "0.12" }
html2text = { version = "0.13" }

pretty_assertions = { version = "^1" }
paste = { version = "^1" }
Expand All @@ -51,13 +51,13 @@ tui-textarea = { version = "^0.7" }
ratatui-image = { version = "^3", default-features = true, features = ["crossterm"] }
image = { version = "^0.25", default-features = true, features = ["jpeg"] }

tabled = { version = "^0.15" }
tabled = { version = "^0.16" }

open = { version = "^5" }

colored = { version = "^2" }
unicode-width = { version = "^0.1" }
scraper = { version = "^0.20" }
unicode-width = { version = "^0.2" }
scraper = { version = "^0.21" }
strum = { version = "^0.26" }
simsearch = { version = "^0.2" }
# nucleo = { version = "0.4.0" }
Expand Down
4 changes: 1 addition & 3 deletions crates/leetcode-api/src/leetcode/question/qs_detail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,10 @@ pub mod question {
let mut res = String::new();
$(
if !self.$lang_name.is_empty() {
let pat = format!("{}\n", self.$lang_name.join("\n"));
let pat = format!("\n### {}", pat);
let pat = format!("\n### {}", format_args!("{}\n", self.$lang_name.join("\n")));
res.push_str(&pat);
}
)*
let res = html2text::from_read(res.as_bytes(), 80);
res.fmt(f)
}
}
Expand Down
5 changes: 3 additions & 2 deletions crates/leetcode-api/src/render/qs_detail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl Render for Question {

// some content are not HTML
let md_str = if content.contains("<p>") {
html2text::from_read(content.as_bytes(), 80)
html2text::from_read(content.as_bytes(), 80).map_or(content, |s| s)
}
else {
content
Expand All @@ -44,7 +44,8 @@ impl Render for Question {
);

if !self.hints.is_empty() {
let hints = html2text::from_read(self.hints.join("\n").as_bytes(), 80);
let join = self.hints.join("\n");
let hints = html2text::from_read(join.as_bytes(), 80).map_or(join, |s| s);
res = format!("{}\n\nhints:\n{}\n---\n", res, hints);
}
if !self.mysql_schemas.is_empty() {
Expand Down

0 comments on commit 3509cf4

Please sign in to comment.