From e20b41642f95b79ec798f7e616fb12978cc0d143 Mon Sep 17 00:00:00 2001 From: 0xrsydn Date: Tue, 17 Mar 2026 08:52:00 +0700 Subject: [PATCH] style: format cache tests and fix clippy import --- src/api/msn/parse.rs | 1 - src/cache.rs | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/api/msn/parse.rs b/src/api/msn/parse.rs index 321c6d7..0a7f19b 100644 --- a/src/api/msn/parse.rs +++ b/src/api/msn/parse.rs @@ -30,7 +30,6 @@ pub(crate) fn parse_fundamentals_from_str( #[cfg(test)] mod tests { use super::{parse_fundamentals_from_str, parse_quote_from_str}; - use crate::api::types::Period; #[test] fn parses_quote_fixture_json() { diff --git a/src/cache.rs b/src/cache.rs index 737cf9b..db35df6 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -275,7 +275,9 @@ mod tests { assert!(path.exists(), "corrupted file should exist before get()"); // get() should return Ok(None), not an error - let result: Option = cache.get("quote", "CORRUPT.JK").expect("get should not error"); + let result: Option = cache + .get("quote", "CORRUPT.JK") + .expect("get should not error"); assert_eq!(result, None, "corrupted entry should be treated as miss"); // The corrupted file should be deleted @@ -294,7 +296,10 @@ mod tests { } fs::write(&path, "{ not valid json at all").expect("write corrupted cache"); - assert!(path.exists(), "corrupted file should exist before get_stale()"); + assert!( + path.exists(), + "corrupted file should exist before get_stale()" + ); // get_stale() should return Ok(None), not an error let result: Option = cache