Skip to content

Add serialization support for StrBuf #13875

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

Merged
merged 1 commit into from
May 1, 2014
Merged

Conversation

hjr3
Copy link
Contributor

@hjr3 hjr3 commented May 1, 2014

  • implement Encodable and Decodable for StrBuf
  • implement to_json for StrBuf

@@ -2205,6 +2205,10 @@ impl ToJson for ~str {
fn to_json(&self) -> Json { String((*self).clone()) }
}

impl ToJson for StrBuf {
fn to_json(&self) -> Json { String((*self).clone().into_owned()) }
Copy link
Member

Choose a reason for hiding this comment

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

Writing String((*self).as_slice().into_owned()) will be more efficient.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@huonw
Copy link
Member

huonw commented May 1, 2014

Thanks; looks pretty good, just a few small comments.

- implement Encodable and Decodable for StrBuf
- implement to_json for StrBuf
@hjr3
Copy link
Contributor Author

hjr3 commented May 1, 2014

appreciate the feedback. all fixed up

@hjr3
Copy link
Contributor Author

hjr3 commented May 1, 2014

@alexcrichton does this need to be rescheduled?

@alexcrichton
Copy link
Member

It does indeed! Our windows bots have been a little cranky recently...

bors added a commit that referenced this pull request May 1, 2014
- implement Encodable and Decodable for StrBuf
- implement to_json for StrBuf
@bors bors closed this May 1, 2014
@bors bors merged commit fa6efed into rust-lang:master May 1, 2014
@hjr3 hjr3 deleted the serialize-strbuf branch May 1, 2014 18:07
arcnmx pushed a commit to arcnmx/rust that referenced this pull request Jan 9, 2023
flip1995 added a commit to flip1995/rust that referenced this pull request Dec 26, 2024
`Ty.kind()` is a method.

changelog: none
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.

4 participants