Update for latest rustc

vec.as_imm_buf and str.as_imm_buf are no more. The replacement is
.as_ptr() and .len().