Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When I try to compile project 2, I met error messages .
Command
cargo run -- --upstream 171.67.215.200:80
message
error[E0432]: unresolved import
clap::Clap--> src/main.rs:4:5 | 4 | use clap::Clap; | ^^^^^^^^^^ no
Clap` in the rooterror: cannot determine resolution for the derive macro
Clap
--> src/main.rs:10:10
|
10 | #[derive(Clap, Debug)]
| ^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot find attribute
clap
in this scope--> src/main.rs:11:3
|
11 | #[clap(about = "Fun with load balancing")]
| ^^^^
|
= note:
clap
is in scope, but it is a crate, not an attributeerror: cannot find attribute
clap
in this scope--> src/main.rs:13:7
|
13 | #[clap(
| ^^^^
|
= note:
clap
is in scope, but it is a crate, not an attributeerror: cannot find attribute
clap
in this scope--> src/main.rs:20:7
|
20 | #[clap(short, long, about = "Upstream host to forward requests to")]
| ^^^^
|
= note:
clap
is in scope, but it is a crate, not an attributeerror: cannot find attribute
clap
in this scope--> src/main.rs:22:7
|
22 | #[clap(
| ^^^^
|
= note:
clap
is in scope, but it is a crate, not an attributeerror: cannot find attribute
clap
in this scope--> src/main.rs:28:7
|
28 | #[clap(
| ^^^^
|
= note:
clap
is in scope, but it is a crate, not an attributeerror: cannot find attribute
clap
in this scope--> src/main.rs:34:7
|
34 | #[clap(
| ^^^^
|
= note:
clap
is in scope, but it is a crate, not an attributeerror[E0599]: no function or associated item named
parse
found for structCmdOptions
in the current scope--> src/main.rs:70:31
|
12 | struct CmdOptions {
| ----------------- function or associated item
parse
not found for this struct...
70 | let options = CmdOptions::parse();
| ^^^^^ function or associated item not found in
CmdOptions
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following traits define an item
parse
, perhaps you need to implement one of them:candidate #1:
Parser
candidate #2:
TypedValueParser
Some errors have detailed explanations: E0432, E0599.
For more information about an error, try
rustc --explain E0432
.error: could not compile
balancebeam
(bin "balancebeam") due to 9 previous errors`I doubt it's about Crate clap's version ,So I updated it's version and did a little change ,then It compiles .