Open trombonehero opened 1 year ago
Argh, this is a frustrating oversight. For now, FnCache
or a custom implementation of Cache
should be sufficient. This API does require a pretty significant redesign though. I'll see whether I get the opportunity to do this over the next week!
I just stumbled on this same issue. If nothing else can FileCache be removed until a solution exists. It would have saved me a lot of time. As it was I saw what was clearly what I wanted and was banging my head against the wall trying to figure out how to get it to work, where I would have just used the FnCache if that was the only option.
Also it looks like FnCache doesn't work with Path/PathBuf either due to the requirement for Display that Path doesn't meet. So a custom implementation is required to work with Path/PathBuf. Not a big deal, just pointing it out.
I'm slowly gearing up to a crate rewrite, so I'll add this to the list of things to fix when this happens. Thanks for the reminder!
I'm attempting to use
ariadne::FileCache
withReport::write
(orprint
oreprint
), but it doesn't seem to work for me.FileCache
implementsCache<Path>
but notCache<PathBuf>
, and asstd::path::Path
isn't sized, I can't pass aPath
directly intoReport::build
or aLabel
. Using&Path
in the following minimal example:yields the following error:
This is using ariadne 0.1.5.
Thanks!