Remove some calls to .as_slice()