doprz/dipc

Compiling from source return errors

Closed this issue · 1 comments

  Compiling dipc v0.5.0 (/home/rochalaj/dipc)
warning: unused imports: `fs::File`, `io::BufReader`
 --> src/cli.rs:1:11
  |
1 | use std::{fs::File, io::BufReader, path::PathBuf, str::FromStr};
  |           ^^^^^^^^  ^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `serde_json::Value`
 --> src/cli.rs:4:5
  |
4 | use serde_json::Value;
  |     ^^^^^^^^^^^^^^^^^

error[E0599]: no variant named `RawJSON` found for enum `ColorPalette`
   --> src/config.rs:151:23
    |
151 |         ColorPalette::RawJSON { .. } => String::new(),
    |                       ^^^^^^^ variant not found in `ColorPalette`
    |
   ::: src/cli.rs:107:1
    |
107 | pub enum ColorPalette {
    | --------------------- variant `RawJSON` not found here

error[E0277]: `ColorPaletteArgGroup` doesn't implement `std::fmt::Display`
  --> src/main.rs:53:13
   |
53 |             cli.color_palette, cli.styles
   |             ^^^^^^^^^^^^^^^^^ `ColorPaletteArgGroup` cannot be formatted with the default formatter
   |
   = help: the trait `std::fmt::Display` is not implemented for `ColorPaletteArgGroup`
   = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
   = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `writeln` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no method named `clone` found for struct `ColorPaletteArgGroup` in the current scope
  --> src/main.rs:60:58
   |
60 |     let palettes = match parse_palette(cli.color_palette.clone().get_json(), &cli.styles) {
   |                                                          ^^^^^ method not found in `ColorPaletteArgGroup`
   |
  ::: src/cli.rs:45:1
   |
45 | struct ColorPaletteArgGroup {
   | --------------------------- method `clone` not found for this struct
   |
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following trait defines an item `clone`, perhaps you need to implement it:
           candidate #1: `Clone`

error[E0308]: mismatched types
   --> src/main.rs:162:50
    |
162 |             let new_rgb = lab.to_nearest_palette(&palettes).to_rgb();
    |                               ------------------ ^^^^^^^^^ expected `&[Lab]`, found `&Vec<Palette>`
    |                               |
    |                               arguments to this method are incorrect
    |
    = note: expected reference `&[delta::Lab]`
               found reference `&Vec<Palette>`
note: method defined here
   --> src/delta.rs:35:12
    |
35  |     pub fn to_nearest_palette(self, palette: &[Lab]) -> Self {
    |            ^^^^^^^^^^^^^^^^^^       ---------------

error[E0308]: mismatched types
   --> src/main.rs:166:56
    |
166 |         let output_file_name = output_file_name(&path, &cli.color_palette, &palettes);
    |                                ----------------        ^^^^^^^^^^^^^^^^^^ expected `&ColorPalette`, found `&ColorPaletteArgGroup`
    |                                |
    |                                arguments to this function are incorrect
    |
    = note: expected reference `&ColorPalette`
               found reference `&ColorPaletteArgGroup`
note: function defined here
   --> src/config.rs:137:8
    |
137 | pub fn output_file_name(
    |        ^^^^^^^^^^^^^^^^
138 |     input_file_path: &PathBuf,
139 |     color_palette: &ColorPalette,
    |     ----------------------------

Some errors have detailed explanations: E0277, E0308, E0599.
For more information about an error, try `rustc --explain E0277`.
warning: `dipc` (bin "dipc") generated 2 warnings
error: could not compile `dipc` due to 5 previous errors; 2 warnings emitted
error: failed to compile `dipc v0.5.0 (/home/rochalaj/dipc)`, intermediate artifacts can be found at `/home/rochalaj/dipc/target`

cargo v1.69.0
OpenSuse Tumbleweed

how to reproduce

  1. git clone https://github.com/doprz/dipc.git
  2. cd dipc
  3. cargo install --path .

I did not obtain any kind of error installing directly from cargo with: cargo install dipc

doprz commented

Thank you for reporting this issue. We're currently working on releasing v1.0.0 and we're moving some things around.
cargo install dipc is on v0.5.0 and as such doesn't have these new changes.

I will momentarily re-enable these features and update this thread when it's finished.