Describe the bug
I can't compile curl example, error message :
error[E0599]: no method named `as_bytes` found for enum `Option` in the current scope
--> examples/curl.rs:114:37
|
114 | if request.user_agent().as_bytes().starts_with(b"curl") {
| ^^^^^^^^ method not found in `Option<&NgxStr>`
|
note: the method `as_bytes` exists on the type `&NgxStr`
--> /home/user/apps/rust/ngx-rust/src/core/string.rs:55:5
|
55 | pub fn as_bytes(&self) -> &[u8] {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider using `Option::expect` to unwrap the `&NgxStr` value, panicking if the value is an `Option::None`
|
114 | if request.user_agent().expect("REASON").as_bytes().starts_with(b"curl") {
| +++++++++++++++++
For more information about this error, try `rustc --explain E0599`.
error: could not compile `examples` (example "curl") due to previous error
To Reproduce
Steps to reproduce the behavior:
Run cargo build --release --package=examples --example=curl
See error
Expected behavior
Curl example compiles without errors
Describe the bug I can't compile curl example, error message :
To Reproduce Steps to reproduce the behavior:
cargo build --release --package=examples --example=curl
Expected behavior Curl example compiles without errors
Your environment
Additional context N/A