Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Oct 26, 2014

No description provided.

@reem
Copy link
Contributor

reem commented Oct 26, 2014

I'm not sure what the added utility of these methods is; can't you just call .encode if the underlying data is Encodable and just do Arc::new(Decodable::decode(data)) to get Arc<D> where D: Decodable<...>?

@ghost
Copy link
Author

ghost commented Oct 26, 2014

@reem it allows #[deriving(Encodable, Decodable)] to work if the structure has an Arc pointer embedded inside of it. Same reason Rc<T> and Box<T> support it.

eg:

#[deriving(Encodable, Decodable)]
struct foo {
    bar: Arc<uint>
}

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Oct 27, 2014
@bors bors merged commit 8a4bd84 into rust-lang:master Oct 28, 2014
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.

3 participants