// The error this gives is: // // error: expected optional type, found '@typeOf(std.fmt.bufPrint).ReturnType.ErrorSet![]u8' // if (std.fmt.bufPrint(buf[0..], "test: {}", usize(32))) |s| { // ^ const std = @import("std"); const warn = std.debug.warn; pub fn main() void { var buf: [32]u8 = undefined; if (std.fmt.bufPrint(buf[0..], "test: {}", usize(32))) |s| { warn("s is '{}'\n", s); } else { // Note the error is not handled. warn("failed\n"); } }