Skip to content

Fuzz code doesn't compile #132

@WillowGriffiths

Description

@WillowGriffiths

It seems like the fuzzer code's gone unused for long enough that it doesn't compile any more:

error[E0308]: mismatched types
   --> fuzz_targets/fuzz_ripunzip.rs:100:60
    |
100 |             let ripunzip = ripunzip::UnzipEngine::for_file(file)?;
    |                            ------------------------------- ^^^^ expected `PathBuf`, found `File`
    |                            |
    |                            arguments to this function are incorrect
    |
note: associated function defined here
   --> /home/willow/Projects/Mine/ripunzip/src/unzip/mod.rs:176:12
    |
176 |     pub fn for_file(zipfile_path: PathBuf) -> Result<Self, RipunzipErrors> {
    |            ^^^^^^^^

error[E0308]: mismatched types
   --> fuzz_targets/fuzz_ripunzip.rs:97:54
    |
 97 |       let ripunzip_result: Result<(), anyhow::Error> = (|| match input.method {
    |  __________________________-------------------------___^
    | |                          |
    | |                          expected due to this
 98 | |         Method::File => {
 99 | |             let file = std::fs::File::open(&zipfile).unwrap();
100 | |             let ripunzip = ripunzip::UnzipEngine::for_file(file)?;
...   |
117 | |     })();
    | |________^ expected `Result<(), Error>`, found `Result<(), RipunzipErrors>`
    |
    = note: expected enum `Result<_, anyhow::Error>`
               found enum `Result<_, RipunzipErrors>`

error[E0277]: the trait bound `&ZipMemberFilename: ToString` is not satisfied
    --> fuzz_targets/fuzz_ripunzip.rs:156:24
     |
 156 |         zip.start_file(name, options).unwrap();
     |             ---------- ^^^^ unsatisfied trait bound
     |             |
     |             required by a bound introduced by this call
     |
help: the trait `std::fmt::Display` is not implemented for `ZipMemberFilename`
    --> fuzz_targets/fuzz_ripunzip.rs:44:1
     |
  44 | struct ZipMemberFilename(Vec<FilenameSegment>);
     | ^^^^^^^^^^^^^^^^^^^^^^^^
     = note: required for `&ZipMemberFilename` to implement `std::fmt::Display`
     = note: required for `&ZipMemberFilename` to implement `ToString`
note: required by a bound in `zip::write::<impl ZipWriter<W>>::start_file`
    --> /home/willow/.local/share/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/zip-3.0.0/src/write.rs:1156:26
     |
1156 |     pub fn start_file<S: ToString, T: FileOptionExtension>(
     |                          ^^^^^^^^ required by this bound in `zip::write::<impl ZipWriter<W>>::start_file`

This should perhaps be looked at.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions