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

parserモジュールのエンハンス: read_city()の第2引数にはPrefectureではなくその参照を渡すように変更 #105

Conversation

YuukiToriyama
Copy link
Owner

No description provided.

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [clippy] reported by reviewdog 🐶

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> src/parser/read_city.rs:17:52
   |
17 |         if let Some(result) = adapter.apply(input, &city_name) {
   |                                                    ^^^^^^^^^^ help: change this to: `city_name`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

pub fn read_city(input: &str, prefecture: Prefecture) -> Option<(String, String)> {
for city_name in prefecture.cities {
pub fn read_city(input: &str, prefecture: &Prefecture) -> Option<(String, String)> {
for city_name in &prefecture.cities {
if let Ok((rest, city_name)) =
tag::<&str, &str, VerboseError<&str>>(&city_name).parse(input)
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [clippy] reported by reviewdog 🐶

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> src/parser/read_city.rs:10:51
   |
10 |             tag::<&str, &str, VerboseError<&str>>(&city_name).parse(input)
   |                                                   ^^^^^^^^^^ help: change this to: `city_name`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
   = note: `#[warn(clippy::needless_borrow)]` on by default

@YuukiToriyama
Copy link
Owner Author

clippyの警告が出てしまったのでクローズ

@YuukiToriyama YuukiToriyama deleted the feature/enhance-parser/change-argument-type-of-read-city branch May 16, 2024 13:16
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.

1 participant