blazood / mdbook-search-chinese

origin mdbook search can not use chines, this processor support search with chinese
3 stars 1 forks source link

install 失败 #1

Open Sciroccogti opened 2 years ago

Sciroccogti commented 2 years ago
  Compiling mdbook-search-chinese v0.1.0 (/home/user/.cargo/git/checkouts/mdbook-search-chinese-ff609749ceafbe58/8ef8f5b)
error[E0061]: this function takes 2 arguments but 1 argument was supplied
   --> src/search.rs:94:17
    |
94  |     let mut p = utils::new_cmark_parser(&chapter.content).peekable();
    |                 ^^^^^^^^^^^^^^^^^^^^^^^ ---------------- supplied 1 argument
    |                 |
    |                 expected 2 arguments
    |
note: function defined here
   --> /home/user/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/mdbook-0.4.14/src/utils/mod.rs:163:8
    |
163 | pub fn new_cmark_parser(text: &str, curly_quotes: bool) -> Parser<'_> {
    |        ^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
   --> src/search.rs:108:13
    |
107 |         match event {
    |               ----- this expression has type `pulldown_cmark::parse::Event<'_>`
108 |             Event::Start(Tag::Heading(i)) if i <= max_section_depth => {
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `pulldown_cmark::parse::Event`, found enum `pulldown_cmark::Event`
    |
    = note: perhaps two different versions of crate `pulldown_cmark` are being used?

error[E0308]: mismatched types
   --> src/search.rs:127:13
    |
107 |         match event {
    |               ----- this expression has type `pulldown_cmark::parse::Event<'_>`
...
127 |             Event::End(Tag::Heading(i)) if i <= max_section_depth => {
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `pulldown_cmark::parse::Event`, found enum `pulldown_cmark::Event`
    |
    = note: perhaps two different versions of crate `pulldown_cmark` are being used?

error[E0308]: mismatched types
   --> src/search.rs:132:13
    |
107 |         match event {
    |               ----- this expression has type `pulldown_cmark::parse::Event<'_>`
...
132 |             Event::Start(Tag::FootnoteDefinition(name)) => {
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `pulldown_cmark::parse::Event`, found enum `pulldown_cmark::Event`
    |
    = note: perhaps two different versions of crate `pulldown_cmark` are being used?

error[E0308]: mismatched types
   --> src/search.rs:136:13
    |
107 |         match event {
    |               ----- this expression has type `pulldown_cmark::parse::Event<'_>`
...
136 |             Event::Html(html) => {
    |             ^^^^^^^^^^^^^^^^^ expected enum `pulldown_cmark::parse::Event`, found enum `pulldown_cmark::Event`
    |
    = note: perhaps two different versions of crate `pulldown_cmark` are being used?

error[E0308]: mismatched types
   --> src/search.rs:149:13
    |
107 |         match event {
    |               ----- this expression has type `pulldown_cmark::parse::Event<'_>`
...
149 |             Event::Start(_) | Event::End(_) | Event::Rule | Event::SoftBreak | Event::HardBreak => {
    |             ^^^^^^^^^^^^^^^ expected enum `pulldown_cmark::parse::Event`, found enum `pulldown_cmark::Event`
    |
    = note: perhaps two different versions of crate `pulldown_cmark` are being used?

error[E0308]: mismatched types
   --> src/search.rs:149:31
    |
107 |         match event {
    |               ----- this expression has type `pulldown_cmark::parse::Event<'_>`
...
149 |             Event::Start(_) | Event::End(_) | Event::Rule | Event::SoftBreak | Event::HardBreak => {
    |                               ^^^^^^^^^^^^^ expected enum `pulldown_cmark::parse::Event`, found enum `pulldown_cmark::Event`
    |
    = note: perhaps two different versions of crate `pulldown_cmark` are being used?

error[E0308]: mismatched types
   --> src/search.rs:149:47
    |
107 |         match event {
    |               ----- this expression has type `pulldown_cmark::parse::Event<'_>`
...
149 |             Event::Start(_) | Event::End(_) | Event::Rule | Event::SoftBreak | Event::HardBreak => {
    |                                               ^^^^^^^^^^^ expected enum `pulldown_cmark::parse::Event`, found enum `pulldown_cmark::Event`
    |
    = note: perhaps two different versions of crate `pulldown_cmark` are being used?

error[E0308]: mismatched types
   --> src/search.rs:149:61
    |
107 |         match event {
    |               ----- this expression has type `pulldown_cmark::parse::Event<'_>`
...
149 |             Event::Start(_) | Event::End(_) | Event::Rule | Event::SoftBreak | Event::HardBreak => {
    |                                                             ^^^^^^^^^^^^^^^^ expected enum `pulldown_cmark::parse::Event`, found enum `pulldown_cmark::Event`
    |
    = note: perhaps two different versions of crate `pulldown_cmark` are being used?

error[E0308]: mismatched types
   --> src/search.rs:149:80
    |
107 |         match event {
    |               ----- this expression has type `pulldown_cmark::parse::Event<'_>`
...
149 |             Event::Start(_) | Event::End(_) | Event::Rule | Event::SoftBreak | Event::HardBreak => {
    |                                                                                ^^^^^^^^^^^^^^^^ expected enum `pulldown_cmark::parse::Event`, found enum `pulldown_cmark::Event`
    |
    = note: perhaps two different versions of crate `pulldown_cmark` are being used?

error[E0308]: mismatched types
   --> src/search.rs:158:13
    |
107 |         match event {
    |               ----- this expression has type `pulldown_cmark::parse::Event<'_>`
...
158 |             Event::Text(text) | Event::Code(text) => {
    |             ^^^^^^^^^^^^^^^^^ expected enum `pulldown_cmark::parse::Event`, found enum `pulldown_cmark::Event`
    |
    = note: perhaps two different versions of crate `pulldown_cmark` are being used?

error[E0308]: mismatched types
   --> src/search.rs:158:33
    |
107 |         match event {
    |               ----- this expression has type `pulldown_cmark::parse::Event<'_>`
...
158 |             Event::Text(text) | Event::Code(text) => {
    |                                 ^^^^^^^^^^^^^^^^^ expected enum `pulldown_cmark::parse::Event`, found enum `pulldown_cmark::Event`
    |
    = note: perhaps two different versions of crate `pulldown_cmark` are being used?

error[E0308]: mismatched types
   --> src/search.rs:165:13
    |
107 |         match event {
    |               ----- this expression has type `pulldown_cmark::parse::Event<'_>`
...
165 |             Event::FootnoteReference(name) => {
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `pulldown_cmark::parse::Event`, found enum `pulldown_cmark::Event`
    |
    = note: perhaps two different versions of crate `pulldown_cmark` are being used?

error[E0308]: mismatched types
   --> src/search.rs:170:13
    |
107 |         match event {
    |               ----- this expression has type `pulldown_cmark::parse::Event<'_>`
...
170 |             Event::TaskListMarker(_checked) => {}
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `pulldown_cmark::parse::Event`, found enum `pulldown_cmark::Event`
    |
    = note: perhaps two different versions of crate `pulldown_cmark` are being used?

error[E0308]: mismatched types
   --> src/search.rs:142:32
    |
142 |                 while let Some(Event::Html(html)) = p.peek() {
    |                                ^^^^^^^^^^^^^^^^^    -------- this expression has type `std::option::Option<&pulldown_cmark::parse::Event<'_>>`
    |                                |
    |                                expected enum `pulldown_cmark::parse::Event`, found enum `pulldown_cmark::Event`
    |
    = note: perhaps two different versions of crate `pulldown_cmark` are being used?

error: aborting due to 15 previous errors

Some errors have detailed explanations: E0061, E0308.
For more information about an error, try `rustc --explain E0061`.
error: could not compile `mdbook-search-chinese`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `mdbook-search-chinese v0.1.0 (https://github.com/blazood/mdbook-search-chinese#8ef8f5bd)`, intermediate artifacts can be found at `/tmp/cargo-install0MTkRC`

Caused by:
  build failed

以及目前编译会在 lindera-ipadic 中用到 drive.google.com 的文件,需要代理 https。

Sciroccogti commented 2 years ago

似乎该情况仅在使用 cargo install 时才会出现,不论是使用 --git 还是 --path

本地 clone 后进行 cargo build 没有问题