Skip to content

Commit b0f1892

Browse files
committed
Address revuew comments
1 parent 92588e4 commit b0f1892

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/serialization.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Serialization in Rustc
22

33
Rustc has to [serialize] and deserialize various data during compilation.
4-
Specifially:
4+
Specifically:
55

66
- "Crate metadata", mainly query outputs, are serialized in a binary
77
format into `rlib` and `rmeta` files that are output when compiling a library
@@ -17,7 +17,7 @@ Specifially:
1717

1818
The [`rustc_serialize`] crate defines two traits for types which can be serialized:
1919

20-
```rust
20+
```rust,ignore
2121
pub trait Encodable<S: Encoder> {
2222
fn encode(&self, s: &mut S) -> Result<(), S::Error>;
2323
}
@@ -35,7 +35,7 @@ usually implemented by [derives]. These generate implementations that forward
3535
deserialization to the fields of the struct or enum. For a struct those impls
3636
look something like this:
3737

38-
```rust
38+
```rust,ingore
3939
# #![feature(rustc_private)]
4040
# extern crate rustc_serialize;
4141
# use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
@@ -59,7 +59,7 @@ impl<D: Decoder> Decodable<D> for MyStruct {
5959
let int = d.read_struct_field("int", 0, Decodable::decode)?;
6060
let float = d.read_struct_field("float", 1, Decodable::decode)?;
6161
62-
Ok(MyStruct::new(int, float, SyntaxContext::root()))
62+
Ok(MyStruct { int, float })
6363
})
6464
}
6565
}

0 commit comments

Comments
 (0)