hayden4r4 / blackscholes-rust

A Black-Scholes pricing model built in Rust
MIT License
11 stars 6 forks source link

Moving functions from common module to lib.rs #9

Closed day01 closed 3 months ago

day01 commented 3 months ago

This Pull Request involves moving functions from the common module directly into the lib.rs file. The aim of this change is to simplify the structure of our project and improve the readability of the code.

In project, the common module contained functions that were used by many other modules. However, upon reflection, these functions are fundamental enough to crate that they should be moved to lib.rs.

The lib.rs file in Rust is often used as a place where types and functions that are common to the entire crate are defined. Therefore, moving the functions from common.rs to lib.rs aligns with this convention and makes code more understandable to other Rust developers.

Additionally, moving these functions to lib.rs eliminates the need for an additional module and simplifies our directory structure. This also means that fewer imports are needed in other files, further simplifying our code. As part of this PR, I have also updated all references to functions from common.rs in other parts of code.

Also one test is added, based on https://github.com/hayden4r4/blackscholes-rust/issues/8 , rest of tests will be added after decision of correct behaviour.