Skip to content

Commit a4a2612

Browse files
committed
[ref] Update Readme
1 parent 6aa2735 commit a4a2612

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

README.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -142,24 +142,29 @@ fn main() {
142142
None
143143
);
144144

145-
let features = reader.read_features().expect("Failed to read features");
146-
147-
for feature in features {
148-
println!("Feature: {}", feature.name);
149-
150-
// Access data types
151-
for data_type in &feature.data_types {
152-
println!(" DataType: {}", data_type.identifier);
153-
}
154-
155-
// Access flow types
156-
for flow_type in &feature.flow_types {
157-
println!(" FlowType: {}", flow_type.identifier);
145+
match reader.read_features() {
146+
Ok(features) => {
147+
for feature in features {
148+
println!("Feature: {}", feature.name);
149+
150+
// Access data types
151+
for data_type in &feature.data_types {
152+
println!(" DataType: {}", data_type.identifier);
153+
}
154+
155+
// Access flow types
156+
for flow_type in &feature.flow_types {
157+
println!(" FlowType: {}", flow_type.identifier);
158+
}
159+
160+
// Access runtime functions
161+
for function in &feature.functions {
162+
println!(" Function: {}", function.runtime_name);
163+
}
164+
}
158165
}
159-
160-
// Access runtime functions
161-
for function in &feature.functions {
162-
println!(" Function: {}", function.runtime_name);
166+
Err(err) => {
167+
eprintln!("Failed to read features: {:?}", err);
163168
}
164169
}
165170
}

0 commit comments

Comments
 (0)