Skip to content

Commit

Permalink
make met_no::Service::new plain (not async) fn
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxVerevkin committed Sep 2, 2023
1 parent c1408b2 commit 6eb5d4b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/blocks/weather.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ pub async fn run(config: &Config, api: &CommonApi) -> Result<()> {
let format = config.format.with_default(" $icon $weather $temp ")?;

let provider: Box<dyn WeatherProvider + Send + Sync> = match &config.service {
WeatherService::MetNo(config) => Box::new(met_no::Service::new(config).await?),
WeatherService::MetNo(config) => Box::new(met_no::Service::new(config)?),
WeatherService::OpenWeatherMap(config) => Box::new(open_weather_map::Service::new(config)),
};

Expand Down
2 changes: 1 addition & 1 deletion src/blocks/weather/met_no.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub(super) struct Service<'a> {
}

impl<'a> Service<'a> {
pub(super) async fn new(config: &'a Config) -> Result<Service<'a>> {
pub(super) fn new(config: &'a Config) -> Result<Service<'a>> {
Ok(Self {
config,
legend: LEGENDS.as_ref().error("Invalid legends file")?,
Expand Down

0 comments on commit 6eb5d4b

Please sign in to comment.