From 599b637c73fbb1c2e729581652a6b4196e953ad3 Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Fri, 1 Oct 2021 18:04:48 +0000 Subject: [PATCH] Fixed example Rust code in documentation comments, due to commit 6c1f96789429. --- Readme.markdown | 4 ++-- rust/Readme.markdown | 4 ++-- rust/src/lib.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Readme.markdown b/Readme.markdown index a020a63..97c5cdc 100644 --- a/Readme.markdown +++ b/Readme.markdown @@ -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 = "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() { diff --git a/rust/Readme.markdown b/rust/Readme.markdown index d7d6702..b370632 100644 --- a/rust/Readme.markdown +++ b/rust/Readme.markdown @@ -47,8 +47,8 @@ Examples let svg = to_svg_string(&qr, 4); // See qrcodegen-demo // Manual operation - let chrs: Vec = "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() { diff --git a/rust/src/lib.rs b/rust/src/lib.rs index a89fe86..2afae46 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -72,8 +72,8 @@ //! Manual operation: //! //! ``` -//! let chrs: Vec = "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() {