I'm working on a path handling library and I was wondering if I could hard-code in the path separator based on what kind of file Rust saves the library to. For example if the file gets saved as libpath.so then a constant for separator should be permanently /
. Likewise if it's a libpath.dll file then it would be \
. It would be more performant for these to be constants rather than have the library check on every method call.
Is there a way to do this kind of thing? Maybe a macro for lib output type choosing what code to persist?