ybc icon indicating copy to clipboard operation
ybc copied to clipboard

Should `FileProperties::files` be a `Vec<String>`?

Open unbrice opened this issue 4 years ago • 0 comments

Currently the files property of ybc::FileProperties is a Vec<web_sys::File>. This is slightly inconvenient, because in order to read the file, one need to hand it over eg to a ReaderService, at which point ybc::FileProperties can no longer own it.

Of the whole web_sys::File object, only the name seems in use. If instead of files, ybc::FileProperties contained a file_names: Vec<String>, ownership wouldn't be an issue anymore.

Thus I offer to add a file_names property to ybc::FileProperties. files would stay for compatibility. Its content would appended to the list, after elements from file_names. Does that sound reasonable? If yes, I'll be happy to send you a pull request.

unbrice avatar Sep 10 '21 14:09 unbrice