jcaromiq / goku

Goku is an HTTP load testing application written in Rust
MIT License
117 stars 3 forks source link

use from_str rather than from_static HeaderName and HeaderValue #2

Closed ifraixedes closed 1 year ago

ifraixedes commented 1 year ago

This solves to me the following error when running cargo buil

error[E0521]: borrowed data escapes outside of function
  --> src/execution.rs:65:28
   |
41 |     settings: &Settings,
   |     --------  - let's call the lifetime of this reference `'1`
   |     |
   |     `settings` is a reference that is only valid in the function body
...
65 |                 let name = HeaderName::from_static(name);
   |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                            |
   |                            `settings` escapes the function body here
   |                            argument requires that `'1` must outlive `'static`

For more information about this error, try `rustc --explain E0521`.
error: could not compile `goku` due to previous error