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

Deprecate unused Encoder trait methods #17158

Closed
bluss opened this issue Sep 10, 2014 · 4 comments
Closed

Deprecate unused Encoder trait methods #17158

bluss opened this issue Sep 10, 2014 · 4 comments

Comments

@bluss
Copy link
Member

bluss commented Sep 10, 2014

A gang of trait methods are currently unused and should probably be deprecated and removed.

Unused methods are at least:

emit_enum_struct_variant
emit_enum_struct_variant_field
emit_tuple_arg
emit_tuple_struct
emit_tuple_struct_arg
@omasanori
Copy link
Contributor

What do you mean by currently unused? Are they unused in encoders bundled in libserialize, or existing libraries (on GitHub?) which implement Encoder?

@bluss
Copy link
Member Author

bluss commented Sep 11, 2014

  • emit_tuple_arg is not used by the tuple implementations of Encodable, they instead use emit_seq_elt, so this method is redundant and unused.
  • emit_enum_struct_variant and emit_enum_struct_variant_field and emit_tuple_struct and emit_tuple_struct_arg aren't used by automatic deriving of Encodable -- struct variants in enum instead use emit_enum_variant. Tuple structs instead use emit_struct. In this sense the methods are redundant and unused.

@bluss
Copy link
Member Author

bluss commented Sep 24, 2014

IMO they need to either be used by libstd and similar places (libsyntax) or deprecated. Using emit_tuple_arg is a good idea.

bors added a commit that referenced this issue Sep 26, 2014
…chton

The tuple serialization logic should be using the tuple-specific emit function.  This fixes part of #17158.  The JSON encoder already proxies to `emit_seq_elt` when `emit_tuple_arg` is called, so this should have an effect.
@steveklabnik
Copy link
Member

Encode was moved out of tree, so if this is still an issue, please persue it over at https://github.com/rust-lang/rustc-serialize

lnicola pushed a commit to lnicola/rust that referenced this issue May 19, 2024
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

3 participants