mirror of
https://github.com/NexVeridian/ark-invest-api-rust-data.git
synced 2025-09-02 01:49:12 +00:00
chore: clippy
This commit is contained in:
parent
86edeab90e
commit
7b2a4d2c72
2 changed files with 5 additions and 5 deletions
|
@ -31,7 +31,7 @@ fn print_df(ticker: &Ticker, df: &DataFrame) {
|
|||
|
||||
fn csv_merge() -> Result<(), Error> {
|
||||
for ticker in Ticker::iter() {
|
||||
if !std::path::Path::new(&format!("./data/csv/{}", ticker)).exists() {
|
||||
if !std::path::Path::new(&format!("./data/csv/{ticker}")).exists() {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ fn csv_merge() -> Result<(), Error> {
|
|||
}
|
||||
|
||||
fn ark_plan(ticker: Ticker) -> Result<(), Error> {
|
||||
println!("Starting: {:#?}", ticker);
|
||||
println!("Starting: {ticker:#?}");
|
||||
let sec = Duration::from_secs(rand::rng().random_range(30 * 60..=4 * 60 * 60));
|
||||
// sleep(sec).await;
|
||||
thread::sleep(sec);
|
||||
|
|
|
@ -110,8 +110,8 @@ impl Ark {
|
|||
fn read_parquet(ticker: &Ticker, path: Option<&String>) -> Result<DF, Error> {
|
||||
let df = LazyFrame::scan_parquet(
|
||||
match path {
|
||||
Some(p) => format!("{}/{}.parquet", p, ticker),
|
||||
None => format!("data/parquet/{}.parquet", ticker),
|
||||
Some(p) => format!("{p}/{ticker}.parquet"),
|
||||
None => format!("data/parquet/{ticker}.parquet"),
|
||||
},
|
||||
ScanArgsParquet::default(),
|
||||
)?;
|
||||
|
@ -558,7 +558,7 @@ impl Ark {
|
|||
|
||||
pub fn merge_old_csv_to_parquet(ticker: Ticker, path: Option<String>) -> Result<Self, Error> {
|
||||
let mut dfs = vec![];
|
||||
for x in glob(&format!("data/csv/{}/*", ticker))?.filter_map(Result::ok) {
|
||||
for x in glob(&format!("data/csv/{ticker}/*"))?.filter_map(Result::ok) {
|
||||
dfs.push(LazyCsvReader::new(x).finish()?);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue