Fix code guards

This commit is contained in:
Ayaz Hafiz 2023-03-23 11:53:43 -05:00
parent 5069d926bb
commit db3698c33c
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 8 additions and 0 deletions

View file

@ -21,10 +21,13 @@ use super::wrap_in_decode_custom_decode_with;
/// Implements decoding of a tuple. For example, for
///
/// ```text
/// (a, b)
/// ```
///
/// we'd like to generate an impl like
///
/// ```roc
/// decoder : Decoder (a, b) fmt | a has Decoding, b has Decoding, fmt has DecoderFormatting
/// decoder =
/// initialState : {e0: Result a [NoElem], e1: Result b [NoElem]}
@ -53,6 +56,7 @@ use super::wrap_in_decode_custom_decode_with;
/// Err NoElem -> Err TooShort
///
/// Decode.custom \bytes, fmt -> Decode.decodeWith bytes (Decode.tuple initialState stepElem finalizer) fmt
/// ```
pub(crate) fn decoder(env: &mut Env, _def_symbol: Symbol, arity: u32) -> (Expr, Variable) {
// The decoded type of each index in the tuple, e.g. (a, b).
let mut index_vars = Vec::with_capacity(arity as _);