tomaka / rouille

Web framework in Rust
Apache License 2.0
1.09k stars 105 forks source link

Use std::result::Result in post_input #161

Closed ALSchwalm closed 6 years ago

ALSchwalm commented 6 years ago

Currently post_input does not explicitly use std::result. Instead, it uses the Result from the enclosing scope. As projects will frequently define their own Result type, this can result in some cryptic errors like in #156. I didn't immediatly see anywhere else this could be a problem in rouille, but let me know if there are any other places and I can add them to this PR.

tomaka commented 6 years ago

Thanks for the fix! However I don't really understand why the macro would use the Result from the enclosing scope. (This is not a criticism of your PR, I really don't understand).

jaemk commented 6 years ago

I believe it's because the macro expands to use the type Result when it should instead use the full path ::std::result::Result in case the Result type in scope has been aliased to something else. So instead of use std::result::Result, the usages of Result in the macro should be changed to the fully qualified path, ::std::result::Result.

tomaka commented 6 years ago

Ah yeah. Sorry, I derped. Thanks!