Fixed example Rust code in documentation comments, due to commit 6c1f967894.

pull/134/head
Project Nayuki 3 years ago
parent df548a379d
commit 599b637c73

@ -172,8 +172,8 @@ let qr = QrCode::encode_text("Hello, world!",
let svg = to_svg_string(&qr, 4); // See qrcodegen-demo
// Manual operation
let chrs: Vec<char> = "3141592653589793238462643383".chars().collect();
let segs = QrSegment::make_segments(&chrs);
let text: &str = "3141592653589793238462643383";
let segs = QrSegment::make_segments(text);
let qr = QrCode::encode_segments_advanced(
&segs, QrCodeEcc::High, 5, 5, Some(Mask::new(2)), false).unwrap();
for y in 0 .. qr.size() {

@ -47,8 +47,8 @@ Examples
let svg = to_svg_string(&qr, 4); // See qrcodegen-demo
// Manual operation
let chrs: Vec<char> = "3141592653589793238462643383".chars().collect();
let segs = QrSegment::make_segments(&chrs);
let text: &str = "3141592653589793238462643383";
let segs = QrSegment::make_segments(text);
let qr = QrCode::encode_segments_advanced(&segs, QrCodeEcc::High,
Version::new(5), Version::new(5), Some(Mask::new(2)), false).unwrap();
for y in 0 .. qr.size() {

@ -72,8 +72,8 @@
//! Manual operation:
//!
//! ```
//! let chrs: Vec<char> = "3141592653589793238462643383".chars().collect();
//! let segs = QrSegment::make_segments(&chrs);
//! let text: &str = "3141592653589793238462643383";
//! let segs = QrSegment::make_segments(text);
//! let qr = QrCode::encode_segments_advanced(&segs, QrCodeEcc::High,
//! Version::new(5), Version::new(5), Some(Mask::new(2)), false).unwrap();
//! for y in 0 .. qr.size() {

Loading…
Cancel
Save