"no method named `map_or` found" 用 cargo 安装 deno 时
"no method named `map_or` found" when installing deno with cargo
我 运行 Ubuntu 18.04。我已经使用 rustup.rs 中的说明在 /home/username/.cargo 目录中安装了 rust。尝试安装 deno 时:
cargo insall deno
在过程即将结束时,构建失败并出现错误:
Compiling deno_core v0.47.0
error[E0599]: no method named `map_or` found for type `std::result::Result<&url::Url, &rusty_v8::data::TryFromTypeError>` in the current scope
--> /home/kaan.atakan/.cargo/registry/src/github.com-1ecc6299db9ec823/deno_core-0.47.0/bindings.rs:569:41
|
569 | v8::String::new(scope, url.as_ref().map_or("<unknown>", Url::as_str))
| ^^^^^^ help: there is a method with a similar name: `map_err`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0599`.
error: could not compile `deno_core`.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `deno v1.0.4`, intermediate artifacts can be found at `/tmp/cargo-installuTtprd`
Caused by:
build failed
呸!原来我的 Rust 安装已经过时了。我通过在终端中输入 rustup update
来更新它,更新完成后我再次 运行 cargo install deno
并且一切正常!
我 运行 Ubuntu 18.04。我已经使用 rustup.rs 中的说明在 /home/username/.cargo 目录中安装了 rust。尝试安装 deno 时:
cargo insall deno
在过程即将结束时,构建失败并出现错误:
Compiling deno_core v0.47.0
error[E0599]: no method named `map_or` found for type `std::result::Result<&url::Url, &rusty_v8::data::TryFromTypeError>` in the current scope
--> /home/kaan.atakan/.cargo/registry/src/github.com-1ecc6299db9ec823/deno_core-0.47.0/bindings.rs:569:41
|
569 | v8::String::new(scope, url.as_ref().map_or("<unknown>", Url::as_str))
| ^^^^^^ help: there is a method with a similar name: `map_err`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0599`.
error: could not compile `deno_core`.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `deno v1.0.4`, intermediate artifacts can be found at `/tmp/cargo-installuTtprd`
Caused by:
build failed
呸!原来我的 Rust 安装已经过时了。我通过在终端中输入 rustup update
来更新它,更新完成后我再次 运行 cargo install deno
并且一切正常!