Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions src/pdfparser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Dividends,
Sold,
Tax,
Trade,

Check warning on line 23 in src/pdfparser.rs

View workflow job for this annotation

GitHub Actions / coverage

variant `Trade` is never constructed
}

#[derive(Debug, PartialEq)]
Expand All @@ -37,7 +37,7 @@
fn getf32(&self) -> Option<f32> {
None
}
fn geti32(&self) -> Option<i32> {

Check warning on line 40 in src/pdfparser.rs

View workflow job for this annotation

GitHub Actions / coverage

methods `geti32` and `getdate` are never used
None
}

Expand Down Expand Up @@ -79,7 +79,7 @@
}
}

struct I32Entry {

Check warning on line 82 in src/pdfparser.rs

View workflow job for this annotation

GitHub Actions / coverage

struct `I32Entry` is never constructed
pub val: i32,
}

Expand All @@ -99,7 +99,7 @@
}
}

struct DateEntry {

Check warning on line 102 in src/pdfparser.rs

View workflow job for this annotation

GitHub Actions / coverage

struct `DateEntry` is never constructed
pub val: String,
}

Expand Down Expand Up @@ -143,7 +143,7 @@
}
}

fn create_dividend_parsing_sequence(sequence: &mut std::collections::VecDeque<Box<dyn Entry>>) {

Check warning on line 146 in src/pdfparser.rs

View workflow job for this annotation

GitHub Actions / coverage

function `create_dividend_parsing_sequence` is never used
sequence.push_back(Box::new(StringEntry {
val: String::new(),
patterns: vec!["INTC".to_owned(), "DLB".to_owned()],
Expand All @@ -159,6 +159,7 @@
"TREASURY LIQUIDITY FUND".to_owned(),
"INTEL CORP".to_owned(),
"ADVANCED MICRO DEVICES".to_owned(),
"DYNATRACE INC".to_owned(),
],
}));
sequence.push_back(Box::new(F32Entry { val: 0.0 })); // Tax Entry
Expand Down Expand Up @@ -226,20 +227,14 @@
sequence.push_back(Box::new(F32Entry { val: 0.0 })); // Income Entry
}

fn create_sold_parsing_sequence(sequence: &mut std::collections::VecDeque<Box<dyn Entry>>) {
sequence.push_back(Box::new(StringEntry {
val: String::new(),
patterns: vec!["INTC".to_owned(), "DLB".to_owned()],
})); // INTC, DLB
sequence.push_back(Box::new(F32Entry { val: 0.0 })); // Quantity
sequence.push_back(Box::new(F32Entry { val: 0.0 })); // Price
sequence.push_back(Box::new(F32Entry { val: 0.0 })); // Amount Sold
}

fn create_sold_2_parsing_sequence(sequence: &mut std::collections::VecDeque<Box<dyn Entry>>) {
sequence.push_back(Box::new(StringEntry {
val: String::new(),
patterns: vec!["INTEL CORP".to_owned(), "ADVANCED MICRO DEVICES".to_owned()],
patterns: vec![
"INTEL CORP".to_owned(),
"ADVANCED MICRO DEVICES".to_owned(),
"DYNATRACE INC".to_owned(),
],
}));
sequence.push_back(Box::new(StringEntry {
val: String::new(),
Expand All @@ -254,7 +249,7 @@
sequence.push_back(Box::new(F32Entry { val: 0.0 })); // Amount Sold
}

fn create_trade_parsing_sequence(sequence: &mut std::collections::VecDeque<Box<dyn Entry>>) {

Check warning on line 252 in src/pdfparser.rs

View workflow job for this annotation

GitHub Actions / coverage

function `create_trade_parsing_sequence` is never used
sequence.push_back(Box::new(DateEntry { val: String::new() })); // Trade date
sequence.push_back(Box::new(DateEntry { val: String::new() })); // Settlement date
sequence.push_back(Box::new(I32Entry { val: 0 })); // MKT /
Expand Down Expand Up @@ -490,6 +485,7 @@
"TREASURY LIQUIDITY FUND".to_owned(),
"INTEL CORP".to_owned(),
"ADVANCED MICRO DEVICES".to_owned(),
"DYNATRACE INC".to_owned(),
"INTEREST ADJUSTMENT".to_owned(),
];
if obj.is_pattern() == true {
Expand All @@ -514,7 +510,7 @@
let mut transaction = processed_sequence.iter();
match transaction_type {
TransactionType::Tax => {
let symbol = transaction

Check warning on line 513 in src/pdfparser.rs

View workflow job for this annotation

GitHub Actions / coverage

unused variable: `symbol`
.next()
.unwrap()
.getstring()
Expand Down
Loading