Changed a top-level Rust function to take &str instead of &[char].
This commit is contained in:
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…
Reference in New Issue