Closed TheAlgorythm closed 7 months ago
This are just a few basic additions in order to get familiar with the code base.
Is there a way to generalise over Path
and Utf8Path
/Path
and Utf8Path
? This would be really helpful as the encoding is at a lower level and don't have to double the types.
This are just a few basic additions in order to get familiar with the code base. Is there a way to generalise over
Path
andUtf8Path
/Path
andUtf8Path
? This would be really helpful as the encoding is at a lower level and don't have to double the types.
Unfortunately, you need two distinct types if you want to handle both. While a lot of code can be shared, they operate on byte slices and str slices. Structs that work with str slices can be easily converted into the byte slice form, but the other way around is unsafe. Part of the type safety construct.
If you want to minimize duplicate code, my recommendation is to either have a trait that works on byte slices that you can apply to both, or implement the logic in a macro that generates both struct impls.
closes #19