add nonempty encoding for spans
Before this change, encoding an object containing a codemap::span using the JSON encodeng produced invalid JSON, for instance: [{"span":,"global":false,"idents":["abc"]}] Since the decoder for codemap::span's ignores its argument, I conjecture that this will not damage decoding, and should improve it for many decoders.
This commit is contained in:
parent
19bb16650f
commit
fdf8543cf6
1 changed files with 1 additions and 1 deletions
|
@ -140,7 +140,7 @@ impl cmp::Eq for span {
|
|||
|
||||
impl<S:Encoder> Encodable<S> for span {
|
||||
/* Note #1972 -- spans are encoded but not decoded */
|
||||
fn encode(&self, _s: &S) { }
|
||||
fn encode(&self, _s: &S) { _s.emit_nil() }
|
||||
}
|
||||
|
||||
impl<D:Decoder> Decodable<D> for span {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue