feat: add fast-qr

This commit is contained in:
2022-11-20 20:36:56 +08:00
parent 3a4d6b2d62
commit 8979029e29
4 changed files with 163 additions and 1 deletions

15
__misc/fastqr/src/main.rs Normal file
View File

@@ -0,0 +1,15 @@
use fast_qr::convert::ConvertError;
use fast_qr::qr::QRBuilder;
fn main() -> Result<(), ConvertError> {
// QRBuilder::new can fail if content is too big for version,
// please check before unwrapping.
let qrcode = QRBuilder::new("https://example.com/".into())
.build()
.unwrap();
let str = qrcode.to_str(); // .print() exists
println!("{}", str);
Ok(())
}