rust-fatfs icon indicating copy to clipboard operation
rust-fatfs copied to clipboard

Examples passing FileSystem to functions?

Open kallisti5 opened this issue 2 years ago • 1 comments

Trying to adapt existing code to the new 0.3.x fatfs. Not 100% sure how to pass FileSystem between functions now :laughing:

[kallisti5@freeframe rune]$ cargo build
   Compiling rune v0.1.1 (/home/kallisti5/Code/rune)
error[E0107]: missing generics for struct `partition::Partition`
   --> src/main.rs:134:67
    |
134 | fn place_files(board: boards::Board, target_fs: fatfs::FileSystem<Partition>, steps: u32)
    |                                                                   ^^^^^^^^^ expected 1 generic argument
    |
note: struct defined here, with 1 generic parameter: `T`
   --> src/partition/mod.rs:9:12
    |
9   | pub struct Partition<T: ReadWriteSeek> {
    |            ^^^^^^^^^ -
help: add missing generic argument
    |
134 | fn place_files(board: boards::Board, target_fs: fatfs::FileSystem<Partition<T>>, steps: u32)
    |                                                                   ~~~~~~~~~~~~

For more information about this error, try `rustc --explain E0107`.
error: could not compile `rune` due to previous error
[kallisti5@freeframe rune]$ 

kallisti5 avatar Mar 15 '22 20:03 kallisti5

If I read it correctly the compiler says that you are missing a generic parameter near Partition struct. This struct is not part of fatfs crate so I don't think I can really help here without knowing more about your code

rafalh avatar Mar 17 '22 23:03 rafalh