pin: remove erroneous access to slice length (#56)

The slice itself has to be used instead
wch-ch32v003
Riccardo Binetti 2 years ago committed by GitHub
parent 5cf1a4612d
commit e202698a00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -28,7 +28,7 @@ pub fn Pin(comptime spec: []const u8) type {
chip.parsePin(spec); chip.parsePin(spec);
return struct { return struct {
pub const name = if (std.mem.startsWith(u8, spec, board_namespace.len)) pub const name = if (std.mem.startsWith(u8, spec, board_namespace))
// Remove the board: prefix // Remove the board: prefix
spec[board_namespace.len..] spec[board_namespace.len..]
else if (std.mem.startsWith(u8, spec, chip_namespace)) else if (std.mem.startsWith(u8, spec, chip_namespace))

Loading…
Cancel
Save