Updating documentation for serde

This commit is contained in:
Caroline Cullen
2018-08-06 16:06:39 -07:00
committed by Dan Gohman
parent 32b332b733
commit 9683adec64
2 changed files with 17 additions and 4 deletions

View File

@@ -1,3 +1,5 @@
//! Utility for `cranelift_serde`.
#![deny(trivial_numeric_casts)]
#![warn(unused_import_braces, unstable_features, unused_extern_crates)]
#![cfg_attr(
@@ -49,6 +51,7 @@ struct Args {
/// A command either succeeds or fails with an error message.
pub type CommandResult = Result<(), String>;
/// Serialize Cranelift IR to JSON
fn call_ser(file: &str, pretty: bool) -> CommandResult {
let ret_of_parse = parse_functions(file);
match ret_of_parse {
@@ -67,6 +70,7 @@ fn call_ser(file: &str, pretty: bool) -> CommandResult {
}
}
/// Deserialize JSON to Cranelift IR
fn call_de(file: &File) -> CommandResult {
let de: serde_clif_json::SerObj = match serde_json::from_reader(file) {
Result::Ok(val) => val,