Skip to content

Commit f5d3630

Browse files
committed
Fix latest import clippy guardrails
1 parent cbddb73 commit f5d3630

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

  • crates/jcode-import-core/src

crates/jcode-import-core/src/lib.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,8 @@ pub fn parse_rfc3339_json(value: Option<&serde_json::Value>) -> Option<DateTime<
359359
pub fn extract_external_text_from_json(value: &serde_json::Value, include_tools: bool) -> String {
360360
fn visit(value: &serde_json::Value, include_tools: bool, out: &mut Vec<String>) {
361361
match value {
362-
serde_json::Value::String(text) => {
363-
if !text.trim().is_empty() {
364-
out.push(text.trim().to_string());
365-
}
362+
serde_json::Value::String(text) if !text.trim().is_empty() => {
363+
out.push(text.trim().to_string());
366364
}
367365
serde_json::Value::Array(items) => {
368366
for item in items {
@@ -789,10 +787,8 @@ fn truncate_title_text(text: &str, max_chars: usize) -> String {
789787
pub fn extract_text_from_json_value(value: &serde_json::Value) -> String {
790788
fn visit(value: &serde_json::Value, out: &mut Vec<String>) {
791789
match value {
792-
serde_json::Value::String(text) => {
793-
if !text.trim().is_empty() {
794-
out.push(text.trim().to_string());
795-
}
790+
serde_json::Value::String(text) if !text.trim().is_empty() => {
791+
out.push(text.trim().to_string());
796792
}
797793
serde_json::Value::Array(items) => {
798794
for item in items {

0 commit comments

Comments
 (0)