You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to make a QR for a file shared in Google drive, it gave me the below error:
C:\Users\hasan.DESKTOP-HU2FQ29\IdeaProjects\QR>cargo run
Compiling QR v0.1.0 (C:\Users\hasan.DESKTOP-HU2FQ29\IdeaProjects\QR)
error[E0432]: unresolved import `image`
--> src\main.rs:2:5
|
2 | use image::Luma;| ^^^^^ help: a similar path exists: `qrcode::image`
error[E0277]: arrays only have std trait implementations for lengths 0..=32
--> src\main.rs:6:28
|
6 |let code = QrCode::new(b"https://drive.google.com/file/d/1K1AWqKrC4ZOgw7I0ToqbTz_b6-Leq4F2/view").unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for`[u8; 70]`|
::: C:\Users\hasan.DESKTOP-HU2FQ29\.cargo\registry\src\github.com-1ecc6299db9ec823\qrcode-0.11.0\src\lib.rs:86:19
|
86 | pub fn new<D: AsRef<[u8]>>(data: D) -> QrResult<Self> {
| ----------- required by this bound in`qrcode::QrCode::new`|
= note: required because of the requirements on the impl of `std::convert::AsRef<[u8]>`for`[u8; 70]`
= note: required because of the requirements on the impl of `std::convert::AsRef<[u8]>`for`&[u8; 70]`
my code is simply:
use qrcode::QrCode;use image::Luma;fnmain(){// Encode some data into bits.let code = QrCode::new(b"https://drive.google.com/file/d/1K1AWqKrC4ZOgw7I0ToqbTz_b6-Leq4F2/view").unwrap();// Render the bits into an image.let image = code.render::<Luma<u8>>().build();// Save the image.
image.save("/tmp/qrcode.png").unwrap();}
The text was updated successfully, but these errors were encountered:
I wanted to make a QR for a file shared in Google drive, it gave me the below error:
my code is simply:
The text was updated successfully, but these errors were encountered: