-
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Market data #258
Market data #258
Conversation
.collect::<Vec<String>>(); | ||
|
||
for (i, path) in paths.paths.iter().enumerate() { | ||
let ys = path.iter().cloned().collect::<Vec<f64>>(); |
Check warning
Code scanning / clippy
called iter().cloned().collect() on a slice to create a Vec. Calling to_vec() is both faster and more readable Warning
// Discount function that reduces value by 10%. | ||
let df = |date: Date| if date == now { 0.9 } else { 1.0 }; | ||
assert_approx_equal!(cf.npv(df), 90.0, EPS); | ||
assert_approx_equal!(cf.npv(0.9), 90.0, EPS); |
Check warning
Code scanning / clippy
usage of a legacy numeric constant Warning
use std::f64::EPSILON as EPS; | ||
use time::Duration; | ||
use time::OffsetDateTime; |
Check warning
Code scanning / clippy
unused import: time::OffsetDateTime Warning
let df = (-rate * (config.t_n - config.t_0)).exp(); | ||
|
||
out.paths.iter().fold(0.0, |acc, path| { | ||
let payoff = self.payoff(path.last().unwrap().clone()); |
Check warning
Code scanning / clippy
using clone on type f64 which implements the Copy trait Warning
let df = (-rate * (config.t_n - config.t_0)).exp(); | ||
|
||
out.paths.iter().fold(0.0, |acc, path| { | ||
let payoff = self.payoff(path.last().unwrap().clone()); |
Check warning
Code scanning / clippy
using clone on type f64 which implements the Copy trait Warning
P: Payoff, | ||
{ | ||
/// Function to prepare the data for the specific instrument. | ||
fn prepare_data(&self) -> (); |
Check warning
Code scanning / clippy
unneeded unit return type Warning
P: Payoff, | ||
{ | ||
/// Function to prepare the data for the specific instrument. | ||
fn prepare_data(&self) -> (); |
Check warning
Code scanning / clippy
unneeded unit return type Warning
No description provided.