mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Derive decoding for tuples
This commit is contained in:
parent
e96be7c746
commit
cb5a21cb20
6 changed files with 1057 additions and 6 deletions
|
@ -52,7 +52,11 @@ use super::wrap_in_decode_custom_decode_with;
|
|||
/// Err NoField -> Err TooShort
|
||||
///
|
||||
/// Decode.custom \bytes, fmt -> Decode.decodeWith bytes (Decode.record initialState stepField finalizer) fmt
|
||||
pub fn decoder(env: &mut Env, _def_symbol: Symbol, fields: Vec<Lowercase>) -> (Expr, Variable) {
|
||||
pub(crate) fn decoder(
|
||||
env: &mut Env,
|
||||
_def_symbol: Symbol,
|
||||
fields: Vec<Lowercase>,
|
||||
) -> (Expr, Variable) {
|
||||
// The decoded type of each field in the record, e.g. {first: a, second: b}.
|
||||
let mut field_vars = Vec::with_capacity(fields.len());
|
||||
// The type of each field in the decoding state, e.g. {first: Result a [NoField], second: Result b [NoField]}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue