diff --git a/src/bits.rs b/src/bits.rs index e7b25b9..2e93345 100644 --- a/src/bits.rs +++ b/src/bits.rs @@ -835,7 +835,7 @@ pub fn encode_auto(data: &[u8], ec_level: ErrorCorrectionLevel) -> QrResult Vec { - let mut res = Vec::from_slice(data); - res.grow(ec_code_size, &0); + let mut res = data.to_vec(); + res.grow(ec_code_size, 0); let data_len = data.len(); let log_den = GENERATOR_POLYNOMIALS[ec_code_size];