Skip to content

Conversation

dehy
Copy link
Contributor

@dehy dehy commented Feb 13, 2025

Summary

Checklist

  • I have reviewed this myself.
  • I have attached a README to my example. You can use this template as reference.
  • I have updated the project README to link my example.

Details

The current Rust CORS example does compile

error[E0433]: failed to resolve: use of undeclared crate or module `response`
 --> function/src/lib.rs:5:32
  |
5 | pub fn with_permissive_cors(r: response::Builder) -> response::Builder {
  |                                ^^^^^^^^ use of undeclared crate or module `response`
  |
help: a type alias with a similar name exists
  |
5 | pub fn with_permissive_cors(r: Response::Builder) -> response::Builder {
  |                                ~~~~~~~~
help: consider importing this module
  |
1 + use http::response;
  |
error[E0433]: failed to resolve: use of undeclared crate or module `response`
 --> function/src/lib.rs:5:54
  |
5 | pub fn with_permissive_cors(r: response::Builder) -> response::Builder {
  |                                                      ^^^^^^^^ use of undeclared crate or module `response`
  |
help: a type alias with a similar name exists
  |
5 | pub fn with_permissive_cors(r: response::Builder) -> Response::Builder {
  |                                                      ~~~~~~~~
help: consider importing this module
  |
1 + use http::response;
  |
For more information about this error, try `rustc --explain E0433`.
error: could not compile `cors-rust` (lib) due to 2 previous errors

This PR explicitly reference the http module in the method parameters.

@dehy dehy changed the title fix(functions): fix corst-rust example fix(functions): corst-rust example Feb 13, 2025
@dehy dehy changed the title fix(functions): corst-rust example fix(functions): cors-rust example Feb 13, 2025
@thomas-tacquet
Copy link
Contributor

Thanks!! I tested it and it works fine 👌

@thomas-tacquet thomas-tacquet merged commit b8fabd5 into scaleway:main Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants