Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions other_custom_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,18 @@ impl CustomTypesContract {
pub fn tuple_strukt(_env: Env, tuple_strukt: TupleStruct) -> TupleStruct {
tuple_strukt
}

pub fn get_object_vec_option(env: Env) -> Option<Vec<Test>> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with other functions in this contract, we should drop the get_ prefix and use the same names as other functions here.

Suggested change
pub fn get_object_vec_option(env: Env) -> Option<Vec<Test>> {
pub fn option_vec_strukt(env: Env) -> Option<Vec<Test>> {

let obj: Test = Test {
a: 1,
b: true,
c: symbol_short!("hi"),
};
let obj2: Test = Test {
a: 2,
b: false,
c: symbol_short!("hello"),
};
Some(Vec::from_array(&env, [obj, obj2]))
}
}