From 010969223c085032e17ad5411dba984d272fa033 Mon Sep 17 00:00:00 2001 From: Satyam Bansal Date: Tue, 28 Jan 2025 00:50:57 +0530 Subject: [PATCH] Fix Struct example In following code snippet,`eyes` should be type cast to `Field` as `hands` and `feet` are both `Field` type. ``` let ten = hands + feet + eyes as u8; ``` --- docs/docs/noir/concepts/data_types/structs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/noir/concepts/data_types/structs.md b/docs/docs/noir/concepts/data_types/structs.md index 29951ae843a..4b0a8001226 100644 --- a/docs/docs/noir/concepts/data_types/structs.md +++ b/docs/docs/noir/concepts/data_types/structs.md @@ -52,7 +52,7 @@ Structs can also be destructured in a pattern, binding each field to a new varia fn main() { let Animal { hands, legs: feet, eyes } = get_octopus(); - let ten = hands + feet + eyes as u8; + let ten = hands + feet + eyes as Field; } fn get_octopus() -> Animal { @@ -93,4 +93,4 @@ pub struct Animal { pub(crate) legs: Field, // accessible from the entire crate pub eyes: u8, // accessible from anywhere } -``` \ No newline at end of file +```