| 1 | //! Creates the default empty `QRCode` (no data) |
| 2 | #![deny(unsafe_code)] |
| 3 | #![warn(missing_docs)] |
| 4 | |
| 5 | use craterust-analyzer cargo fast_qr 0.13.1 crate/::datamaskingrust-analyzer cargo fast_qr 0.13.1 datamasking/::Maskrust-analyzer cargo fast_qr 0.13.1 datamasking/Mask#; |
| 6 | use craterust-analyzer cargo fast_qr 0.13.1 crate/::modulerust-analyzer cargo fast_qr 0.13.1 module/::Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#; |
| 7 | use craterust-analyzer cargo fast_qr 0.13.1 crate/::versionrust-analyzer cargo fast_qr 0.13.1 version/::Versionrust-analyzer cargo fast_qr 0.13.1 version/Version#; |
| 8 | use craterust-analyzer cargo fast_qr 0.13.1 crate/::{hardcoderust-analyzer cargo fast_qr 0.13.1 hardcode/, QRCoderust-analyzer cargo fast_qr 0.13.1 qr/QRCode#, ECLrust-analyzer cargo fast_qr 0.13.1 ecl/ECL#}; |
| 9 | |
| 10 | /// Size of FIP (Finder Patterns) |
| 11 | const POSITION_SIZErust-analyzer cargo fast_qr 0.13.1 default/POSITION_SIZE.: usize = 7; |
| 12 | |
| 13 | pub fn transposerust-analyzer cargo fast_qr 0.13.1 default/transpose().(qr: &QRCoderust-analyzer cargo fast_qr 0.13.1 qr/QRCode#) -> QRCoderust-analyzer cargo fast_qr 0.13.1 qr/QRCode# { |
| 14 | let mut transpose = qr.clonerust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][Clone]clone().(); |
| 15 | |
| 16 | for i in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#qr.sizerust-analyzer cargo fast_qr 0.13.1 qr/QRCode#size. { |
| 17 | for j in i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#qr.sizerust-analyzer cargo fast_qr 0.13.1 qr/QRCode#size. { |
| 18 | transpose[rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().i]rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().j]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().j]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`Index<I>`]index().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`Index<I>`]index().; |
| 19 | transpose[rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().j]rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`Index<I>`]index().j]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`Index<I>`]index().; |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | transpose |
| 24 | } |
| 25 | |
| 26 | pub fn create_matrixrust-analyzer cargo fast_qr 0.13.1 default/create_matrix().(version: Versionrust-analyzer cargo fast_qr 0.13.1 version/Version#) -> QRCoderust-analyzer cargo fast_qr 0.13.1 qr/QRCode# { |
| 27 | let size = version.sizerust-analyzer cargo fast_qr 0.13.1 version/impl#[Version]size().(); |
| 28 | let mut qr = QRCoderust-analyzer cargo fast_qr 0.13.1 qr/QRCode#::defaultrust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode]default().(size); |
| 29 | |
| 30 | create_matrix_patternrust-analyzer cargo fast_qr 0.13.1 default/create_matrix_pattern().(&mut qr); |
| 31 | create_matrix_timingrust-analyzer cargo fast_qr 0.13.1 default/create_matrix_timing().(&mut qr); |
| 32 | create_matrix_dark_modulerust-analyzer cargo fast_qr 0.13.1 default/create_matrix_dark_module().(&mut qr); |
| 33 | create_matrix_alignmentsrust-analyzer cargo fast_qr 0.13.1 default/create_matrix_alignments().(&mut qr, version); |
| 34 | create_matrix_version_inforust-analyzer cargo fast_qr 0.13.1 default/create_matrix_version_info().(&mut qr, version); |
| 35 | create_matrix_emptyrust-analyzer cargo fast_qr 0.13.1 default/create_matrix_empty().(&mut qr); |
| 36 | |
| 37 | let n: usize = qr.sizerust-analyzer cargo fast_qr 0.13.1 qr/QRCode#size.; |
| 38 | |
| 39 | // Format information is not placed on the matrix yet |
| 40 | // But we fill it anyway with garbage data to make it easier for placement |
| 41 | { |
| 42 | if (version as usize) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().(Versionrust-analyzer cargo fast_qr 0.13.1 version/Version#::V01rust-analyzer cargo fast_qr 0.13.1 version/Version#V01# as usize) { |
| 43 | return qr; |
| 44 | } |
| 45 | |
| 46 | for i in 0..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#5 { |
| 47 | // Top left |
| 48 | qr[rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().8]rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 49 | qr[rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().i]rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 50 | |
| 51 | // Top right |
| 52 | qr[rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().8]rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 53 | |
| 54 | // Bottom left |
| 55 | qr[rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().i]rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 56 | } |
| 57 | |
| 58 | // Top left |
| 59 | qr[rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().8]rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().7]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 60 | qr[rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().8]rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 61 | qr[rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().7]rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 62 | |
| 63 | // Top right |
| 64 | qr[rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().8]rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().6]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 65 | qr[rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().8]rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().7]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 66 | |
| 67 | // Bottom left |
| 68 | qr[rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().6]rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 69 | } |
| 70 | |
| 71 | qr |
| 72 | } |
| 73 | |
| 74 | /// Adds the 3 needed squares |
| 75 | pub fn create_matrix_patternrust-analyzer cargo fast_qr 0.13.1 default/create_matrix_pattern().(qr: &mut QRCoderust-analyzer cargo fast_qr 0.13.1 qr/QRCode#) { |
| 76 | let length = qr.sizerust-analyzer cargo fast_qr 0.13.1 qr/QRCode#size.; |
| 77 | let offsets = [ |
| 78 | (0, 0), |
| 79 | (length rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().POSITION_SIZErust-analyzer cargo fast_qr 0.13.1 default/POSITION_SIZE., 0), |
| 80 | (0, length rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().POSITION_SIZErust-analyzer cargo fast_qr 0.13.1 default/POSITION_SIZE.), |
| 81 | ]; |
| 82 | |
| 83 | // Required pattern (4.1 Positions) |
| 84 | for (y, x) in offsets { |
| 85 | // Border |
| 86 | for j in 0..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#6 { |
| 87 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().y]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().x]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::finder_patternrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]finder_pattern().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::DARKrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]DARK.); |
| 88 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().6 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().y]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().x]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::finder_patternrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]finder_pattern().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::DARKrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]DARK.); |
| 89 | |
| 90 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().y]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().x]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::finder_patternrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]finder_pattern().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::DARKrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]DARK.); |
| 91 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().y]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().6 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().x]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::finder_patternrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]finder_pattern().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::DARKrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]DARK.); |
| 92 | } |
| 93 | |
| 94 | for j in 1..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#5 { |
| 95 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().x]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::finder_patternrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]finder_pattern().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 96 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().5 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().y]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().x]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::finder_patternrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]finder_pattern().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 97 | |
| 98 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().y]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::finder_patternrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]finder_pattern().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 99 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().y]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().5 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().x]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::finder_patternrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]finder_pattern().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 100 | } |
| 101 | |
| 102 | for j in 2..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#4 { |
| 103 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().y]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().x]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::finder_patternrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]finder_pattern().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::DARKrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]DARK.); |
| 104 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().y]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().3 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().x]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::finder_patternrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]finder_pattern().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::DARKrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]DARK.); |
| 105 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().y]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().4 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().x]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::finder_patternrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]finder_pattern().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::DARKrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]DARK.); |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | /// Adds the two lines of Timing patterns |
| 111 | pub fn create_matrix_timingrust-analyzer cargo fast_qr 0.13.1 default/create_matrix_timing().(qr: &mut QRCoderust-analyzer cargo fast_qr 0.13.1 qr/QRCode#) { |
| 112 | let length = qr.sizerust-analyzer cargo fast_qr 0.13.1 qr/QRCode#size.; |
| 113 | // Required pattern (4.3 Timing) |
| 114 | for i in POSITION_SIZErust-analyzer cargo fast_qr 0.13.1 default/POSITION_SIZE. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#length rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().POSITION_SIZErust-analyzer cargo fast_qr 0.13.1 default/POSITION_SIZE. { |
| 115 | let value = if (POSITION_SIZErust-analyzer cargo fast_qr 0.13.1 default/POSITION_SIZE. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem().%rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem().2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem().%rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem().2 { |
| 116 | Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::DARKrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]DARK. |
| 117 | } else { |
| 118 | Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT. |
| 119 | }; |
| 120 | |
| 121 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().POSITION_SIZErust-analyzer cargo fast_qr 0.13.1 default/POSITION_SIZE. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::timingrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]timing().(value); |
| 122 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().POSITION_SIZErust-analyzer cargo fast_qr 0.13.1 default/POSITION_SIZE. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::timingrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]timing().(value); |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | /// Adds the forever present pixel |
| 127 | pub fn create_matrix_dark_modulerust-analyzer cargo fast_qr 0.13.1 default/create_matrix_dark_module().(qr: &mut QRCoderust-analyzer cargo fast_qr 0.13.1 qr/QRCode#) { |
| 128 | // Dark module |
| 129 | let n: usize = qr.sizerust-analyzer cargo fast_qr 0.13.1 qr/QRCode#size.; |
| 130 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::darkrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]dark().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::DARKrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]DARK.); |
| 131 | } |
| 132 | |
| 133 | /// Adds the smaller squares if needed |
| 134 | pub fn create_matrix_alignmentsrust-analyzer cargo fast_qr 0.13.1 default/create_matrix_alignments().(qr: &mut QRCoderust-analyzer cargo fast_qr 0.13.1 qr/QRCode#, version: Versionrust-analyzer cargo fast_qr 0.13.1 version/Version#) { |
| 135 | if let Versionrust-analyzer cargo fast_qr 0.13.1 version/Version#::V01rust-analyzer cargo fast_qr 0.13.1 version/Version#V01# = version { |
| 136 | return; |
| 137 | } |
| 138 | |
| 139 | // Alignments (smaller cubes) |
| 140 | let alignment_patterns = version.alignment_patterns_gridrust-analyzer cargo fast_qr 0.13.1 version/impl#[Version]alignment_patterns_grid().(); |
| 141 | let max = alignment_patterns.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1; |
| 142 | |
| 143 | for (i, &alignment_y) in alignment_patterns.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().() { |
| 144 | for (j, &alignment_x) in alignment_patterns.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().() { |
| 145 | if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().0 && (j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().max || j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().0) || (i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().max && j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().0) { |
| 146 | continue; |
| 147 | } |
| 148 | |
| 149 | let y = alignment_y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().2; |
| 150 | let x = alignment_x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().2; |
| 151 | |
| 152 | for offset in 0..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#4 { |
| 153 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().y]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().offset]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::alignmentrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]alignment().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::DARKrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]DARK.); |
| 154 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().4]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().offset]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::alignmentrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]alignment().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::DARKrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]DARK.); |
| 155 | |
| 156 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().offset]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().x]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::alignmentrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]alignment().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::DARKrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]DARK.); |
| 157 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().offset]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().4]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::alignmentrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]alignment().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::DARKrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]DARK.); |
| 158 | } |
| 159 | |
| 160 | let y = alignment_y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1; |
| 161 | let x = alignment_x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1; |
| 162 | |
| 163 | for offset in 0..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#2 { |
| 164 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().y]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().offset]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::alignmentrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]alignment().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 165 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().offset]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::alignmentrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]alignment().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 166 | |
| 167 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().offset]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().x]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::alignmentrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]alignment().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 168 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().offset]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::alignmentrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]alignment().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 169 | } |
| 170 | |
| 171 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().alignment_y]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().alignment_x]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::alignmentrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]alignment().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::DARKrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]DARK.); |
| 172 | } |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | /// Adds the version information if needed |
| 177 | pub fn create_matrix_version_inforust-analyzer cargo fast_qr 0.13.1 default/create_matrix_version_info().(qr: &mut QRCoderust-analyzer cargo fast_qr 0.13.1 qr/QRCode#, version: Versionrust-analyzer cargo fast_qr 0.13.1 version/Version#) { |
| 178 | if (version as usize) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().(Versionrust-analyzer cargo fast_qr 0.13.1 version/Version#::V07rust-analyzer cargo fast_qr 0.13.1 version/Version#V07# as usize) { |
| 179 | return; |
| 180 | } |
| 181 | |
| 182 | let version_info = version.informationrust-analyzer cargo fast_qr 0.13.1 version/impl#[Version]information().(); |
| 183 | |
| 184 | let n: usize = qr.sizerust-analyzer cargo fast_qr 0.13.1 qr/QRCode#size.; |
| 185 | |
| 186 | for i in 0..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#2 { |
| 187 | for j in 0..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#5 { |
| 188 | let shift_i = 2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().i; |
| 189 | let shift_j = 5 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().j; |
| 190 | let shift: u32 = 1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shl<usize>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shl<usize>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shl<usize>`]shl().((5 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().shift_j) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().3 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().(2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().shift_i)); |
| 191 | |
| 192 | let value = (version_info rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().shift) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().0; |
| 193 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().j]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().11 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::versionrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]version().(value); |
| 194 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().11 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().j]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::versionrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]version().(value); |
| 195 | } |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | /// Adds the format information if needed |
| 200 | pub fn create_matrix_format_inforust-analyzer cargo fast_qr 0.13.1 default/create_matrix_format_info().(qr: &mut QRCoderust-analyzer cargo fast_qr 0.13.1 qr/QRCode#, quality: ECLrust-analyzer cargo fast_qr 0.13.1 ecl/ECL#, mask: Maskrust-analyzer cargo fast_qr 0.13.1 datamasking/Mask#) { |
| 201 | let format_info = hardcoderust-analyzer cargo fast_qr 0.13.1 hardcode/::ecm_to_format_informationrust-analyzer cargo fast_qr 0.13.1 hardcode/ecm_to_format_information().(quality, mask); |
| 202 | |
| 203 | let n: usize = qr.sizerust-analyzer cargo fast_qr 0.13.1 qr/QRCode#size.; |
| 204 | |
| 205 | for i in (0..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#5).revrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#rev().() { |
| 206 | let shift = 1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<usize>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<usize>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<usize>`]shl().(i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().9); |
| 207 | let value = (format_info rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().shift) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0; |
| 208 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().5 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(value); |
| 209 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().6 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(value); |
| 210 | } |
| 211 | |
| 212 | for i in 0..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#5 { |
| 213 | let shift = 1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<usize>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<usize>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<usize>`]shl().i; |
| 214 | let value = (format_info rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().shift) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0; |
| 215 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(value); |
| 216 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(value); |
| 217 | } |
| 218 | |
| 219 | { |
| 220 | let shift = 1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<i32>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<i32>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<i32>`]shl().8; |
| 221 | let value = (format_info rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().shift) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0; |
| 222 | // Six on left |
| 223 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().7]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(value); |
| 224 | // Six on bottom |
| 225 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().7]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(value); |
| 226 | } |
| 227 | { |
| 228 | let shift = 1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<i32>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<i32>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<i32>`]shl().7; |
| 229 | let value = (format_info rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().shift) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0; |
| 230 | // Seven on left |
| 231 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(value); |
| 232 | // Seven on right |
| 233 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(value); |
| 234 | } |
| 235 | { |
| 236 | let shift = 1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<i32>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<i32>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shl<i32>`]shl().6; |
| 237 | let value = (format_info rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().shift) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().0; |
| 238 | // Height on left |
| 239 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().7]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(value); |
| 240 | // Height on right |
| 241 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().7]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::formatrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]format().(value); |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | /// Adds the space between finder patterns and data |
| 246 | fn create_matrix_emptyrust-analyzer cargo fast_qr 0.13.1 default/create_matrix_empty().(qr: &mut QRCoderust-analyzer cargo fast_qr 0.13.1 qr/QRCode#) { |
| 247 | let n: usize = qr.sizerust-analyzer cargo fast_qr 0.13.1 qr/QRCode#size.; |
| 248 | |
| 249 | for i in 0..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#7 { |
| 250 | // Top left |
| 251 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().7]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::emptyrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]empty().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 252 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().7]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::emptyrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]empty().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 253 | |
| 254 | // Bottom left |
| 255 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().8 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().7]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::emptyrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]empty().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 256 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::emptyrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]empty().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 257 | |
| 258 | // Top right |
| 259 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::emptyrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]empty().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 260 | qr[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().7]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().8 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut(). = Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::emptyrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]empty().(Modulerust-analyzer cargo fast_qr 0.13.1 module/Module#::LIGHTrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]LIGHT.); |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | #[cfg(test)] |
| 265 | pub fn create_mat_from_boolrust-analyzer cargo fast_qr 0.13.1 default/create_mat_from_bool().<const N: usize>(bool_mat: &[[bool; N]; N]) -> QRCoderust-analyzer cargo fast_qr 0.13.1 qr/QRCode# { |
| 266 | let mut mat = create_matrixrust-analyzer cargo fast_qr 0.13.1 default/create_matrix().(Versionrust-analyzer cargo fast_qr 0.13.1 version/Version#::from_nrust-analyzer cargo fast_qr 0.13.1 version/impl#[Version]from_n().(N)); |
| 267 | |
| 268 | for (i, row) in bool_mat.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().() { |
| 269 | for (j, &value) in row.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().() { |
| 270 | mat[rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().i]rust-analyzer cargo fast_qr 0.13.1 qr/impl#[QRCode][`IndexMut<usize>`]index_mut().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut().j]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`IndexMut<I>`]index_mut()..setrust-analyzer cargo fast_qr 0.13.1 module/impl#[Module]set().(value); |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | mat |
| 275 | } |