-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Remove/reduce format!
use in Interface::introspect_to_writer
impl in interface
#828
Comments
std::fmt::format
use in Interface::introspect_to_writer
impl in interface
macroformat! use in
Interface::introspect_to_writer impl in
interface`
format! use in
Interface::introspect_to_writer impl in
interface`format!
use in Interface::introspect_to_writer
impl in interface
Could you elaborate on the issue with doing this at compile time some more? If it's all done then, indentation can be inferred there. And in my eyes, the signatures could also be obtained unless they are inferred. |
You're right that the However, the
I only wish it was that easy. 😢 Currently in rust you can't concatenate strings at compile time unless they're themselves literals (trait constants can't work). I do have a plan now to make most signature handling (especially during ser/de) constant though, through parsed signatures (#882). I'm planning on working on this during the weekend/next week. |
So I went ahead and removed most format! calls but it doesn't save a hell lot in
I am thinking of allowing interfaces to provide file paths to load introspection from. The will give users a way to completely eliminate both of the above (well not all the code but it'll be considerably less code to load a string from a file). In the meantime, there #1136 that already helps a bit. |
This is adding to the binary size (#304).
The problem is number of
format!
calls andformat
macro generating a lot of code. Possible solutions:Type::signature()
so it will not be as easy as simply moving theformat!
calls to the macro side.ufmt
crate but it seems to be not well-maintained and hasn't seen a release for 2 years. Perhaps some other crate?The text was updated successfully, but these errors were encountered: