-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor #17
Refactor #17
Conversation
Note that I let a few useless stuff that I will have to clean later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic change!
I left just a small comment.
To be honest, I couldn't fully understand the borrowing issue.
src/gui.rs
Outdated
match file.path { | ||
None => println!("Could not load the file!"), | ||
Some(x) => (self.loaded_files) | ||
.push(hdf::read_nwb_file(&x.display().to_string()).unwrap()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here there's a small inconsistency between the drag&drop and file picker.
When we select a non-nwb file using the file picker, it says:
Could not load /home/anil/work/Text File.txt
When we drag and drop the same file however it panics.
`thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/gui.rs:144:76
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace`
Maybe drag & drop can also say "could not load the file" instead of panicking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes yes, I forgot a match here. I will fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be good now.
6c010b8
to
85c845a
Compare
Here is a first version of the refactoring I mentioned to be able to store several files and fetch their dataset hierarchies.
It's currently not working, I have an issue with borrowing mutable and immutable reference but I will see that later (or @anilbey you know how to fix it? 😇 ).
Does this refactoring makes sense to you?