Skip to content
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

Please switch SuppliedSchema to an owned string #6

Closed
kitsuneninetails opened this issue Mar 15, 2019 · 1 comment
Closed

Please switch SuppliedSchema to an owned string #6

kitsuneninetails opened this issue Mar 15, 2019 · 1 comment

Comments

@kitsuneninetails
Copy link
Contributor

kitsuneninetails commented Mar 15, 2019

Using a &`static str means that the string supplied to the schema must be a string known at compile time and created at program execution (akin to a static const char* in C). This disallows reading a schema in from a file.

Looking at how SuppliedSchema uses it's string, it's not obvious that a static string is needed or why an owned string should not be used. In terms of performance, this is a one-time operation or thereabouts, and is not a repeated call, and usually upon program initiation, meaning super-high performance isn't really a factor.

Using an owned string is more usable and transparent and allows for more flexibility in the use of SuppliedSchema

A proposed fix is in an upcoming PR.

@gklijs
Copy link
Owner

gklijs commented Mar 22, 2019

Fixed by @kitsuneninetails

@gklijs gklijs closed this as completed Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants