Skip to content

Commit

Permalink
feat: do not use multi module project
Browse files Browse the repository at this point in the history
  • Loading branch information
mike committed Jul 22, 2024
1 parent 3e571e5 commit 698245f
Show file tree
Hide file tree
Showing 30 changed files with 39 additions and 71 deletions.
11 changes: 1 addition & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 25 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
[workspace]
members = [
"lib",
"cli",
]
resolver = "2"
[package]
name = "swiss-qr-bill-decoder"
version = "0.1.0"
edition = "2021"
publish = false
authors = ["Mike Schmid <[email protected]>"]
description = "A simple tool to decode QR codes of Swiss QR bills"

[lints.rust]
unsafe_code = "forbid"

[profile.release]
codegen-units = 1
lto = "fat"
strip = "symbols"
panic = "abort"
panic = "abort"

[dependencies]
clap = { version = "4.5.7", features = ["derive"] }
serde_json = "1.0.117"
rqrr = "0.7.1"
image = "0.25.1"
tempfile = "3.10.1"
serde = { version = "1.0.203", features = ["derive"] }

[dev-dependencies]
assert_cmd = "2.0.14"
predicates = "3.1.0"
indoc = "2.0.5"
assert-json-diff = "2.0.2"
21 changes: 0 additions & 21 deletions cli/Cargo.toml

This file was deleted.

20 changes: 0 additions & 20 deletions lib/Cargo.toml

This file was deleted.

File renamed without changes.
8 changes: 4 additions & 4 deletions lib/src/lib.rs → src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
//!
//! See [the standard definition](https://www.six-group.com/de/products-services/banking-services/payment-standardization/standards/qr-bill.html#ig-qr-bill-v2.3)
pub mod models;
mod pdf_converter;
mod qr_parser;

use crate::models::qr_data::QRData;
use image;
use rqrr::PreparedImage;
use tempfile::tempdir;

pub mod models;
mod pdf_converter;
mod qr_parser;

pub fn get_qr_bill_data(file_path: String, fail_on_error: bool) -> Vec<QRData> {
let tmp_dir = tempdir().expect("Error creating temporary directory");
let images = match file_path.as_str() {
Expand Down
5 changes: 3 additions & 2 deletions cli/src/main.rs → src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
//!
//! See [the standard definition](https://www.six-group.com/de/products-services/banking-services/payment-standardization/standards/qr-bill.html#ig-qr-bill-v2.3)
mod args;

use clap::Parser;
use swiss_qr_bill_decoder_lib::get_qr_bill_data;
mod args;
use swiss_qr_bill_decoder::get_qr_bill_data;

fn main() {
let args = args::Args::parse();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
7 changes: 3 additions & 4 deletions lib/tests/edge_cases.rs → tests/edge_cases.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use swiss_qr_bill_decoder_lib::get_qr_bill_data;
use swiss_qr_bill_decoder_lib::models::address::Address;
use swiss_qr_bill_decoder_lib::models::qr_data::QRData;

use swiss_qr_bill_decoder::get_qr_bill_data;
use swiss_qr_bill_decoder::models::address::Address;
use swiss_qr_bill_decoder::models::qr_data::QRData;

#[test]
fn minimal_png() {
Expand Down
6 changes: 3 additions & 3 deletions lib/tests/six_examples.rs → tests/six_examples.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use swiss_qr_bill_decoder_lib::get_qr_bill_data;
use swiss_qr_bill_decoder_lib::models::address::Address;
use swiss_qr_bill_decoder_lib::models::qr_data::QRData;
use swiss_qr_bill_decoder::get_qr_bill_data;
use swiss_qr_bill_decoder::models::address::Address;
use swiss_qr_bill_decoder::models::qr_data::QRData;

#[test]
fn six_example_01() {
Expand Down

0 comments on commit 698245f

Please sign in to comment.