You should do `krate.encode(&mut json).unwrap()` here, so we'll fail instead of silently ignoring an error.