diff --git a/examples/dividends.rs b/examples/dividends.rs index d9b3fe6..2013940 100644 --- a/examples/dividends.rs +++ b/examples/dividends.rs @@ -1,6 +1,7 @@ use std::time::{Duration, UNIX_EPOCH}; -use time::{macros::datetime, OffsetDateTime}; +use time::macros::datetime; +use time::OffsetDateTime; use yahoo_finance_api as yahoo; diff --git a/examples/splits.rs b/examples/splits.rs index 9e27c6c..28ba5ac 100644 --- a/examples/splits.rs +++ b/examples/splits.rs @@ -1,6 +1,7 @@ use std::time::{Duration, UNIX_EPOCH}; -use time::{macros::datetime, OffsetDateTime}; +use time::macros::datetime; +use time::OffsetDateTime; use yahoo_finance_api as yahoo; diff --git a/src/async_impl.rs b/src/async_impl.rs index 8947f36..610fecc 100644 --- a/src/async_impl.rs +++ b/src/async_impl.rs @@ -64,7 +64,7 @@ impl YahooConnector { pub async fn get_quote_period_interval( &self, ticker: &str, - period: &str, + range: &str, interval: &str, prepost: bool, ) -> Result { @@ -72,7 +72,7 @@ impl YahooConnector { YCHART_PERIOD_INTERVAL_QUERY!(), url = self.url, symbol = ticker, - period = period, + range = range, interval = interval, prepost = prepost, ); diff --git a/src/blocking_impl.rs b/src/blocking_impl.rs index b384d3a..504030f 100644 --- a/src/blocking_impl.rs +++ b/src/blocking_impl.rs @@ -58,7 +58,7 @@ impl YahooConnector { pub fn get_quote_period_interval( &self, ticker: &str, - period: &str, + range: &str, interval: &str, prepost: bool, ) -> Result { @@ -66,7 +66,7 @@ impl YahooConnector { YCHART_PERIOD_INTERVAL_QUERY!(), url = self.url, symbol = ticker, - period = period, + range = range, interval = interval, prepost = prepost, ); diff --git a/src/lib.rs b/src/lib.rs index 036cd9b..c396b79 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -201,13 +201,13 @@ macro_rules! YCHART_PERIOD_QUERY { }; } macro_rules! YCHART_RANGE_QUERY { - () => { - "{url}/{symbol}?symbol={symbol}&interval={interval}&range={range}&events=div|split|capitalGains" - }; + () => { + "{url}/{symbol}?symbol={symbol}&interval={interval}&range={range}&events=div|split|capitalGains" + }; } macro_rules! YCHART_PERIOD_INTERVAL_QUERY { () => { - "{url}/{symbol}?symbol={symbol}&period={period}&interval={interval}&includePrePost={prepost}" + "{url}/{symbol}?symbol={symbol}&range={range}&interval={interval}&includePrePost={prepost}" }; } macro_rules! YTICKER_QUERY { diff --git a/src/quotes.rs b/src/quotes.rs index 2034bb8..b5c8527 100644 --- a/src/quotes.rs +++ b/src/quotes.rs @@ -1,9 +1,8 @@ -use std::{collections::HashMap, fmt}; +use std::collections::HashMap; +use std::fmt; -use serde::{ - de::{self, Deserializer, MapAccess, SeqAccess, Visitor}, - Deserialize, Serialize, -}; +use serde::de::{self, Deserializer, MapAccess, SeqAccess, Visitor}; +use serde::{Deserialize, Serialize}; use super::YahooError; @@ -104,6 +103,7 @@ impl YResponse { } Ok(vec![]) } + /// This method retrieves information about the dividends that have /// been recorded during the considered time period. ///