Skip to content

Commit 7b2ca71

Browse files
committed
Fix syntax errors in safety_demo.ks
1 parent 2130428 commit 7b2ca71

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

examples/safety_demo.ks

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,17 @@ fn array_validation_demo(ctx: *xdp_md) -> xdp_action {
117117
var result: xdp_action = XDP_PASS
118118

119119
// Call safe functions
120-
var _ = safe_function(ctx)
121-
var _ = bounds_demo(ctx)
122-
var _ = moderate_stack_usage(ctx)
120+
safe_function(ctx)
121+
bounds_demo(ctx)
122+
moderate_stack_usage(ctx)
123123

124124
// The following call would trigger warnings:
125125
// let _ = large_stack_usage(ctx) // Stack overflow warning
126126

127127
// Safe map access
128128
var key: u32 = 1
129129
var count = packet_stats[key]
130-
if (count != null) {
130+
if (count != none) {
131131
packet_stats[key] = count + 1
132132
} else {
133133
packet_stats[key] = 1

0 commit comments

Comments
 (0)