Changed a top-level Rust function to take &str instead of &[char].

pull/16/head
Project Nayuki 7 years ago
parent dd9d822950
commit 8b9caed527

@ -52,8 +52,9 @@ pub struct QrCode {
impl QrCode {
pub fn encode_text(text: &[char], ecl: &'static QrCodeEcc) -> QrCode {
let segs: Vec<QrSegment> = QrSegment::make_segments(text);
pub fn encode_text(text: &str, ecl: &'static QrCodeEcc) -> QrCode {
let chrs: Vec<char> = text.chars().collect();
let segs: Vec<QrSegment> = QrSegment::make_segments(&chrs);
QrCode::encode_segments(&segs, ecl)
}

Loading…
Cancel
Save