Skip to content

Commit

Permalink
Fix issue with no specified payees
Browse files Browse the repository at this point in the history
  • Loading branch information
frosklis committed Feb 27, 2021
1 parent fa6b7d8 commit a437f66
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
Changelog file for dinero-rs project, a command line application for managing finances.

## [0.13.1] - 2021-02-27
### Fixed
- Fixed issue when there is no specified payee
## [0.13.0] - 2021-02-27
### Added
- Improved documentation
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dinero-rs"
version = "0.13.0"
version = "0.13.1"
authors = ["Claudio Noguera <[email protected]>"]
edition = "2018"
readme = "README.md"
Expand Down
8 changes: 6 additions & 2 deletions src/parser/tokenizers/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ fn parse_with_grammar(tokenizer: &mut Tokenizer) -> Result<Transaction<RawPostin
}
}

if transaction.payee.is_none() & (transaction.description.len() > 0) {
transaction.payee = Some(transaction.description.clone());
if transaction.payee.is_none() {
if transaction.description.len() > 0 {
transaction.payee = Some(transaction.description.clone());
} else {
transaction.payee = Some("[Unspecified payee]".to_string())
}
}
// Have a flag so that it can be known whether a comment belongs to the transaction or to the
// posting
Expand Down

0 comments on commit a437f66

Please sign in to comment.