Advertisement
Guest User

enum scope error

a guest
May 26th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.56 KB | None | 0 0
  1. // oauth.rs
  2. extern crate reqwest;
  3.  
  4. fn getHTTPMethodString(method: reqwest::Method) -> String {
  5.     match method {
  6.         reqwest::Method::Options => "OPTIONS".to_string(),
  7.         reqwest::Method::Get => "GET".to_string(),
  8.         reqwest::Method::Post => "POST".to_string(),
  9.     // ...
  10.     }
  11.  
  12. // ...
  13.  
  14. pub fn generateTwitterRequest(method: reqwest::Method, ...) -> String {
  15.     ...
  16. }
  17.  
  18. // main.rs
  19. extern crate reqwest;
  20. mod oauth;
  21.  
  22. fn index() -> String {
  23.     oauth::generateTwitterRequest(reqwest::Method::POST, ...) // GENERATES ERROR "variant not found in `reqwest::Method`"
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement