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

Remove returns strings #656

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Cupnfish
Copy link

Removes parameters that are not necessary.
Disadvantages:

  • The type_name method does not currently have stable const.
  • The value returned by type_name is not necessarily the shortest string, for example type_name::<Option<String>>() may return Option<String> or std::option::Option<std::string::String>.
  • Also the returned value will vary with different versions of the compiler.

Advantages:

  • Reduces unnecessary parameter input, which when calling a method will make the caller believe that the return value specified within the parameter has some relationship to the output return value, when in fact the return value entered within the parameter is only useful as a diagnostic for error output. The documentation of type_name within std, on the other hand, is meant to be used for code diagnostic purposes.
  • The interface to call would be more clean.

Copy link
Member

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice one, LGTM

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

Successfully merging this pull request may close these issues.

2 participants