Skip to content

Conversation

@aawsome
Copy link
Contributor

@aawsome aawsome commented Jan 4, 2023

Seems the compiler gets stricter about types.
I'm getting the following errors when trying to publish my dependent project:

error[E0053]: method `slide` has an incompatible type for trait                                                                                                             
   --> /home/alex-dev/.cargo/registry/src/github.com-1ecc6299db9ec823/cdc-0.1.1/src/rolling_hash.rs:157:31                                                                  
    |                                                                                                                                                                       
157 |     fn slide(&mut self, byte: u8) {                                                                                                                                   
    |                               ^^                                                                                                                                      
    |                               |                                                                                                                                       
    |                               expected `&u8`, found `u8`                                                                                                              
    |                               help: change the parameter type to match the trait: `&u8`                                                                               
    |                                                                                                                                                                       
note: type in trait                                                                                                                                                         
   --> /home/alex-dev/.cargo/registry/src/github.com-1ecc6299db9ec823/cdc-0.1.1/src/rolling_hash.rs:11:31                                                                   
    |                                                                                                                                                                       
11  |     fn slide(&mut self, byte: &u8);                                                                                                                                   
    |                               ^^^                                                                                                                                     
    = note: expected fn pointer `fn(&mut Rabin64, &u8)`                                                                                                                     
               found fn pointer `fn(&mut Rabin64, u8)`
                                           
error[E0308]: mismatched types       
   --> /home/alex-dev/.cargo/registry/src/github.com-1ecc6299db9ec823/cdc-0.1.1/src/rolling_hash.rs:111:32
    |                                                                                                                                                                       
111 |                     self.slide(b);
    |                          ----- ^
    |                          |     |                                                                                                                                      
    |                          |     expected `&u8`, found `u8`
    |                          |     help: consider borrowing here: `&b`
    |                          arguments to this function are incorrect
    |                                                                                 
note: associated function defined here                                                
   --> /home/alex-dev/.cargo/registry/src/github.com-1ecc6299db9ec823/cdc-0.1.1/src/rolling_hash.rs:11:8
    |                         
11  |     fn slide(&mut self, byte: &u8);                                                                                                                                   
    |        ^^^^^         
                                           
error[E0614]: type `u8` cannot be dereferenced
   --> /home/alex-dev/.cargo/registry/src/github.com-1ecc6299db9ec823/cdc-0.1.1/src/rolling_hash.rs:163:47
    |                                                                                 
163 |         self.window_data[self.window_index] = *byte;
    |                                               ^^^^^

This PR should fix these errors.

@green-coder
Copy link
Owner

Thank you for the PR, will review when I have time.

@aawsome
Copy link
Contributor Author

aawsome commented Jan 20, 2023

Any updates on this? Actually, it prevents me from releasing my project to crates.io, so I would appreciate to have a solution in near future...

@green-coder
Copy link
Owner

I am sorry, I am very busy recently and I won't have time to immerse myself into the Rust language until a while.

For now, I suggest you to find an way of using your fork of the library into your project so you don't get stuck.

@aawsome
Copy link
Contributor Author

aawsome commented Jan 20, 2023

Unfortunately, I can't use the fork as dependency as crates.io recommends that all dependencies are also published on crates.io.
But I made a PR to integrate (parts of) your code into my project. Have a look at rustic-rs/rustic#401 and please complain if you don't agree with that.

Repository owner deleted a comment Jan 1, 2024
Repository owner deleted a comment Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants