Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use autolocate city for met_no location #1950

Merged
merged 1 commit into from
Oct 6, 2023

Conversation

bim9262
Copy link
Collaborator

@bim9262 bim9262 commented Oct 6, 2023

No description provided.

src/blocks/weather.rs Outdated Show resolved Hide resolved
@@ -284,7 +284,9 @@ impl WeatherProvider for Service<'_> {
};

Ok(WeatherResult {
location: "Unknown".to_string(),
location: location
.as_ref()
Copy link
Collaborator

@MaxVerevkin MaxVerevkin Oct 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised clippy doesn't catch this, but this .as_ref() is not needed anymore.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose most Option<&T>::as_ref() calls are useless, except for rare cases when Option<&&T> is actually needed. I may look into adding this to clippy in the future.

Also changed function signature:

```
fn need_forecast(format: &Format, format_alt: &Option<Format>) -> bool;
```

to:

```
fn need_forecast(format: &Format, format_alt: Option<&Format>) -> bool;
```
@MaxVerevkin MaxVerevkin merged commit 2fc3d32 into greshake:master Oct 6, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants