{"action":"opened","issue":{"url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/1322","repository_url":"https://api.github.com/repos/Manishearth/rust-clippy","labels_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/1322/labels{/name}","comments_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/1322/comments","events_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/1322/events","html_url":"https://github.com/Manishearth/rust-clippy/issues/1322","id":187018709,"number":1322,"title":"Potential false positive for let_and_return","user":{"login":"Keats","id":680355,"avatar_url":"https://avatars.githubusercontent.com/u/680355?v=3","gravatar_id":"","url":"https://api.github.com/users/Keats","html_url":"https://github.com/Keats","followers_url":"https://api.github.com/users/Keats/followers","following_url":"https://api.github.com/users/Keats/following{/other_user}","gists_url":"https://api.github.com/users/Keats/gists{/gist_id}","starred_url":"https://api.github.com/users/Keats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Keats/subscriptions","organizations_url":"https://api.github.com/users/Keats/orgs","repos_url":"https://api.github.com/users/Keats/repos","events_url":"https://api.github.com/users/Keats/events{/privacy}","received_events_url":"https://api.github.com/users/Keats/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-03T10:10:26Z","updated_at":"2016-11-03T10:10:26Z","closed_at":null,"body":"<!--\r\nHi there! Whether you've come to make a suggestion for a new lint, an improvement to an existing lint or to report a bug or a false positive in Clippy, you've come to the right place.\r\n\r\nIf you want to report that Clippy does not compile, please be sure to be using the *latest version* of *Rust nightly*! Compiler plugins are highly unstable and will only work with a nightly Rust for now. If you are but still have a problem, please let us now!\r\n\r\nThank you for using Clippy!\r\n\r\nWrite your comment below this line: -->\r\nI have the following macro:\r\n\r\n```rust\r\n#[macro_export]\r\nmacro_rules! try_get_value {\r\n    ($filter_name:expr, $var_name:expr, $ty:ty, $val:expr) => {{\r\n        let v: $ty = match ::serde_json::value::from_value($val.clone()) {\r\n            Ok(s) => s,\r\n            Err(_) => {\r\n                return Err(::errors::TeraError::FilterIncorrectArgType(\r\n                    $filter_name.to_string(),\r\n                    $var_name.to_string(),\r\n                    $val,\r\n                    stringify!($ty).to_string())\r\n                );\r\n            }\r\n        };\r\n        v\r\n    }};\r\n}\r\n```\r\n\r\nAnd running clippy, it complains that I can directly return the match but doing so fails since it doesn't know the type ($ty can `f32`, `String`, etc).\r\nAfaik there is no other way to cast the `s` variable other than that syntax (`as $ty` doesn't work). Am I missing a way to do it or is it a real false positive?\r\n"}}
{"actor":{"display_login":"Keats"}}