//ww:run-exit 7 // Migrated from 700_e2e row 101. package main; import bytes; fn main() i32 = { let buf: [12]u8; buf[0] = 104u8; buf[1] = 101u8; buf[2] = 108u8; buf[3] = 108u8; buf[4] = 111u8; buf[5] = 44u8; buf[6] = 32u8; buf[7] = 119u8; buf[8] = 111u8; buf[9] = 114u8; buf[10] = 108u8; buf[11] = 100u8; let needle: [3]u8; needle[0] = 119u8; needle[1] = 111u8; needle[2] = 114u8; let r: (i32 | void) = bytes.index(buf[0:12], needle[0:3]); match (r) { case let i: i32 => return i; case void => return -1; }; return 0; };