Systemcluster / wordstat

Simple tool to quickly count the frequency of words in a file or collection of files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do I use this on linux?

opened this issue · comments

I'm on ubuntu 22.04, so, I'm not quite a rust user, but I did install couple of needed dependencies. However, on the last 3 steps, it failed to compile.

error:

error[E0432]: unresolved import `std::lazy`
 --> src/cli/../shared/ustring.rs:7:10
  |
7 | use std::lazy::SyncLazy;
  |          ^^^^ could not find `lazy` in `std`

error[E0308]: mismatched types
   --> src/cli/main.rs:328:13
    |
327 |   ...rogressBar::new(0).with_style(
    |                         ---------- arguments to this method are incorrect
328 | / ...   ProgressStyle::default_bar()
329 | | ...       .template("{spinner:.green} {elapsed_precise} [{wide_bar:.green}] {pos}/{len}\n{spinner:.green} {wide_msg}...
    | |______________________________________________________________________________________________________________________^ expected struct `ProgressStyle`, found enum `Result`
    |
    = note: expected struct `ProgressStyle`
                 found enum `Result<ProgressStyle, TemplateError>`
note: associated function defined here
   --> /home/pume/.cargo/registry/src/github.com-1ecc6299db9ec823/indicatif-0.17.2/src/progress_bar.rs:67:12
    |
67  |     pub fn with_style(self, style: ProgressStyle) -> ProgressBar {
    |            ^^^^^^^^^^

error[E0308]: mismatched types
   --> src/cli/main.rs:333:37
    |
333 |     bar_progress.enable_steady_tick(12);
    |                  ------------------ ^^ expected struct `Duration`, found integer
    |                  |
    |                  arguments to this method are incorrect
    |
note: associated function defined here
   --> /home/pume/.cargo/registry/src/github.com-1ecc6299db9ec823/indicatif-0.17.2/src/progress_bar.rs:152:12
    |
152 |     pub fn enable_steady_tick(&self, interval: Duration) {
    |            ^^^^^^^^^^^^^^^^^^

Some errors have detailed explanations: E0308, E0432.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `wordstat` due to 3 previous errors
error: failed to compile `wordstat v0.2.0 (https://github.com/Systemcluster/wordstat.git#e696fa7f)`, intermediate artifacts can be found at `/tmp/cargo-installU01WJx`

I'm.... not sure what to do next.

Oh well. I gusses I could just use wine.
wine wordstat.exe ./Krake
did work!

commented

Thanks for opening this! The compilation issue is caused by me using unstable language features that have since been changed in newer versions. I'll update the code and remove the use of those features.

commented

I've updated the code and it should compile with recent Rust nightly versions now. Completely removing the use of nightly features takes a bit more work, but this should be fine for a while.