The example usage on README.md is not working for me.
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- rust
调研方向
首先阅读 README.md 中的示例,并使用 cargo build 在一个全新的 Cargo 项目中复现它。将示例的依赖配置与报告的 feature-gated tracing_subscriber 和 clap 错误以及 rcgen API 错误进行比较。当文档中的示例能在全新的项目中成功构建时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
after creating a new project, i used cargo add http-mitm-proxy then used cargo build but for some reason it giving me these errors:
error[E0432]: unresolved import `tracing_subscriber::EnvFilter`
--> src/main.rs:7:5
|
7 | use tracing_subscriber::EnvFilter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `EnvFilter` in the root
|
note: found an item that was configured out
--> /home/zohaib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-subscriber-0.3.19/src/lib.rs:234:21
|
234 | pub use filter::EnvFilter;
| ^^^^^^^^^
note: the item is gated here
--> /home/zohaib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-subscriber-0.3.19/src/lib.rs:232:1
|
232 | / feature! {
233 | | #![all(feature = "env-filter", feature = "std")]
234 | | pub use filter::EnvFilter;
235 | | }
| |_^
= note: this error originates in the macro `feature` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0432]: unresolved import `tracing_subscriber::EnvFilter`
--> src/main.rs:8:5
|
8 | use tracing_subscriber::EnvFilter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `EnvFilter` in the root
|
note: found an item that was configured out
--> /home/zohaib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-subscriber-0.3.19/src/lib.rs:234:21
|
234 | pub use filter::EnvFilter;
| ^^^^^^^^^
note: the item is gated here
--> /home/zohaib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-subscriber-0.3.19/src/lib.rs:232:1
|
232 | / feature! {
233 | | #![all(feature = "env-filter", feature = "std")]
234 | | pub use filter::EnvFilter;
235 | | }
| |_^
= note: this error originates in the macro `feature` (in Nightly builds, run with -Z macro-backtrace for more info)
error: cannot find derive macro `Parser` in this scope
--> src/main.rs:10:10
|
10 | #[derive(Parser)]
| ^^^^^^
|
note: `Parser` is imported here, but it is only a trait, without a derive macro
--> src/main.rs:3:18
|
3 | use clap::{Args, Parser};
| ^^^^^^
error: cannot find attribute `clap` in this scope
--> src/main.rs:12:7
|
12 | #[clap(flatten)]
| ^^^^
|
= note: `clap` is in scope, but it is a crate, not an attribute
error: cannot find derive macro `Args` in this scope
--> src/main.rs:16:10
|
16 | #[derive(Args, Debug)]
| ^^^^
|
note: `Args` is imported here, but it is only a trait, without a derive macro
--> src/main.rs:3:12
|
3 | use clap::{Args, Parser};
| ^^^^
error: cannot find attribute `arg` in this scope
--> src/main.rs:18:7
|
18 | #[arg(required = false)]
| ^^^
error: cannot find attribute `arg` in this scope
--> src/main.rs:20:7
|
20 | #[arg(required = false)]
| ^^^
error[E0599]: no function or associated item named `parse` found for struct `Opt` in the current scope
--> src/main.rs:46:20
|
11 | struct Opt {
| ---------- function or associated item `parse` not found for this struct
...
46 | let opt = Opt::parse();
| ^^^^^ function or associated item not found in `Opt`
|
= 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`
error[E0599]: no method named `with_env_filter` found for struct `SubscriberBuilder` in the current scope
--> src/main.rs:50:10
|
49 | / tracing_subscriber::fmt()
50 | | .with_env_filter(EnvFilter::from_default_env())
| |_________-^^^^^^^^^^^^^^^
|
help: there is a method `with_file` with a similar name
|
50 | .with_file(EnvFilter::from_default_env())
| ~~~~~~~~~
error[E0599]: no function or associated item named `from_ca_cert_pem` found for struct `CertificateParams` in the current scope
--> src/main.rs:55:47
|
55 | let param = rcgen::CertificateParams::from_ca_cert_pem(
| ^^^^^^^^^^^^^^^^ function or associated item not found in `CertificateParams`
|
note: if you're trying to build a new `CertificateParams`, consider using `CertificateParams::new` which returns `Result<CertificateParams, rcgen::Error>`
--> /home/zohaib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rcgen-0.13.2/src/certificate.rs:122:2
|
122 | pub fn new(subject_alt_names: impl Into<Vec<String>>) -> Result<Self, Error> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `http_proxy` (bin "http_proxy") due to 10 previous errors
- 主要语言
- Rust
- 星标
- 66
- 派生
- 12
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
hatoo/http-mitm-proxy 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
hatoo/http-mitm-proxy#120 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 1/100
hatoo/http-mitm-proxy#103 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 15/100
hatoo/http-mitm-proxy#94 ·
-
难度 4/5 3-5 天 新手友好度 35/100
hatoo/http-mitm-proxy#82 · 2 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
hatoo/http-mitm-proxy#68 · 3 条评论 · 1 个 reaction ·
查看 hatoo/http-mitm-proxy 的全部 Issue
相似的 Issue
-
marketing
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
help wanted small extra
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 62/100
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
n0-computer/net-tools#282 ·
维护者通常 2 天内回复