Skip to content

Merge VIN branch#8

Merged
provrb merged 20 commits intomainfrom
vin
May 16, 2025
Merged

Merge VIN branch#8
provrb merged 20 commits intomainfrom
vin

Conversation

@provrb
Copy link
Owner

@provrb provrb commented May 16, 2025

VIN branch is ready to be merged to main. Very detailed pull request message.

provrb added 20 commits May 11, 2025 18:50
feat: optimization, tests, vehicle information methods, QOL

Optimization:
initially, the VIN key component would always have be recreated
with every call to a vehicle information method. the as_key() method
has been optimized and a key_cache field has been added to VIN using
OnceCell. this allowed us to have the key as a &str and quickly pass it
to other functions.

Features:
add several new vehicle information retrieval methods to VIN.

OQL:
a new method 'vpic_connection()' has been added to ease of use. previously,
everytime a reference for the sqlite::Connection needed to be stored,
a match statement would always match self.vpic_db_con with Ok mapping Err
to VinError::VPICNoConnection. instead, a simple call to vpic_connection will
return a Result<&sqlite::Connection, VinError> and returns self.vpic_db_con as_ref.

the VIN constructor, 'new()' has been changed to accept &str. instead of having
the user convert the parameters to a String manuaully, it does this automatically
in the new() method using Into<>.

Tests:
added tests for cylinder_count, engine_model. also modified GitHub workflow
to download the sqlite database from GitHub lfs when running cargo test to stop the workflows
from failing.

ran and appended all changes from cargo clippy.
@provrb provrb merged commit 379f414 into main May 16, 2025
0 of 2 checks passed
@provrb provrb mentioned this pull request May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant