- Full clippy output files (errors, warnings, results) - Analysis scripts for processing clippy warnings - Support files for Agent 10 clippy analysis
56414 lines
2.3 MiB
56414 lines
2.3 MiB
warning: the MSRV in `clippy.toml` and `Cargo.toml` differ; using `1.85.0` from `clippy.toml`
|
|
|
|
warning: `config` (lib) generated 1 warning
|
|
Checking trading_engine v1.0.0 (/home/jgrusewski/Work/foxhunt/trading_engine)
|
|
warning: accessing first element with `parts.get(0)`
|
|
--> storage/src/model_helpers.rs:326:28
|
|
|
|
|
326 | if parts.len() >= 3 && parts.get(0)? == &"models" {
|
|
| ^^^^^^^^^^^^ help: try: `parts.first()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
|
|
= note: `-W clippy::get-first` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::get_first)]`
|
|
|
|
warning: `storage` (lib) generated 1 warning (run `cargo clippy --fix --lib -p storage` to apply 1 suggestion)
|
|
Checking adaptive-strategy v1.0.0 (/home/jgrusewski/Work/foxhunt/adaptive-strategy)
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/executions.rs:332:21
|
|
|
|
|
332 | let query = r#"
|
|
| _____________________^
|
|
333 | | SELECT id, order_id, symbol, quantity, price, side, fees, fee_currency,
|
|
334 | | executed_at, timestamp, symbol_hash, broker_execution_id, counterparty, venue,
|
|
335 | | gross_value, net_value
|
|
336 | | FROM executions WHERE id = $1
|
|
337 | | "#;
|
|
| |__________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
note: the lint level is defined here
|
|
--> trading-data/src/lib.rs:36:9
|
|
|
|
|
36 | #![warn(clippy::pedantic)]
|
|
| ^^^^^^^^^^^^^^^^
|
|
= note: `#[warn(clippy::needless_raw_string_hashes)]` implied by `#[warn(clippy::pedantic)]`
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
332 ~ let query = r"
|
|
333 | SELECT id, order_id, symbol, quantity, price, side, fees, fee_currency,
|
|
...
|
|
336 | FROM executions WHERE id = $1
|
|
337 ~ ";
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/executions.rs:371:21
|
|
|
|
|
371 | let query = r#"
|
|
| _____________________^
|
|
372 | | INSERT INTO executions (id, order_id, symbol, quantity, price, side, fees, fee_currency,
|
|
373 | | executed_at, timestamp, symbol_hash, broker_execution_id, counterparty, venue,
|
|
374 | | gross_value, net_value)
|
|
... |
|
|
382 | | RETURNING *
|
|
383 | | "#;
|
|
| |__________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
371 ~ let query = r"
|
|
372 | INSERT INTO executions (id, order_id, symbol, quantity, price, side, fees, fee_currency,
|
|
...
|
|
382 | RETURNING *
|
|
383 ~ ";
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/executions.rs:448:25
|
|
|
|
|
448 | let mut query = r#"
|
|
| _________________________^
|
|
449 | | SELECT id, order_id, symbol, quantity, price, side, fees, fee_currency,
|
|
450 | | executed_at, timestamp, symbol_hash, broker_execution_id, counterparty, venue,
|
|
451 | | gross_value, net_value
|
|
452 | | FROM executions
|
|
453 | | "#
|
|
| |__________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
448 ~ let mut query = r"
|
|
449 | SELECT id, order_id, symbol, quantity, price, side, fees, fee_currency,
|
|
...
|
|
452 | FROM executions
|
|
453 ~ "
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/executions.rs:487:13
|
|
|
|
|
487 | / r#"
|
|
488 | | SELECT id, order_id, symbol, quantity, price, side, fees, fee_currency,
|
|
489 | | executed_at, timestamp, symbol_hash, broker_execution_id, counterparty, venue
|
|
490 | | FROM executions WHERE symbol = $1 ORDER BY executed_at DESC
|
|
491 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
487 ~ r"
|
|
488 | SELECT id, order_id, symbol, quantity, price, side, fees, fee_currency,
|
|
489 | executed_at, timestamp, symbol_hash, broker_execution_id, counterparty, venue
|
|
490 | FROM executions WHERE symbol = $1 ORDER BY executed_at DESC
|
|
491 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/executions.rs:502:13
|
|
|
|
|
502 | / r#"
|
|
503 | | SELECT id, order_id, symbol, quantity, price, side, fees, fee_currency,
|
|
504 | | executed_at, timestamp, symbol_hash, broker_execution_id, counterparty, venue
|
|
505 | | FROM executions WHERE order_id = $1 ORDER BY executed_at ASC
|
|
506 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
502 ~ r"
|
|
503 | SELECT id, order_id, symbol, quantity, price, side, fees, fee_currency,
|
|
504 | executed_at, timestamp, symbol_hash, broker_execution_id, counterparty, venue
|
|
505 | FROM executions WHERE order_id = $1 ORDER BY executed_at ASC
|
|
506 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/executions.rs:517:13
|
|
|
|
|
517 | / r#"
|
|
518 | | SELECT id, order_id, symbol, quantity, price, side, fees, fee_currency,
|
|
519 | | executed_at, timestamp, symbol_hash, broker_execution_id, counterparty, venue
|
|
520 | | FROM executions WHERE side = $1 ORDER BY executed_at DESC
|
|
521 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
517 ~ r"
|
|
518 | SELECT id, order_id, symbol, quantity, price, side, fees, fee_currency,
|
|
519 | executed_at, timestamp, symbol_hash, broker_execution_id, counterparty, venue
|
|
520 | FROM executions WHERE side = $1 ORDER BY executed_at DESC
|
|
521 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/executions.rs:536:13
|
|
|
|
|
536 | / r#"
|
|
537 | | SELECT id, order_id, execution_id, trade_id, symbol, side, quantity, price,
|
|
538 | | commission, commission_currency, sec_fee, taf_fee, clearing_fee,
|
|
539 | | venue, execution_timestamp, settlement_date, is_maker, liquidity_flag,
|
|
... |
|
|
544 | | ORDER BY execution_timestamp ASC
|
|
545 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
536 ~ r"
|
|
537 | SELECT id, order_id, execution_id, trade_id, symbol, side, quantity, price,
|
|
...
|
|
544 | ORDER BY execution_timestamp ASC
|
|
545 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/executions.rs:557:13
|
|
|
|
|
557 | / r#"
|
|
558 | | SELECT id, order_id, symbol, quantity, price, side, fees, fee_currency,
|
|
559 | | executed_at, timestamp, symbol_hash, broker_execution_id, counterparty, venue
|
|
560 | | FROM executions WHERE venue = $1 ORDER BY executed_at DESC
|
|
561 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
557 ~ r"
|
|
558 | SELECT id, order_id, symbol, quantity, price, side, fees, fee_currency,
|
|
559 | executed_at, timestamp, symbol_hash, broker_execution_id, counterparty, venue
|
|
560 | FROM executions WHERE venue = $1 ORDER BY executed_at DESC
|
|
561 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/executions.rs:579:25
|
|
|
|
|
579 | let query = r#"
|
|
| _________________________^
|
|
580 | | INSERT INTO executions (id, order_id, symbol, quantity, price, side, fees, fee_currency,
|
|
581 | | executed_at, timestamp, symbol_hash, broker_execution_id, counterparty, venue)
|
|
582 | | VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14)
|
|
583 | | RETURNING *
|
|
584 | | "#;
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
579 ~ let query = r"
|
|
580 | INSERT INTO executions (id, order_id, symbol, quantity, price, side, fees, fee_currency,
|
|
...
|
|
583 | RETURNING *
|
|
584 ~ ";
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/executions.rs:664:13
|
|
|
|
|
664 | / r#"
|
|
665 | | SELECT
|
|
666 | | COUNT(*) as total_executions,
|
|
667 | | COUNT(CASE WHEN side = 'buy' THEN 1 END) as buy_executions,
|
|
... |
|
|
678 | | FROM fills {}
|
|
679 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
664 ~ r"
|
|
665 | SELECT
|
|
...
|
|
678 | FROM fills {}
|
|
679 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/executions.rs:737:13
|
|
|
|
|
737 | / r#"
|
|
738 | | SELECT id, order_id, execution_id, trade_id, symbol, side, quantity, price,
|
|
739 | | commission, commission_currency, sec_fee, taf_fee, clearing_fee,
|
|
740 | | venue, execution_timestamp, settlement_date, is_maker, liquidity_flag,
|
|
... |
|
|
745 | | ORDER BY (quantity * price) DESC
|
|
746 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
737 ~ r"
|
|
738 | SELECT id, order_id, execution_id, trade_id, symbol, side, quantity, price,
|
|
...
|
|
745 | ORDER BY (quantity * price) DESC
|
|
746 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/executions.rs:762:17
|
|
|
|
|
762 | / r#"
|
|
763 | | SELECT
|
|
764 | | COALESCE(SUM(quantity * price) / NULLIF(SUM(quantity), 0), 0) as vwap
|
|
765 | | FROM fills
|
|
766 | | WHERE symbol = $1 AND execution_timestamp >= $2 AND execution_timestamp <= $3
|
|
767 | | "#,
|
|
| |__________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
762 ~ r"
|
|
763 | SELECT
|
|
...
|
|
766 | WHERE symbol = $1 AND execution_timestamp >= $2 AND execution_timestamp <= $3
|
|
767 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/executions.rs:773:17
|
|
|
|
|
773 | / r#"
|
|
774 | | SELECT
|
|
775 | | COALESCE(SUM(quantity * price) / NULLIF(SUM(quantity), 0), 0) as vwap
|
|
776 | | FROM fills
|
|
777 | | WHERE symbol = $1
|
|
778 | | "#,
|
|
| |__________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
773 ~ r"
|
|
774 | SELECT
|
|
...
|
|
777 | WHERE symbol = $1
|
|
778 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/executions.rs:818:13
|
|
|
|
|
818 | / r#"
|
|
819 | | SELECT
|
|
820 | | EXTRACT(HOUR FROM execution_timestamp) as hour,
|
|
821 | | COUNT(*) as execution_count,
|
|
... |
|
|
829 | | ORDER BY hour
|
|
830 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
818 ~ r"
|
|
819 | SELECT
|
|
...
|
|
829 | ORDER BY hour
|
|
830 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/orders.rs:266:21
|
|
|
|
|
266 | let query = r#"
|
|
| _____________________^
|
|
267 | | SELECT id, client_order_id, broker_order_id, account_id, symbol, side,
|
|
268 | | order_type, status, time_in_force, quantity, price, stop_price,
|
|
269 | | filled_quantity, remaining_quantity, average_price, avg_fill_price,
|
|
... |
|
|
272 | | FROM orders WHERE id = $1
|
|
273 | | "#;
|
|
| |__________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
266 ~ let query = r"
|
|
267 | SELECT id, client_order_id, broker_order_id, account_id, symbol, side,
|
|
...
|
|
272 | FROM orders WHERE id = $1
|
|
273 ~ ";
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/orders.rs:322:21
|
|
|
|
|
322 | let query = r#"
|
|
| _____________________^
|
|
323 | | INSERT INTO orders (id, client_order_id, broker_order_id, account_id, symbol, side,
|
|
324 | | order_type, status, time_in_force, quantity, price, stop_price,
|
|
325 | | filled_quantity, remaining_quantity, average_price, avg_fill_price,
|
|
... |
|
|
340 | | RETURNING *
|
|
341 | | "#;
|
|
| |__________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
322 ~ let query = r"
|
|
323 | INSERT INTO orders (id, client_order_id, broker_order_id, account_id, symbol, side,
|
|
...
|
|
340 | RETURNING *
|
|
341 ~ ";
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/orders.rs:429:26
|
|
|
|
|
429 | let base_query = r#"
|
|
| __________________________^
|
|
430 | | SELECT id, symbol, side, quantity, price, order_type, status,
|
|
431 | | filled_quantity, remaining_quantity, avg_fill_price,
|
|
432 | | created_at, updated_at, expires_at, client_order_id,
|
|
433 | | broker_order_id, stop_loss, take_profit
|
|
434 | | FROM orders
|
|
435 | | "#;
|
|
| |__________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
429 ~ let base_query = r"
|
|
430 | SELECT id, symbol, side, quantity, price, order_type, status,
|
|
...
|
|
434 | FROM orders
|
|
435 ~ ";
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/orders.rs:452:13
|
|
|
|
|
452 | / r#"
|
|
453 | | SELECT id, symbol, side, quantity, price, order_type, status,
|
|
454 | | filled_quantity, remaining_quantity, avg_fill_price,
|
|
455 | | created_at, updated_at, expires_at, client_order_id,
|
|
456 | | broker_order_id, stop_loss, take_profit
|
|
457 | | FROM orders WHERE symbol = $1 ORDER BY created_at DESC
|
|
458 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
452 ~ r"
|
|
453 | SELECT id, symbol, side, quantity, price, order_type, status,
|
|
...
|
|
457 | FROM orders WHERE symbol = $1 ORDER BY created_at DESC
|
|
458 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/orders.rs:469:13
|
|
|
|
|
469 | / r#"
|
|
470 | | SELECT id, symbol, side, quantity, price, order_type, status,
|
|
471 | | filled_quantity, remaining_quantity, avg_fill_price,
|
|
472 | | created_at, updated_at, expires_at, client_order_id,
|
|
473 | | broker_order_id, stop_loss, take_profit
|
|
474 | | FROM orders WHERE status = $1 ORDER BY created_at DESC
|
|
475 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
469 ~ r"
|
|
470 | SELECT id, symbol, side, quantity, price, order_type, status,
|
|
...
|
|
474 | FROM orders WHERE status = $1 ORDER BY created_at DESC
|
|
475 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/orders.rs:486:13
|
|
|
|
|
486 | / r#"
|
|
487 | | SELECT id, symbol, side, quantity, price, order_type, status,
|
|
488 | | filled_quantity, remaining_quantity, avg_fill_price,
|
|
489 | | created_at, updated_at, expires_at, client_order_id,
|
|
... |
|
|
493 | | ORDER BY created_at ASC
|
|
494 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
486 ~ r"
|
|
487 | SELECT id, symbol, side, quantity, price, order_type, status,
|
|
...
|
|
493 | ORDER BY created_at ASC
|
|
494 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/orders.rs:520:13
|
|
|
|
|
520 | / r#"
|
|
521 | | UPDATE orders SET
|
|
522 | | filled_quantity = $1,
|
|
523 | | avg_fill_price = $2,
|
|
... |
|
|
531 | | WHERE id = $4
|
|
532 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
520 ~ r"
|
|
521 | UPDATE orders SET
|
|
...
|
|
531 | WHERE id = $4
|
|
532 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/orders.rs:553:25
|
|
|
|
|
553 | let query = r#"
|
|
| _________________________^
|
|
554 | | INSERT INTO orders (id, symbol, side, quantity, price, order_type, status,
|
|
555 | | filled_quantity, remaining_quantity, avg_fill_price,
|
|
556 | | created_at, updated_at, expires_at, client_order_id,
|
|
... |
|
|
559 | | RETURNING *
|
|
560 | | "#;
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
553 ~ let query = r"
|
|
554 | INSERT INTO orders (id, symbol, side, quantity, price, order_type, status,
|
|
...
|
|
559 | RETURNING *
|
|
560 ~ ";
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/orders.rs:626:13
|
|
|
|
|
626 | / r#"
|
|
627 | | UPDATE orders SET
|
|
628 | | status = 'cancelled',
|
|
629 | | updated_at = $1
|
|
630 | | WHERE id = $2 AND status IN ('pending', 'submitted', 'partiallyfilled')
|
|
631 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
626 ~ r"
|
|
627 | UPDATE orders SET
|
|
...
|
|
630 | WHERE id = $2 AND status IN ('pending', 'submitted', 'partiallyfilled')
|
|
631 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/orders.rs:643:13
|
|
|
|
|
643 | / r#"
|
|
644 | | SELECT id, symbol, side, quantity, price, order_type, status,
|
|
645 | | filled_quantity, remaining_quantity, avg_fill_price,
|
|
646 | | created_at, updated_at, expires_at, client_order_id,
|
|
... |
|
|
652 | | ORDER BY expires_at ASC
|
|
653 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
643 ~ r"
|
|
644 | SELECT id, symbol, side, quantity, price, order_type, status,
|
|
...
|
|
652 | ORDER BY expires_at ASC
|
|
653 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/orders.rs:665:17
|
|
|
|
|
665 | / r#"
|
|
666 | | SELECT
|
|
667 | | COUNT(*) as total_orders,
|
|
668 | | COUNT(CASE WHEN status = 'filled' THEN 1 END) as filled_orders,
|
|
... |
|
|
672 | | FROM orders WHERE symbol = $1
|
|
673 | | "#,
|
|
| |__________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
665 ~ r"
|
|
666 | SELECT
|
|
...
|
|
672 | FROM orders WHERE symbol = $1
|
|
673 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/orders.rs:678:17
|
|
|
|
|
678 | / r#"
|
|
679 | | SELECT
|
|
680 | | COUNT(*) as total_orders,
|
|
681 | | COUNT(CASE WHEN status = 'filled' THEN 1 END) as filled_orders,
|
|
... |
|
|
685 | | FROM orders
|
|
686 | | "#,
|
|
| |__________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
678 ~ r"
|
|
679 | SELECT
|
|
...
|
|
685 | FROM orders
|
|
686 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:241:21
|
|
|
|
|
241 | let query = r#"
|
|
| _____________________^
|
|
242 | | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
243 | | created_at, updated_at, current_price, notional_value, margin_requirement
|
|
244 | | FROM positions WHERE id = $1
|
|
245 | | "#;
|
|
| |__________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
241 ~ let query = r"
|
|
242 | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
243 | created_at, updated_at, current_price, notional_value, margin_requirement
|
|
244 | FROM positions WHERE id = $1
|
|
245 ~ ";
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:279:21
|
|
|
|
|
279 | let query = r#"
|
|
| _____________________^
|
|
280 | | INSERT INTO positions (id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
281 | | created_at, updated_at, current_price, notional_value, margin_requirement)
|
|
282 | | VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)
|
|
... |
|
|
292 | | RETURNING *
|
|
293 | | "#;
|
|
| |__________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
279 ~ let query = r"
|
|
280 | INSERT INTO positions (id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
...
|
|
292 | RETURNING *
|
|
293 ~ ";
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:355:25
|
|
|
|
|
355 | let mut query = r#"
|
|
| _________________________^
|
|
356 | | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
357 | | created_at, updated_at, current_price, notional_value, margin_requirement
|
|
358 | | FROM positions
|
|
359 | | "#
|
|
| |__________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
355 ~ let mut query = r"
|
|
356 | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
357 | created_at, updated_at, current_price, notional_value, margin_requirement
|
|
358 | FROM positions
|
|
359 ~ "
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:440:13
|
|
|
|
|
440 | / r#"
|
|
441 | | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
442 | | created_at, updated_at, current_price, notional_value, margin_requirement
|
|
443 | | FROM positions WHERE symbol = $1 LIMIT 1
|
|
444 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
440 ~ r"
|
|
441 | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
442 | created_at, updated_at, current_price, notional_value, margin_requirement
|
|
443 | FROM positions WHERE symbol = $1 LIMIT 1
|
|
444 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:455:13
|
|
|
|
|
455 | / r#"
|
|
456 | | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
457 | | created_at, updated_at, current_price, notional_value, margin_requirement
|
|
458 | | FROM positions WHERE quantity != 0 ORDER BY ABS(quantity) DESC
|
|
459 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
455 ~ r"
|
|
456 | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
457 | created_at, updated_at, current_price, notional_value, margin_requirement
|
|
458 | FROM positions WHERE quantity != 0 ORDER BY ABS(quantity) DESC
|
|
459 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:470:13
|
|
|
|
|
470 | / r#"
|
|
471 | | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
472 | | created_at, updated_at, current_price, notional_value, margin_requirement
|
|
473 | | FROM positions WHERE {} ORDER BY ABS(quantity) DESC
|
|
474 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
470 ~ r"
|
|
471 | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
472 | created_at, updated_at, current_price, notional_value, margin_requirement
|
|
473 | FROM positions WHERE {} ORDER BY ABS(quantity) DESC
|
|
474 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:495:13
|
|
|
|
|
495 | / r#"
|
|
496 | | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
497 | | created_at, updated_at, current_price, notional_value, margin_requirement
|
|
498 | | FROM positions WHERE symbol = $1 FOR UPDATE
|
|
499 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
495 ~ r"
|
|
496 | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
497 | created_at, updated_at, current_price, notional_value, margin_requirement
|
|
498 | FROM positions WHERE symbol = $1 FOR UPDATE
|
|
499 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:538:21
|
|
|
|
|
538 | / r#"
|
|
539 | | UPDATE positions SET
|
|
540 | | quantity = $1,
|
|
541 | | avg_price = $2,
|
|
... |
|
|
545 | | WHERE symbol = $6
|
|
546 | | "#,
|
|
| |______________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
538 ~ r"
|
|
539 | UPDATE positions SET
|
|
...
|
|
545 | WHERE symbol = $6
|
|
546 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:564:21
|
|
|
|
|
564 | / r#"
|
|
565 | | INSERT INTO positions (id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
566 | | created_at, updated_at, current_price, notional_value, margin_requirement)
|
|
567 | | VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)
|
|
568 | | "#
|
|
| |______________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
564 ~ r"
|
|
565 | INSERT INTO positions (id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
566 | created_at, updated_at, current_price, notional_value, margin_requirement)
|
|
567 | VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)
|
|
568 ~ "
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:594:13
|
|
|
|
|
594 | / r#"
|
|
595 | | UPDATE positions SET
|
|
596 | | current_price = $1,
|
|
597 | | unrealized_pnl = CASE
|
|
... |
|
|
603 | | WHERE symbol = $3
|
|
604 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
594 ~ r"
|
|
595 | UPDATE positions SET
|
|
...
|
|
603 | WHERE symbol = $3
|
|
604 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:629:17
|
|
|
|
|
629 | / r#"
|
|
630 | | UPDATE positions SET
|
|
631 | | current_price = $1,
|
|
632 | | unrealized_pnl = CASE
|
|
... |
|
|
638 | | WHERE symbol = $3
|
|
639 | | "#,
|
|
| |__________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
629 ~ r"
|
|
630 | UPDATE positions SET
|
|
...
|
|
638 | WHERE symbol = $3
|
|
639 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:649:17
|
|
|
|
|
649 | / r#"
|
|
650 | | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
651 | | created_at, updated_at, current_price, notional_value, margin_requirement
|
|
652 | | FROM positions WHERE symbol = $1
|
|
653 | | "#,
|
|
| |__________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
649 ~ r"
|
|
650 | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
651 | created_at, updated_at, current_price, notional_value, margin_requirement
|
|
652 | FROM positions WHERE symbol = $1
|
|
653 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:672:13
|
|
|
|
|
672 | / r#"
|
|
673 | | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
674 | | created_at, updated_at, current_price, notional_value, margin_requirement
|
|
675 | | FROM positions WHERE symbol = $1 FOR UPDATE
|
|
676 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
672 ~ r"
|
|
673 | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
674 | created_at, updated_at, current_price, notional_value, margin_requirement
|
|
675 | FROM positions WHERE symbol = $1 FOR UPDATE
|
|
676 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:702:13
|
|
|
|
|
702 | / r#"
|
|
703 | | UPDATE positions SET
|
|
704 | | quantity = 0,
|
|
705 | | realized_pnl = $1,
|
|
... |
|
|
711 | | WHERE symbol = $4
|
|
712 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
702 ~ r"
|
|
703 | UPDATE positions SET
|
|
...
|
|
711 | WHERE symbol = $4
|
|
712 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:727:13
|
|
|
|
|
727 | / r#"
|
|
728 | | SELECT
|
|
729 | | COUNT(*) as total_positions,
|
|
730 | | COUNT(CASE WHEN quantity > 0 THEN 1 END) as long_positions,
|
|
... |
|
|
737 | | FROM positions
|
|
738 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
727 ~ r"
|
|
728 | SELECT
|
|
...
|
|
737 | FROM positions
|
|
738 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:745:13
|
|
|
|
|
745 | / r#"
|
|
746 | | SELECT symbol, (unrealized_pnl + realized_pnl) as total_pnl
|
|
747 | | FROM positions
|
|
748 | | WHERE (unrealized_pnl + realized_pnl) != 0
|
|
749 | | ORDER BY total_pnl DESC
|
|
750 | | LIMIT 1
|
|
751 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
745 ~ r"
|
|
746 | SELECT symbol, (unrealized_pnl + realized_pnl) as total_pnl
|
|
...
|
|
750 | LIMIT 1
|
|
751 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:757:13
|
|
|
|
|
757 | / r#"
|
|
758 | | SELECT symbol, (unrealized_pnl + realized_pnl) as total_pnl
|
|
759 | | FROM positions
|
|
760 | | WHERE (unrealized_pnl + realized_pnl) != 0
|
|
761 | | ORDER BY total_pnl ASC
|
|
762 | | LIMIT 1
|
|
763 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
757 ~ r"
|
|
758 | SELECT symbol, (unrealized_pnl + realized_pnl) as total_pnl
|
|
...
|
|
762 | LIMIT 1
|
|
763 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:784:13
|
|
|
|
|
784 | / r#"
|
|
785 | | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
786 | | created_at, updated_at, current_price, notional_value, margin_requirement
|
|
787 | | FROM positions
|
|
788 | | WHERE unrealized_pnl <= $1 AND quantity != 0
|
|
789 | | ORDER BY unrealized_pnl ASC
|
|
790 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
784 ~ r"
|
|
785 | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
...
|
|
789 | ORDER BY unrealized_pnl ASC
|
|
790 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:801:13
|
|
|
|
|
801 | / r#"
|
|
802 | | SELECT
|
|
803 | | COALESCE(SUM(unrealized_pnl), 0) as total_unrealized_pnl,
|
|
804 | | COALESCE(SUM(realized_pnl), 0) as total_realized_pnl,
|
|
... |
|
|
808 | | FROM positions
|
|
809 | | "#,
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
801 ~ r"
|
|
802 | SELECT
|
|
...
|
|
808 | FROM positions
|
|
809 ~ ",
|
|
|
|
|
|
|
warning: unnecessary hashes around raw string literal
|
|
--> trading-data/src/positions.rs:840:13
|
|
|
|
|
840 | / r#"
|
|
841 | | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
842 | | created_at, updated_at, current_price, notional_value, margin_requirement
|
|
843 | | FROM positions
|
|
... |
|
|
848 | | ORDER BY unrealized_pnl ASC
|
|
849 | | "#
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
|
|
help: remove all the hashes around the string literal
|
|
|
|
|
840 ~ r"
|
|
841 | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
...
|
|
848 | ORDER BY unrealized_pnl ASC
|
|
849 ~ "
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading-data/src/lib.rs:5:25
|
|
|
|
|
5 | //! and executions with PostgreSQL backing.
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
= note: `#[warn(clippy::doc_markdown)]` implied by `#[warn(clippy::pedantic)]`
|
|
help: try
|
|
|
|
|
5 - //! and executions with PostgreSQL backing.
|
|
5 + //! and executions with `PostgreSQL` backing.
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading-data/src/lib.rs:10:42
|
|
|
|
|
10 | //! - Type-safe database operations with SQLx
|
|
| ^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
10 - //! - Type-safe database operations with SQLx
|
|
10 + //! - Type-safe database operations with `SQLx`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading-data/src/lib.rs:17:73
|
|
|
|
|
17 | //! The crate follows the repository pattern with trait definitions and PostgreSQL
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
17 - //! The crate follows the repository pattern with trait definitions and PostgreSQL
|
|
17 + //! The crate follows the repository pattern with trait definitions and `PostgreSQL`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading-data/src/executions.rs:4:10
|
|
|
|
|
4 | //! with PostgreSQL backing. It includes comprehensive trade history tracking,
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
4 - //! with PostgreSQL backing. It includes comprehensive trade history tracking,
|
|
4 + //! with `PostgreSQL` backing. It includes comprehensive trade history tracking,
|
|
|
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/executions.rs:73:5
|
|
|
|
|
73 | pub fn new() -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn new() -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
= note: `#[warn(clippy::must_use_candidate)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/executions.rs:78:5
|
|
|
|
|
78 | / pub fn symbol<S: Into<String>>(mut self, symbol: S) -> Self {
|
|
79 | | self.symbol = Some(symbol.into());
|
|
80 | | self
|
|
81 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
= note: `#[warn(clippy::return_self_not_must_use)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/executions.rs:84:5
|
|
|
|
|
84 | pub fn order_id(mut self, order_id: Uuid) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn order_id(mut self, order_id: Uuid) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/executions.rs:84:5
|
|
|
|
|
84 | / pub fn order_id(mut self, order_id: Uuid) -> Self {
|
|
85 | | self.order_id = Some(order_id);
|
|
86 | | self
|
|
87 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/executions.rs:90:5
|
|
|
|
|
90 | pub fn side(mut self, side: OrderSide) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn side(mut self, side: OrderSide) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/executions.rs:90:5
|
|
|
|
|
90 | / pub fn side(mut self, side: OrderSide) -> Self {
|
|
91 | | self.side = Some(side);
|
|
92 | | self
|
|
93 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/executions.rs:96:5
|
|
|
|
|
96 | pub fn quantity_range(mut self, min: Option<Decimal>, max: Option<Decimal>) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn quantity_range(mut self, min: Option<Decimal>, max: Option<Decimal>) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/executions.rs:96:5
|
|
|
|
|
96 | / pub fn quantity_range(mut self, min: Option<Decimal>, max: Option<Decimal>) -> Self {
|
|
97 | | self.min_quantity = min;
|
|
98 | | self.max_quantity = max;
|
|
99 | | self
|
|
100 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/executions.rs:103:5
|
|
|
|
|
103 | pub fn price_range(mut self, min: Option<Decimal>, max: Option<Decimal>) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn price_range(mut self, min: Option<Decimal>, max: Option<Decimal>) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/executions.rs:103:5
|
|
|
|
|
103 | / pub fn price_range(mut self, min: Option<Decimal>, max: Option<Decimal>) -> Self {
|
|
104 | | self.min_price = min;
|
|
105 | | self.max_price = max;
|
|
106 | | self
|
|
107 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/executions.rs:110:5
|
|
|
|
|
110 | pub fn value_range(mut self, min: Option<Decimal>, max: Option<Decimal>) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn value_range(mut self, min: Option<Decimal>, max: Option<Decimal>) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/executions.rs:110:5
|
|
|
|
|
110 | / pub fn value_range(mut self, min: Option<Decimal>, max: Option<Decimal>) -> Self {
|
|
111 | | self.min_gross_value = min;
|
|
112 | | self.max_gross_value = max;
|
|
113 | | self
|
|
114 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/executions.rs:117:5
|
|
|
|
|
117 | / pub fn venue<S: Into<String>>(mut self, venue: S) -> Self {
|
|
118 | | self.venue = Some(venue.into());
|
|
119 | | self
|
|
120 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/executions.rs:123:5
|
|
|
|
|
123 | / pub fn counterparty<S: Into<String>>(mut self, counterparty: S) -> Self {
|
|
124 | | self.counterparty = Some(counterparty.into());
|
|
125 | | self
|
|
126 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/executions.rs:129:5
|
|
|
|
|
129 | pub fn executed_between(mut self, start: DateTime<Utc>, end: DateTime<Utc>) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn executed_between(mut self, start: DateTime<Utc>, end: DateTime<Utc>) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/executions.rs:129:5
|
|
|
|
|
129 | / pub fn executed_between(mut self, start: DateTime<Utc>, end: DateTime<Utc>) -> Self {
|
|
130 | | self.executed_after = Some(start);
|
|
131 | | self.executed_before = Some(end);
|
|
132 | | self
|
|
133 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: docs for function which may panic missing `# Panics` section
|
|
--> trading-data/src/executions.rs:136:5
|
|
|
|
|
136 | pub fn today(mut self) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: first possible panic found here
|
|
--> trading-data/src/executions.rs:139:28
|
|
|
|
|
139 | let start_of_day = now
|
|
| ____________________________^
|
|
140 | | .date_naive()
|
|
141 | | .and_hms_opt(0, 0, 0)
|
|
142 | | .expect("Valid time (0, 0, 0) should never fail")
|
|
| |_____________________________________________________________^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
|
|
= note: `#[warn(clippy::missing_panics_doc)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/executions.rs:136:5
|
|
|
|
|
136 | pub fn today(mut self) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn today(mut self) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/executions.rs:136:5
|
|
|
|
|
136 | / pub fn today(mut self) -> Self {
|
|
137 | | let now = Utc::now();
|
|
138 | | // Safety: and_hms_opt(0, 0, 0) is always valid
|
|
139 | | let start_of_day = now
|
|
... |
|
|
146 | | self
|
|
147 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/executions.rs:150:5
|
|
|
|
|
150 | pub fn limit(mut self, limit: i64) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn limit(mut self, limit: i64) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/executions.rs:150:5
|
|
|
|
|
150 | / pub fn limit(mut self, limit: i64) -> Self {
|
|
151 | | self.limit = Some(limit);
|
|
152 | | self
|
|
153 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/executions.rs:156:5
|
|
|
|
|
156 | pub fn offset(mut self, offset: i64) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn offset(mut self, offset: i64) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/executions.rs:156:5
|
|
|
|
|
156 | / pub fn offset(mut self, offset: i64) -> Self {
|
|
157 | | self.offset = Some(offset);
|
|
158 | | self
|
|
159 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading-data/src/executions.rs:317:5
|
|
|
|
|
317 | /// PostgreSQL implementation of ExecutionRepository
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
317 - /// PostgreSQL implementation of ExecutionRepository
|
|
317 + /// `PostgreSQL` implementation of ExecutionRepository
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading-data/src/executions.rs:317:34
|
|
|
|
|
317 | /// PostgreSQL implementation of ExecutionRepository
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
317 - /// PostgreSQL implementation of ExecutionRepository
|
|
317 + /// PostgreSQL implementation of `ExecutionRepository`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading-data/src/executions.rs:323:22
|
|
|
|
|
323 | /// Create a new PostgreSQL execution repository
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
323 - /// Create a new PostgreSQL execution repository
|
|
323 + /// Create a new `PostgreSQL` execution repository
|
|
|
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/executions.rs:324:5
|
|
|
|
|
324 | pub fn new(pool: Pool<Postgres>) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn new(pool: Pool<Postgres>) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/executions.rs:471:13
|
|
|
|
|
471 | write!(query, " LIMIT {}", limit).unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
= note: `#[warn(clippy::uninlined_format_args)]` implied by `#[warn(clippy::pedantic)]`
|
|
help: change this to
|
|
|
|
|
471 - write!(query, " LIMIT {}", limit).unwrap();
|
|
471 + write!(query, " LIMIT {limit}").unwrap();
|
|
|
|
|
|
|
warning: `format!(..)` appended to existing `String`
|
|
--> trading-data/src/executions.rs:475:13
|
|
|
|
|
475 | query.push_str(&format!(" OFFSET {}", offset));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `write!` to avoid the extra allocation
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string
|
|
= note: `#[warn(clippy::format_push_string)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/executions.rs:475:29
|
|
|
|
|
475 | query.push_str(&format!(" OFFSET {}", offset));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
475 - query.push_str(&format!(" OFFSET {}", offset));
|
|
475 + query.push_str(&format!(" OFFSET {offset}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/executions.rs:643:29
|
|
|
|
|
643 | conditions.push(format!("symbol = ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
643 - conditions.push(format!("symbol = ${}", param_count));
|
|
643 + conditions.push(format!("symbol = ${param_count}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/executions.rs:649:29
|
|
|
|
|
649 | conditions.push(format!("executed_at >= ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
649 - conditions.push(format!("executed_at >= ${}", param_count));
|
|
649 + conditions.push(format!("executed_at >= ${param_count}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/executions.rs:653:29
|
|
|
|
|
653 | conditions.push(format!("executed_at <= ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
653 - conditions.push(format!("executed_at <= ${}", param_count));
|
|
653 + conditions.push(format!("executed_at <= ${param_count}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/executions.rs:663:21
|
|
|
|
|
663 | let query = format!(
|
|
| _____________________^
|
|
664 | | r#"
|
|
665 | | SELECT
|
|
666 | | COUNT(*) as total_executions,
|
|
... |
|
|
680 | | where_clause
|
|
681 | | );
|
|
| |_________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
|
|
warning: unnecessary boolean `not` operation
|
|
--> trading-data/src/executions.rs:865:32
|
|
|
|
|
865 | let slippage_bps = if !expected_price.is_zero() {
|
|
| ________________________________^
|
|
866 | | slippage / expected_price * Decimal::from(10000)
|
|
867 | | } else {
|
|
868 | | Decimal::ZERO
|
|
869 | | };
|
|
| |_____________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_not_else
|
|
= note: `#[warn(clippy::if_not_else)]` implied by `#[warn(clippy::pedantic)]`
|
|
help: try
|
|
|
|
|
865 ~ let slippage_bps = if expected_price.is_zero() {
|
|
866 + Decimal::ZERO
|
|
867 + } else {
|
|
868 + slippage / expected_price * Decimal::from(10000)
|
|
869 ~ };
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading-data/src/orders.rs:4:10
|
|
|
|
|
4 | //! with PostgreSQL backing. It includes comprehensive CRUD operations,
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
4 - //! with PostgreSQL backing. It includes comprehensive CRUD operations,
|
|
4 + //! with `PostgreSQL` backing. It includes comprehensive CRUD operations,
|
|
|
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/orders.rs:59:5
|
|
|
|
|
59 | pub fn new() -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn new() -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/orders.rs:64:5
|
|
|
|
|
64 | / pub fn symbol<S: Into<String>>(mut self, symbol: S) -> Self {
|
|
65 | | self.symbol = Some(symbol.into());
|
|
66 | | self
|
|
67 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/orders.rs:70:5
|
|
|
|
|
70 | pub fn status(mut self, status: OrderStatus) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn status(mut self, status: OrderStatus) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/orders.rs:70:5
|
|
|
|
|
70 | / pub fn status(mut self, status: OrderStatus) -> Self {
|
|
71 | | self.status = Some(status);
|
|
72 | | self
|
|
73 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/orders.rs:76:5
|
|
|
|
|
76 | pub fn side(mut self, side: OrderSide) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn side(mut self, side: OrderSide) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/orders.rs:76:5
|
|
|
|
|
76 | / pub fn side(mut self, side: OrderSide) -> Self {
|
|
77 | | self.side = Some(side);
|
|
78 | | self
|
|
79 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/orders.rs:82:5
|
|
|
|
|
82 | pub fn order_type(mut self, order_type: OrderType) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn order_type(mut self, order_type: OrderType) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/orders.rs:82:5
|
|
|
|
|
82 | / pub fn order_type(mut self, order_type: OrderType) -> Self {
|
|
83 | | self.order_type = Some(order_type);
|
|
84 | | self
|
|
85 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/orders.rs:88:5
|
|
|
|
|
88 | / pub fn client_order_id<S: Into<String>>(mut self, client_order_id: S) -> Self {
|
|
89 | | self.client_order_id = Some(client_order_id.into());
|
|
90 | | self
|
|
91 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/orders.rs:94:5
|
|
|
|
|
94 | pub fn created_between(mut self, start: DateTime<Utc>, end: DateTime<Utc>) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn created_between(mut self, start: DateTime<Utc>, end: DateTime<Utc>) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/orders.rs:94:5
|
|
|
|
|
94 | / pub fn created_between(mut self, start: DateTime<Utc>, end: DateTime<Utc>) -> Self {
|
|
95 | | self.created_after = Some(start);
|
|
96 | | self.created_before = Some(end);
|
|
97 | | self
|
|
98 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/orders.rs:101:5
|
|
|
|
|
101 | pub fn limit(mut self, limit: i64) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn limit(mut self, limit: i64) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/orders.rs:101:5
|
|
|
|
|
101 | / pub fn limit(mut self, limit: i64) -> Self {
|
|
102 | | self.limit = Some(limit);
|
|
103 | | self
|
|
104 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/orders.rs:107:5
|
|
|
|
|
107 | pub fn offset(mut self, offset: i64) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn offset(mut self, offset: i64) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/orders.rs:107:5
|
|
|
|
|
107 | / pub fn offset(mut self, offset: i64) -> Self {
|
|
108 | | self.offset = Some(offset);
|
|
109 | | self
|
|
110 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading-data/src/orders.rs:169:5
|
|
|
|
|
169 | /// PostgreSQL implementation of OrderRepository
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
169 - /// PostgreSQL implementation of OrderRepository
|
|
169 + /// `PostgreSQL` implementation of OrderRepository
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading-data/src/orders.rs:169:34
|
|
|
|
|
169 | /// PostgreSQL implementation of OrderRepository
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
169 - /// PostgreSQL implementation of OrderRepository
|
|
169 + /// PostgreSQL implementation of `OrderRepository`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading-data/src/orders.rs:175:22
|
|
|
|
|
175 | /// Create a new PostgreSQL order repository
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
175 - /// Create a new PostgreSQL order repository
|
|
175 + /// Create a new `PostgreSQL` order repository
|
|
|
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/orders.rs:176:5
|
|
|
|
|
176 | pub fn new(pool: Pool<Postgres>) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn new(pool: Pool<Postgres>) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: unused `self` argument
|
|
--> trading-data/src/orders.rs:182:9
|
|
|
|
|
182 | &self,
|
|
| ^^^^^
|
|
|
|
|
= help: consider refactoring to an associated function
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
|
|
= note: `#[warn(clippy::unused_self)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/orders.rs:191:29
|
|
|
|
|
191 | conditions.push(format!("symbol = ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
191 - conditions.push(format!("symbol = ${}", param_count));
|
|
191 + conditions.push(format!("symbol = ${param_count}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/orders.rs:197:29
|
|
|
|
|
197 | conditions.push(format!("status = ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
197 - conditions.push(format!("status = ${}", param_count));
|
|
197 + conditions.push(format!("status = ${param_count}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/orders.rs:203:29
|
|
|
|
|
203 | conditions.push(format!("side = ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
203 - conditions.push(format!("side = ${}", param_count));
|
|
203 + conditions.push(format!("side = ${param_count}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/orders.rs:209:29
|
|
|
|
|
209 | conditions.push(format!("order_type = ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
209 - conditions.push(format!("order_type = ${}", param_count));
|
|
209 + conditions.push(format!("order_type = ${param_count}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/orders.rs:215:29
|
|
|
|
|
215 | conditions.push(format!("client_order_id = ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
215 - conditions.push(format!("client_order_id = ${}", param_count));
|
|
215 + conditions.push(format!("client_order_id = ${param_count}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/orders.rs:221:29
|
|
|
|
|
221 | conditions.push(format!("broker_order_id = ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
221 - conditions.push(format!("broker_order_id = ${}", param_count));
|
|
221 + conditions.push(format!("broker_order_id = ${param_count}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/orders.rs:227:29
|
|
|
|
|
227 | conditions.push(format!("created_at >= ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
227 - conditions.push(format!("created_at >= ${}", param_count));
|
|
227 + conditions.push(format!("created_at >= ${param_count}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/orders.rs:233:29
|
|
|
|
|
233 | conditions.push(format!("created_at <= ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
233 - conditions.push(format!("created_at <= ${}", param_count));
|
|
233 + conditions.push(format!("created_at <= ${param_count}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/orders.rs:249:30
|
|
|
|
|
249 | query_parts.push(format!("LIMIT ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
249 - query_parts.push(format!("LIMIT ${}", param_count));
|
|
249 + query_parts.push(format!("LIMIT ${param_count}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/orders.rs:255:30
|
|
|
|
|
255 | query_parts.push(format!("OFFSET ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
255 - query_parts.push(format!("OFFSET ${}", param_count));
|
|
255 + query_parts.push(format!("OFFSET ${param_count}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/orders.rs:438:26
|
|
|
|
|
438 | let full_query = format!("{} {}", base_query, filter_clause);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
438 - let full_query = format!("{} {}", base_query, filter_clause);
|
|
438 + let full_query = format!("{base_query} {filter_clause}");
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading-data/src/positions.rs:4:10
|
|
|
|
|
4 | //! with PostgreSQL backing. It includes real-time position tracking, P&L calculations,
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
4 - //! with PostgreSQL backing. It includes real-time position tracking, P&L calculations,
|
|
4 + //! with `PostgreSQL` backing. It includes real-time position tracking, P&L calculations,
|
|
|
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/positions.rs:69:5
|
|
|
|
|
69 | pub fn new() -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn new() -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/positions.rs:74:5
|
|
|
|
|
74 | / pub fn symbol<S: Into<String>>(mut self, symbol: S) -> Self {
|
|
75 | | self.symbol = Some(symbol.into());
|
|
76 | | self
|
|
77 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/positions.rs:80:5
|
|
|
|
|
80 | pub fn position_type(mut self, position_type: PositionType) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn position_type(mut self, position_type: PositionType) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/positions.rs:80:5
|
|
|
|
|
80 | / pub fn position_type(mut self, position_type: PositionType) -> Self {
|
|
81 | | self.position_type = Some(position_type);
|
|
82 | | self
|
|
83 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/positions.rs:86:5
|
|
|
|
|
86 | pub fn quantity_range(mut self, min: Option<Decimal>, max: Option<Decimal>) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn quantity_range(mut self, min: Option<Decimal>, max: Option<Decimal>) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/positions.rs:86:5
|
|
|
|
|
86 | / pub fn quantity_range(mut self, min: Option<Decimal>, max: Option<Decimal>) -> Self {
|
|
87 | | self.min_quantity = min;
|
|
88 | | self.max_quantity = max;
|
|
89 | | self
|
|
90 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/positions.rs:93:5
|
|
|
|
|
93 | pub fn pnl_range(mut self, min: Option<Decimal>, max: Option<Decimal>) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn pnl_range(mut self, min: Option<Decimal>, max: Option<Decimal>) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/positions.rs:93:5
|
|
|
|
|
93 | / pub fn pnl_range(mut self, min: Option<Decimal>, max: Option<Decimal>) -> Self {
|
|
94 | | self.min_unrealized_pnl = min;
|
|
95 | | self.max_unrealized_pnl = max;
|
|
96 | | self
|
|
97 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/positions.rs:100:5
|
|
|
|
|
100 | pub fn created_between(mut self, start: DateTime<Utc>, end: DateTime<Utc>) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn created_between(mut self, start: DateTime<Utc>, end: DateTime<Utc>) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/positions.rs:100:5
|
|
|
|
|
100 | / pub fn created_between(mut self, start: DateTime<Utc>, end: DateTime<Utc>) -> Self {
|
|
101 | | self.created_after = Some(start);
|
|
102 | | self.created_before = Some(end);
|
|
103 | | self
|
|
104 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/positions.rs:107:5
|
|
|
|
|
107 | pub fn with_current_price(mut self) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn with_current_price(mut self) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/positions.rs:107:5
|
|
|
|
|
107 | / pub fn with_current_price(mut self) -> Self {
|
|
108 | | self.has_current_price = Some(true);
|
|
109 | | self
|
|
110 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/positions.rs:113:5
|
|
|
|
|
113 | pub fn limit(mut self, limit: i64) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn limit(mut self, limit: i64) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/positions.rs:113:5
|
|
|
|
|
113 | / pub fn limit(mut self, limit: i64) -> Self {
|
|
114 | | self.limit = Some(limit);
|
|
115 | | self
|
|
116 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/positions.rs:119:5
|
|
|
|
|
119 | pub fn offset(mut self, offset: i64) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn offset(mut self, offset: i64) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: missing `#[must_use]` attribute on a method returning `Self`
|
|
--> trading-data/src/positions.rs:119:5
|
|
|
|
|
119 | / pub fn offset(mut self, offset: i64) -> Self {
|
|
120 | | self.offset = Some(offset);
|
|
121 | | self
|
|
122 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading-data/src/positions.rs:217:5
|
|
|
|
|
217 | /// PostgreSQL implementation of PositionRepository
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
217 - /// PostgreSQL implementation of PositionRepository
|
|
217 + /// `PostgreSQL` implementation of PositionRepository
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading-data/src/positions.rs:217:34
|
|
|
|
|
217 | /// PostgreSQL implementation of PositionRepository
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
217 - /// PostgreSQL implementation of PositionRepository
|
|
217 + /// PostgreSQL implementation of `PositionRepository`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading-data/src/positions.rs:223:22
|
|
|
|
|
223 | /// Create a new PostgreSQL position repository
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
223 - /// Create a new PostgreSQL position repository
|
|
223 + /// Create a new `PostgreSQL` position repository
|
|
|
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading-data/src/positions.rs:224:5
|
|
|
|
|
224 | pub fn new(pool: Pool<Postgres>) -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn new(pool: Pool<Postgres>) -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading-data/src/positions.rs:228:34
|
|
|
|
|
228 | /// Helper method to convert PositionType to SQL condition
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
228 - /// Helper method to convert PositionType to SQL condition
|
|
228 + /// Helper method to convert `PositionType` to SQL condition
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/positions.rs:365:29
|
|
|
|
|
365 | conditions.push(format!("symbol = ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
365 - conditions.push(format!("symbol = ${}", param_count));
|
|
365 + conditions.push(format!("symbol = ${param_count}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/positions.rs:375:29
|
|
|
|
|
375 | conditions.push(format!("ABS(quantity) >= ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
375 - conditions.push(format!("ABS(quantity) >= ${}", param_count));
|
|
375 + conditions.push(format!("ABS(quantity) >= ${param_count}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/positions.rs:380:29
|
|
|
|
|
380 | conditions.push(format!("ABS(quantity) <= ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
380 - conditions.push(format!("ABS(quantity) <= ${}", param_count));
|
|
380 + conditions.push(format!("ABS(quantity) <= ${param_count}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/positions.rs:385:29
|
|
|
|
|
385 | conditions.push(format!("unrealized_pnl >= ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
385 - conditions.push(format!("unrealized_pnl >= ${}", param_count));
|
|
385 + conditions.push(format!("unrealized_pnl >= ${param_count}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/positions.rs:390:29
|
|
|
|
|
390 | conditions.push(format!("unrealized_pnl <= ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
390 - conditions.push(format!("unrealized_pnl <= ${}", param_count));
|
|
390 + conditions.push(format!("unrealized_pnl <= ${param_count}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/positions.rs:395:29
|
|
|
|
|
395 | conditions.push(format!("created_at >= ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
395 - conditions.push(format!("created_at >= ${}", param_count));
|
|
395 + conditions.push(format!("created_at >= ${param_count}"));
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/positions.rs:400:29
|
|
|
|
|
400 | conditions.push(format!("created_at <= ${}", param_count));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
400 - conditions.push(format!("created_at <= ${}", param_count));
|
|
400 + conditions.push(format!("created_at <= ${param_count}"));
|
|
|
|
|
|
|
warning: adding items after statements is confusing, since items exist from the start of the scope
|
|
--> trading-data/src/positions.rs:420:13
|
|
|
|
|
420 | use std::fmt::Write;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
|
|
= note: `#[warn(clippy::items_after_statements)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/positions.rs:421:13
|
|
|
|
|
421 | write!(query, " LIMIT ${}", param_count).unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
421 - write!(query, " LIMIT ${}", param_count).unwrap();
|
|
421 + write!(query, " LIMIT ${param_count}").unwrap();
|
|
|
|
|
|
|
warning: adding items after statements is confusing, since items exist from the start of the scope
|
|
--> trading-data/src/positions.rs:426:13
|
|
|
|
|
426 | use std::fmt::Write;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/positions.rs:427:13
|
|
|
|
|
427 | write!(query, " OFFSET ${}", param_count).unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
427 - write!(query, " OFFSET ${}", param_count).unwrap();
|
|
427 + write!(query, " OFFSET ${param_count}").unwrap();
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/positions.rs:469:21
|
|
|
|
|
469 | let query = format!(
|
|
| _____________________^
|
|
470 | | r#"
|
|
471 | | SELECT id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
472 | | created_at, updated_at, current_price, notional_value, margin_requirement
|
|
... |
|
|
475 | | condition
|
|
476 | | );
|
|
| |_________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
|
|
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
|
|
--> trading-data/src/positions.rs:505:32
|
|
|
|
|
505 | let updated_position = match existing_position {
|
|
| ________________________________^
|
|
506 | | Some(mut position) => {
|
|
507 | | // Update existing position
|
|
508 | | let old_quantity = position.quantity;
|
|
... |
|
|
585 | | },
|
|
586 | | };
|
|
| |_________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else
|
|
= note: `#[warn(clippy::single_match_else)]` implied by `#[warn(clippy::pedantic)]`
|
|
help: try
|
|
|
|
|
505 ~ let updated_position = if let Some(mut position) = existing_position {
|
|
506 + // Update existing position
|
|
507 + let old_quantity = position.quantity;
|
|
508 + let new_quantity = old_quantity + quantity_delta;
|
|
509 +
|
|
510 + // Calculate new average price
|
|
511 + let new_avg_price = if new_quantity.is_zero() {
|
|
512 + position.avg_price // Keep old average when closing
|
|
513 + } else if old_quantity.is_zero() {
|
|
514 + price // New position
|
|
515 + } else if (old_quantity > Decimal::ZERO) == (quantity_delta > Decimal::ZERO) {
|
|
516 + // Adding to existing position (same side)
|
|
517 + let total_cost = old_quantity * position.avg_price + quantity_delta * price;
|
|
518 + total_cost / new_quantity
|
|
519 + } else {
|
|
520 + // Reducing position or switching sides
|
|
521 + if new_quantity.abs() < old_quantity.abs() {
|
|
522 + position.avg_price // Keep average when reducing
|
|
523 + } else {
|
|
524 + price // New average when switching sides
|
|
525 + }
|
|
526 + };
|
|
527 +
|
|
528 + position.quantity = new_quantity;
|
|
529 + position.avg_price = new_avg_price;
|
|
530 + position.notional_value = new_quantity.abs() * new_avg_price;
|
|
531 + position.margin_requirement =
|
|
532 + position.notional_value * Decimal::from_str_exact("0.02").unwrap();
|
|
533 + position.updated_at = Utc::now();
|
|
534 +
|
|
535 + // Update in database
|
|
536 + sqlx::query(
|
|
537 + r#"
|
|
538 + UPDATE positions SET
|
|
539 + quantity = $1,
|
|
540 + avg_price = $2,
|
|
541 + notional_value = $3,
|
|
542 + margin_requirement = $4,
|
|
543 + updated_at = $5
|
|
544 + WHERE symbol = $6
|
|
545 + "#,
|
|
546 + )
|
|
547 + .bind(position.quantity)
|
|
548 + .bind(position.avg_price)
|
|
549 + .bind(position.notional_value)
|
|
550 + .bind(position.margin_requirement)
|
|
551 + .bind(position.updated_at)
|
|
552 + .bind(symbol)
|
|
553 + .execute(&mut *tx)
|
|
554 + .await?;
|
|
555 +
|
|
556 + position
|
|
557 + } else {
|
|
558 + // Create new position
|
|
559 + let position = Position::new(symbol.to_string(), quantity_delta, price);
|
|
560 +
|
|
561 + sqlx::query(
|
|
562 + r#"
|
|
563 + INSERT INTO positions (id, symbol, quantity, avg_price, unrealized_pnl, realized_pnl,
|
|
564 + created_at, updated_at, current_price, notional_value, margin_requirement)
|
|
565 + VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)
|
|
566 + "#
|
|
567 + )
|
|
568 + .bind(position.id)
|
|
569 + .bind(&position.symbol)
|
|
570 + .bind(position.quantity)
|
|
571 + .bind(position.avg_price)
|
|
572 + .bind(position.unrealized_pnl)
|
|
573 + .bind(position.realized_pnl)
|
|
574 + .bind(position.created_at)
|
|
575 + .bind(position.updated_at)
|
|
576 + .bind(position.current_price)
|
|
577 + .bind(position.notional_value)
|
|
578 + .bind(position.margin_requirement)
|
|
579 + .execute(&mut *tx)
|
|
580 + .await?;
|
|
581 +
|
|
582 + position
|
|
583 ~ };
|
|
|
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading-data/src/positions.rs:682:39
|
|
|
|
|
682 | RepositoryError::NotFound(format!("Position not found for symbol: {}", symbol))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
help: change this to
|
|
|
|
|
682 - RepositoryError::NotFound(format!("Position not found for symbol: {}", symbol))
|
|
682 + RepositoryError::NotFound(format!("Position not found for symbol: {symbol}"))
|
|
|
|
|
|
|
warning: unnecessary boolean `not` operation
|
|
--> trading-data/src/positions.rs:821:30
|
|
|
|
|
821 | let roi_percentage = if !total_notional_value.is_zero() {
|
|
| ______________________________^
|
|
822 | | total_pnl / total_notional_value * Decimal::from(100)
|
|
823 | | } else {
|
|
824 | | Decimal::ZERO
|
|
825 | | };
|
|
| |_________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_not_else
|
|
help: try
|
|
|
|
|
821 ~ let roi_percentage = if total_notional_value.is_zero() {
|
|
822 + Decimal::ZERO
|
|
823 + } else {
|
|
824 + total_pnl / total_notional_value * Decimal::from(100)
|
|
825 ~ };
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading-data/src/lib.rs:55:42
|
|
|
|
|
55 | /// Database operation failed (wraps SQLx errors)
|
|
| ^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
55 - /// Database operation failed (wraps SQLx errors)
|
|
55 + /// Database operation failed (wraps `SQLx` errors)
|
|
|
|
|
|
|
warning: `trading-data` (lib) generated 155 warnings (run `cargo clippy --fix --lib -p trading-data` to apply 122 suggestions)
|
|
warning: length comparison to zero
|
|
--> services/api_gateway/load_tests/src/metrics/collector.rs:62:45
|
|
|
|
|
62 | let p99_latency_ms = if histogram.len() > 0 {
|
|
| ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!histogram.is_empty()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
|
|
= note: `-W clippy::len-zero` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::len_zero)]`
|
|
|
|
warning: length comparison to zero
|
|
--> services/api_gateway/load_tests/src/metrics/collector.rs:139:32
|
|
|
|
|
139 | let latency_stats = if histogram.len() > 0 {
|
|
| ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!histogram.is_empty()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
|
|
|
|
warning: length comparison to zero
|
|
--> services/api_gateway/load_tests/src/metrics/collector.rs:171:16
|
|
|
|
|
171 | if hist.len() > 0 {
|
|
| ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!hist.is_empty()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
|
|
|
|
warning: useless use of `format!`
|
|
--> services/api_gateway/load_tests/src/scenarios/sustained_load.rs:164:13
|
|
|
|
|
164 | / format!(
|
|
165 | | "Error rate fluctuations detected. Review application logs and backend \
|
|
166 | | service health during sustained load."
|
|
167 | | )
|
|
| |_____________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
|
|
= note: `-W clippy::useless-format` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::useless_format)]`
|
|
help: consider using `.to_string()`
|
|
|
|
|
164 ~ "Error rate fluctuations detected. Review application logs and backend \
|
|
165 + service health during sustained load.".to_string()
|
|
|
|
|
|
|
warning: `api_gateway_load_tests` (bin "load_test_runner") generated 4 warnings (run `cargo clippy --fix --bin "load_test_runner"` to apply 4 suggestions)
|
|
warning: empty line after doc comment
|
|
--> adaptive-strategy/src/models/mod.rs:431:5
|
|
|
|
|
431 | / /// Get a mutable reference to a model by name
|
|
... |
|
|
435 | |
|
|
| |_^
|
|
436 | /// Remove a model from the registry
|
|
437 | pub fn remove(&mut self, name: &str) -> Option<Box<dyn ModelTrait>> {
|
|
| ------------- the comment documents this function
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
|
|
= note: `-W clippy::empty-line-after-doc-comments` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::empty_line_after_doc_comments)]`
|
|
= help: if the empty line is unintentional, remove it
|
|
help: if the doc comment should not document function `remove` then comment it out
|
|
|
|
|
431 | // /// Get a mutable reference to a model by name
|
|
| ++
|
|
|
|
error: integer type suffix should be separated by an underscore
|
|
--> adaptive-strategy/src/regime/mod.rs:3752:46
|
|
|
|
|
3752 | let mut confusion_matrix = vec![vec![0u32; self.num_components]; self.num_components];
|
|
| ^^^^ help: add an underscore: `0_u32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unseparated_literal_suffix
|
|
= note: requested on the command line with `-D clippy::unseparated-literal-suffix`
|
|
|
|
error: integer type suffix should be separated by an underscore
|
|
--> adaptive-strategy/src/regime/mod.rs:4029:46
|
|
|
|
|
4029 | let mut confusion_matrix = vec![vec![0u32; 6]; 6]; // 6 possible regimes
|
|
| ^^^^ help: add an underscore: `0_u32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unseparated_literal_suffix
|
|
|
|
error: float type suffix should be separated by an underscore
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1421:66
|
|
|
|
|
1421 | let max_drawdown = recent_drawdowns.iter().cloned().fold(0.0f64, f64::max);
|
|
| ^^^^^^ help: add an underscore: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unseparated_literal_suffix
|
|
|
|
error: float type suffix should be separated by an underscore
|
|
--> adaptive-strategy/src/risk/mod.rs:1227:19
|
|
|
|
|
1227 | .fold(0.0f64, f64::max);
|
|
| ^^^^^^ help: add an underscore: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unseparated_literal_suffix
|
|
|
|
warning: duplicated attribute
|
|
--> trading_engine/src/lib.rs:42:10
|
|
|
|
|
42 | #![allow(missing_docs)] // Internal implementation details
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
note: first defined here
|
|
--> trading_engine/src/lib.rs:2:10
|
|
|
|
|
2 | #![allow(missing_docs)] // Internal implementation details don't require documentation
|
|
| ^^^^^^^^^^^^
|
|
help: remove this attribute
|
|
--> trading_engine/src/lib.rs:42:10
|
|
|
|
|
42 | #![allow(missing_docs)] // Internal implementation details
|
|
| ^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes
|
|
= note: `-W clippy::duplicated-attributes` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::duplicated_attributes)]`
|
|
|
|
warning: empty line after doc comment
|
|
--> trading_engine/src/types/type_registry.rs:11:1
|
|
|
|
|
11 | / /// canonical locations. Any attempt to duplicate types will be caught at compile time.
|
|
... |
|
|
14 | |
|
|
| |_^
|
|
...
|
|
20 | macro_rules! type_compliance_check {
|
|
| ---------------------------------- the comment documents this macro definition
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
|
|
= note: `-W clippy::empty-line-after-doc-comments` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::empty_line_after_doc_comments)]`
|
|
= help: if the empty line is unintentional, remove it
|
|
help: if the doc comment should not document macro definition `type_compliance_check` then comment it out
|
|
|
|
|
8 ~ // /// Canonical type locations registry - SINGLE SOURCE OF TRUTH
|
|
9 ~ // ///
|
|
10 ~ // /// This compile-time registry ensures that all types are imported from their
|
|
11 ~ // /// canonical locations. Any attempt to duplicate types will be caught at compile time.
|
|
|
|
|
|
|
error: integer type suffix should be separated by an underscore
|
|
--> trading_engine/src/timing.rs:283:48
|
|
|
|
|
283 | let nanos_u128 = cycles_u128 * 1_000_000_000u128 / freq as u128;
|
|
| ^^^^^^^^^^^^^^^^^ help: add an underscore: `1_000_000_000_u128`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unseparated_literal_suffix
|
|
= note: requested on the command line with `-D clippy::unseparated-literal-suffix`
|
|
|
|
error: integer type suffix should be separated by an underscore
|
|
--> trading_engine/src/timing.rs:369:48
|
|
|
|
|
369 | let nanos_u128 = cycles_u128 * 1_000_000_000u128 / freq as u128;
|
|
| ^^^^^^^^^^^^^^^^^ help: add an underscore: `1_000_000_000_u128`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unseparated_literal_suffix
|
|
|
|
error: `if` expression with an `else if`, but without a final `else`
|
|
--> trading_engine/src/affinity.rs:267:20
|
|
|
|
|
267 | } else if let Ok(core) = part.parse::<usize>() {
|
|
| ____________________^
|
|
268 | | cores.push(core);
|
|
269 | | }
|
|
| |_____________^
|
|
|
|
|
= help: add an `else` block here
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#else_if_without_else
|
|
= note: requested on the command line with `-D clippy::else-if-without-else`
|
|
|
|
error: `if` expression with an `else if`, but without a final `else`
|
|
--> trading_engine/src/affinity.rs:311:28
|
|
|
|
|
311 | } else if core_range.contains('-') {
|
|
| ____________________________^
|
|
312 | | // Handle ranges like "2-5"
|
|
313 | | let parts: Vec<&str> = core_range.split('-').collect();
|
|
314 | | if parts.len() == 2 {
|
|
... |
|
|
326 | | }
|
|
| |_____________________^
|
|
|
|
|
= help: add an `else` block here
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#else_if_without_else
|
|
|
|
warning: empty line after doc comment
|
|
--> trading_engine/src/lib.rs:104:1
|
|
|
|
|
104 | / /// Configuration management system
|
|
105 | | // Configuration is provided by the config crate
|
|
106 | |
|
|
| |_^
|
|
...
|
|
109 | pub mod persistence;
|
|
| ------------------- the comment documents this module
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
|
|
= help: if the empty line is unintentional, remove it
|
|
help: if the doc comment should not document module `persistence` then comment it out
|
|
|
|
|
104 | // /// Configuration management system
|
|
| ++
|
|
|
|
warning: empty lines after doc comment
|
|
--> trading_engine/src/trading/data_interface.rs:20:1
|
|
|
|
|
20 | / /// Market data event that can be sent through the system
|
|
... |
|
|
26 | |
|
|
| |_^
|
|
...
|
|
32 | pub struct Subscription {
|
|
| ----------------------- the comment documents this struct
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
|
|
= help: if the empty lines are unintentional, remove them
|
|
help: if the doc comment should not document struct `Subscription` then comment it out
|
|
|
|
|
20 | // /// Market data event that can be sent through the system
|
|
| ++
|
|
|
|
warning: empty line after doc comment
|
|
--> trading_engine/src/lib.rs:133:1
|
|
|
|
|
133 | / /// Unified feature extraction system - prevents training/serving skew
|
|
... |
|
|
136 | |
|
|
| |_^
|
|
137 | /// Comprehensive performance benchmarks for HFT system validation
|
|
138 | pub mod comprehensive_performance_benchmarks;
|
|
| -------------------------------------------- the comment documents this module
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
|
|
= help: if the empty line is unintentional, remove it
|
|
help: if the doc comment should not document module `comprehensive_performance_benchmarks` then comment it out
|
|
|
|
|
133 | // /// Unified feature extraction system - prevents training/serving skew
|
|
| ++
|
|
|
|
error: mixed usage of pub and non-pub fields
|
|
--> trading_engine/src/metrics.rs:315:5
|
|
|
|
|
315 | last_export_ns: AtomicU64,
|
|
| ^
|
|
|
|
|
= help: consider using public field here
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partial_pub_fields
|
|
= note: requested on the command line with `-D clippy::partial-pub-fields`
|
|
|
|
error: mixed usage of pub and non-pub fields
|
|
--> trading_engine/src/tracing.rs:257:5
|
|
|
|
|
257 | span_queue: Arc<SegQueue<FastSpan>>,
|
|
| ^
|
|
|
|
|
= help: consider using public field here
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partial_pub_fields
|
|
|
|
warning: single-character lifetime names are likely uninformative
|
|
--> trading_engine/src/tracing.rs:410:22
|
|
|
|
|
410 | pub struct SpanGuard<'a> {
|
|
| ^^
|
|
|
|
|
= help: use a more informative name
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_lifetime_names
|
|
= note: requested on the command line with `-W clippy::single-char-lifetime-names`
|
|
|
|
warning: single-character lifetime names are likely uninformative
|
|
--> trading_engine/src/tracing.rs:415:6
|
|
|
|
|
415 | impl<'a> SpanGuard<'a> {
|
|
| ^^
|
|
|
|
|
= help: use a more informative name
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_lifetime_names
|
|
|
|
warning: single-character lifetime names are likely uninformative
|
|
--> trading_engine/src/tracing.rs:441:6
|
|
|
|
|
441 | impl<'a> Drop for SpanGuard<'a> {
|
|
| ^^
|
|
|
|
|
= help: use a more informative name
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_lifetime_names
|
|
|
|
warning: unused import: `std::io::Write`
|
|
--> trading_engine/src/compliance/audit_trails.rs:367:13
|
|
|
|
|
367 | use std::io::Write;
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= note: `#[warn(unused_imports)]` on by default
|
|
|
|
warning: unused import: `std::fs::OpenOptions`
|
|
--> trading_engine/src/compliance/audit_trails.rs:368:13
|
|
|
|
|
368 | use std::fs::OpenOptions;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: unnecessary qualification
|
|
--> trading_engine/src/compliance/audit_trails.rs:801:25
|
|
|
|
|
801 | start_time: chrono::Utc::now() - chrono::Duration::hours(24),
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: requested on the command line with `-W unused-qualifications`
|
|
help: remove the unnecessary path segments
|
|
|
|
|
801 - start_time: chrono::Utc::now() - chrono::Duration::hours(24),
|
|
801 + start_time: Utc::now() - chrono::Duration::hours(24),
|
|
|
|
|
|
|
warning: unnecessary qualification
|
|
--> trading_engine/src/compliance/audit_trails.rs:802:23
|
|
|
|
|
802 | end_time: chrono::Utc::now(),
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the unnecessary path segments
|
|
|
|
|
802 - end_time: chrono::Utc::now(),
|
|
802 + end_time: Utc::now(),
|
|
|
|
|
|
|
error: integer type suffix should be separated by an underscore
|
|
--> trading_engine/src/compliance/audit_trails.rs:1346:40
|
|
|
|
|
1346 | let mut nonce_bytes = [0u8; 12];
|
|
| ^^^ help: add an underscore: `0_u8`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unseparated_literal_suffix
|
|
|
|
warning: empty line after outer attribute
|
|
--> trading_engine/src/compliance/sox_compliance.rs:976:1
|
|
|
|
|
976 | / #[allow(dead_code)]
|
|
977 | |
|
|
| |_^
|
|
...
|
|
983 | pub struct ChangeRequest {
|
|
| ------------------------ the attribute applies to this struct
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_outer_attr
|
|
= note: `-W clippy::empty-line-after-outer-attr` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::empty_line_after_outer_attr)]`
|
|
= help: if the empty line is unintentional, remove it
|
|
|
|
warning: empty line after doc comment
|
|
--> trading_engine/src/tests/mod.rs:9:1
|
|
|
|
|
9 | / /// Comprehensive compliance tests (temporarily disabled due to type conflicts)
|
|
10 | | // pub mod compliance_tests;
|
|
11 | |
|
|
| |_^
|
|
12 | /// Comprehensive trading system tests
|
|
13 | pub mod trading_tests;
|
|
| --------------------- the comment documents this module
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
|
|
= help: if the empty line is unintentional, remove it
|
|
help: if the doc comment should not document module `trading_tests` then comment it out
|
|
|
|
|
9 | // /// Comprehensive compliance tests (temporarily disabled due to type conflicts)
|
|
| ++
|
|
|
|
warning: item has both inner and outer attributes
|
|
--> trading_engine/src/lib.rs:162:1
|
|
|
|
|
162 | / /// Performance utilities and constants
|
|
163 | | pub mod performance {
|
|
164 | | //! Performance-related constants and utilities
|
|
| |___________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mixed_attributes_style
|
|
= note: `-W clippy::mixed-attributes-style` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::mixed_attributes_style)]`
|
|
|
|
warning: item has both inner and outer attributes
|
|
--> trading_engine/src/lib.rs:276:1
|
|
|
|
|
276 | / /// Error types for core operations
|
|
277 | | pub mod error {
|
|
278 | | //! Core error types and utilities
|
|
| |______________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mixed_attributes_style
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/lib.rs:50:54
|
|
|
|
|
50 | //! All configurations should now be loaded from the PostgreSQL database using
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
= note: requested on the command line with `-W clippy::doc-markdown`
|
|
help: try
|
|
|
|
|
50 - //! All configurations should now be loaded from the PostgreSQL database using
|
|
50 + //! All configurations should now be loaded from the `PostgreSQL` database using
|
|
|
|
|
|
|
warning: item name ends with its containing module's name
|
|
--> adaptive-strategy/src/config.rs:11:12
|
|
|
|
|
11 | pub struct AdaptiveStrategyConfig {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
= note: requested on the command line with `-W clippy::module-name-repetitions`
|
|
|
|
warning: item name ends with its containing module's name
|
|
--> adaptive-strategy/src/config.rs:27:10
|
|
|
|
|
27 | pub type StrategyConfig = AdaptiveStrategyConfig;
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name ends with its containing module's name
|
|
--> adaptive-strategy/src/config.rs:31:12
|
|
|
|
|
31 | pub struct GeneralConfig {
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: use of `eprintln!`
|
|
--> adaptive-strategy/src/config.rs:66:9
|
|
|
|
|
66 | eprintln!("WARNING: Using hardcoded GeneralConfig::default() - migrate to database configuration!");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
= note: requested on the command line with `-W clippy::print-stderr`
|
|
|
|
warning: use of `eprintln!`
|
|
--> adaptive-strategy/src/config.rs:78:9
|
|
|
|
|
78 | eprintln!("WARNING: Using hardcoded AdaptiveStrategyConfig::default() - migrate to database configuration!");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: use of `eprintln!`
|
|
--> adaptive-strategy/src/config.rs:79:9
|
|
|
|
|
79 | eprintln!(" Load configuration from database using DatabaseConfigLoader instead.");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: use of `eprintln!`
|
|
--> adaptive-strategy/src/config.rs:80:9
|
|
|
|
|
80 | eprintln!(" Available strategies: 'default-production', 'development', 'aggressive'");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: item name ends with its containing module's name
|
|
--> adaptive-strategy/src/config.rs:94:12
|
|
|
|
|
94 | pub struct EnsembleConfig {
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: use of `eprintln!`
|
|
--> adaptive-strategy/src/config.rs:109:9
|
|
|
|
|
109 | eprintln!("WARNING: Using hardcoded EnsembleConfig::default() - migrate to database configuration!");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config.rs:117:25
|
|
|
|
|
117 | id: "mamba2_model".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"mamba2_model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
= note: requested on the command line with `-D clippy::str-to-string`
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config.rs:118:27
|
|
|
|
|
118 | name: "mamba2_model".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"mamba2_model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config.rs:119:33
|
|
|
|
|
119 | model_type: "mamba2".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `"mamba2".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config.rs:125:25
|
|
|
|
|
125 | id: "tlob_model".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"tlob_model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config.rs:126:27
|
|
|
|
|
126 | name: "tlob_model".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"tlob_model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config.rs:127:33
|
|
|
|
|
127 | model_type: "tlob".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"tlob".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item name ends with its containing module's name
|
|
--> adaptive-strategy/src/config.rs:139:12
|
|
|
|
|
139 | pub struct ModelConfig {
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: use of `eprintln!`
|
|
--> adaptive-strategy/src/config.rs:156:9
|
|
|
|
|
156 | eprintln!("WARNING: Using hardcoded ModelConfig::default() - migrate to database configuration!");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config.rs:158:17
|
|
|
|
|
158 | id: "default_model".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"default_model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config.rs:159:19
|
|
|
|
|
159 | name: "default_model".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"default_model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config.rs:160:25
|
|
|
|
|
160 | model_type: "mamba2".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `"mamba2".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item name ends with its containing module's name
|
|
--> adaptive-strategy/src/config.rs:170:12
|
|
|
|
|
170 | pub struct RiskConfig {
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/config.rs:179:27
|
|
|
|
|
179 | /// Maximum portfolio VaR
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
179 - /// Maximum portfolio VaR
|
|
179 + /// Maximum portfolio `VaR`
|
|
|
|
|
|
|
warning: use of `eprintln!`
|
|
--> adaptive-strategy/src/config.rs:189:9
|
|
|
|
|
189 | eprintln!("WARNING: Using hardcoded RiskConfig::default() - migrate to database configuration!");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: item name ends with its containing module's name
|
|
--> adaptive-strategy/src/config.rs:225:12
|
|
|
|
|
225 | pub struct MicrostructureConfig {
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: use of `eprintln!`
|
|
--> adaptive-strategy/src/config.rs:240:9
|
|
|
|
|
240 | eprintln!("WARNING: Using hardcoded MicrostructureConfig::default() - migrate to database configuration!");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config.rs:247:17
|
|
|
|
|
247 | "vpin".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"vpin".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config.rs:248:17
|
|
|
|
|
248 | "order_flow".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"order_flow".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config.rs:249:17
|
|
|
|
|
249 | "bid_ask_spread".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"bid_ask_spread".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item name ends with its containing module's name
|
|
--> adaptive-strategy/src/config.rs:257:12
|
|
|
|
|
257 | pub struct RegimeConfig {
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: use of `eprintln!`
|
|
--> adaptive-strategy/src/config.rs:270:9
|
|
|
|
|
270 | eprintln!("WARNING: Using hardcoded RegimeConfig::default() - migrate to database configuration!");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config.rs:276:17
|
|
|
|
|
276 | "volatility".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"volatility".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config.rs:277:17
|
|
|
|
|
277 | "momentum".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `"momentum".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config.rs:278:17
|
|
|
|
|
278 | "volume".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `"volume".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item name ends with its containing module's name
|
|
--> adaptive-strategy/src/config.rs:303:12
|
|
|
|
|
303 | pub struct ExecutionConfig {
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: use of `eprintln!`
|
|
--> adaptive-strategy/src/config.rs:322:9
|
|
|
|
|
322 | eprintln!("WARNING: Using hardcoded ExecutionConfig::default() - migrate to database configuration!");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/config_types.rs:7:48
|
|
|
|
|
7 | //! configuration that supports hot-reload via PostgreSQL NOTIFY/LISTEN.
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
7 - //! configuration that supports hot-reload via PostgreSQL NOTIFY/LISTEN.
|
|
7 + //! configuration that supports hot-reload via `PostgreSQL` NOTIFY/LISTEN.
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/config_types.rs:18:58
|
|
|
|
|
18 | /// Complete adaptive strategy configuration loaded from PostgreSQL
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
18 - /// Complete adaptive strategy configuration loaded from PostgreSQL
|
|
18 + /// Complete adaptive strategy configuration loaded from `PostgreSQL`
|
|
|
|
|
|
|
warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
|
|
--> adaptive-strategy/src/config_types.rs:257:5
|
|
|
|
|
257 | / pub fn from_str(s: &str) -> Result<Self, String> {
|
|
258 | | match s.to_uppercase().as_str() {
|
|
259 | | "KELLY" => Ok(Self::Kelly),
|
|
260 | | "FIXED_FRACTIONAL" => Ok(Self::FixedFractional(0.1)), // Default fraction
|
|
... |
|
|
271 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
|
|
= note: `-W clippy::should-implement-trait` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::should_implement_trait)]`
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:267:33
|
|
|
|
|
267 | Ok(Self::Custom(custom.to_string()))
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `custom.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:276:28
|
|
|
|
|
276 | Self::Kelly => "KELLY".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"KELLY".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:277:41
|
|
|
|
|
277 | Self::FixedFractional(_) => "FIXED_FRACTIONAL".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"FIXED_FRACTIONAL".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:278:36
|
|
|
|
|
278 | Self::FixedFraction => "FIXED_FRACTION".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"FIXED_FRACTION".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:279:26
|
|
|
|
|
279 | Self::PPO => "PPO".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"PPO".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:280:34
|
|
|
|
|
280 | Self::EqualWeight => "EQUAL_WEIGHT".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"EQUAL_WEIGHT".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:281:33
|
|
|
|
|
281 | Self::RiskParity => "RISK_PARITY".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"RISK_PARITY".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:282:39
|
|
|
|
|
282 | Self::VolatilityTarget => "VOLATILITY_TARGET".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"VOLATILITY_TARGET".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
|
|
--> adaptive-strategy/src/config_types.rs:301:5
|
|
|
|
|
301 | / pub fn from_str(s: &str) -> Result<Self, String> {
|
|
302 | | match s.to_uppercase().as_str() {
|
|
303 | | "HMM" => Ok(Self::HMM),
|
|
304 | | "MARKOV_SWITCHING" => Ok(Self::MarkovSwitching),
|
|
... |
|
|
311 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:316:26
|
|
|
|
|
316 | Self::HMM => "HMM".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"HMM".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:317:38
|
|
|
|
|
317 | Self::MarkovSwitching => "MARKOV_SWITCHING".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"MARKOV_SWITCHING".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:318:32
|
|
|
|
|
318 | Self::Threshold => "THRESHOLD".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"THRESHOLD".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:319:39
|
|
|
|
|
319 | Self::MLClassification => "ML_CLASSIFICATION".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"ML_CLASSIFICATION".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:320:26
|
|
|
|
|
320 | Self::GMM => "GMM".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"GMM".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:321:35
|
|
|
|
|
321 | Self::MLClassifier => "ML_CLASSIFIER".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"ML_CLASSIFIER".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
|
|
--> adaptive-strategy/src/config_types.rs:339:5
|
|
|
|
|
339 | / pub fn from_str(s: &str) -> Result<Self, String> {
|
|
340 | | match s.to_uppercase().as_str() {
|
|
341 | | "TWAP" => Ok(Self::TWAP),
|
|
342 | | "VWAP" => Ok(Self::VWAP),
|
|
... |
|
|
349 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:354:27
|
|
|
|
|
354 | Self::TWAP => "TWAP".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"TWAP".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:355:27
|
|
|
|
|
355 | Self::VWAP => "VWAP".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"VWAP".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:356:25
|
|
|
|
|
356 | Self::IS => "IS".to_string(),
|
|
| ^^^^^^^^^^^^^^^^ help: try: `"IS".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:357:46
|
|
|
|
|
357 | Self::ImplementationShortfall => "IMPLEMENTATION_SHORTFALL".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"IMPLEMENTATION_SHORTFALL".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:358:35
|
|
|
|
|
358 | Self::ArrivalPrice => "ARRIVAL_PRICE".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"ARRIVAL_PRICE".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/config_types.rs:359:26
|
|
|
|
|
359 | Self::POV => "POV".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"POV".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:384:59
|
|
|
|
|
384 | execution_interval: Duration::from_millis(self.execution_interval_ms as u64),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
= note: requested on the command line with `-W clippy::as-conversions`
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:386:21
|
|
|
|
|
386 | self.error_backoff_duration_secs as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:388:44
|
|
|
|
|
388 | max_concurrent_operations: self.max_concurrent_operations as usize,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:389:55
|
|
|
|
|
389 | strategy_timeout: Duration::from_secs(self.strategy_timeout_secs as u64),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:392:38
|
|
|
|
|
392 | max_parallel_models: self.max_parallel_models as usize,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:393:59
|
|
|
|
|
393 | rebalancing_interval: Duration::from_secs(self.rebalancing_interval_secs as u64),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:409:29
|
|
|
|
|
409 | book_depth: self.book_depth as usize,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:410:30
|
|
|
|
|
410 | vpin_window: self.vpin_window as usize,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:419:34
|
|
|
|
|
419 | lookback_window: self.regime_lookback_window as usize,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:427:52
|
|
|
|
|
427 | order_timeout: Duration::from_secs(self.order_timeout_secs as u64),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:479:38
|
|
|
|
|
479 | "execution_interval_ms": config.general.execution_interval.as_millis() as i32,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:480:44
|
|
|
|
|
480 | "error_backoff_duration_secs": config.general.error_backoff_duration.as_secs() as i32,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:481:42
|
|
|
|
|
481 | "max_concurrent_operations": config.general.max_concurrent_operations as i32,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:482:38
|
|
|
|
|
482 | "strategy_timeout_secs": config.general.strategy_timeout.as_secs() as i32,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:485:36
|
|
|
|
|
485 | "max_parallel_models": config.ensemble.max_parallel_models as i32,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:486:42
|
|
|
|
|
486 | "rebalancing_interval_secs": config.ensemble.rebalancing_interval.as_secs() as i32,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:500:27
|
|
|
|
|
500 | "book_depth": config.microstructure.book_depth as i32,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:501:28
|
|
|
|
|
501 | "vpin_window": config.microstructure.vpin_window as i32,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:508:39
|
|
|
|
|
508 | "regime_lookback_window": config.regime.lookback_window as i32,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/config_types.rs:516:35
|
|
|
|
|
516 | "order_timeout_secs": config.execution.order_timeout.as_secs() as i32,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/config_types.rs:558:43
|
|
|
|
|
558 | if self.risk.max_position_size <= 0.0 || self.risk.max_position_size > 1.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
= note: requested on the command line with `-W clippy::default-numeric-fallback`
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/config_types.rs:558:80
|
|
|
|
|
558 | if self.risk.max_position_size <= 0.0 || self.risk.max_position_size > 1.0 {
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/config_types.rs:565:38
|
|
|
|
|
565 | if self.risk.max_leverage <= 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/config_types.rs:572:40
|
|
|
|
|
572 | if self.risk.kelly_fraction <= 0.0 || self.risk.kelly_fraction > 1.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/config_types.rs:572:74
|
|
|
|
|
572 | if self.risk.kelly_fraction <= 0.0 || self.risk.kelly_fraction > 1.0 {
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/config_types.rs:580:45
|
|
|
|
|
580 | if self.ensemble.min_model_weight < 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/config_types.rs:581:49
|
|
|
|
|
581 | || self.ensemble.max_model_weight > 1.0
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/config_types.rs:591:50
|
|
|
|
|
591 | if self.execution.dark_pool_preference < 0.0 || self.execution.dark_pool_preference > 1.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/config_types.rs:591:95
|
|
|
|
|
591 | if self.execution.dark_pool_preference < 0.0 || self.execution.dark_pool_preference > 1.0
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/config_types.rs:601:41
|
|
|
|
|
601 | if (total_weight - 1.0).abs() > 0.01 {
|
|
| ^^^^ help: consider adding suffix: `0.01_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/config_types.rs:601:12
|
|
|
|
|
601 | if (total_weight - 1.0).abs() > 0.01 {
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
= note: requested on the command line with `-W clippy::float-arithmetic`
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/database_loader.rs:4:10
|
|
|
|
|
4 | //! from PostgreSQL, replacing hardcoded defaults with database-driven config.
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
4 - //! from PostgreSQL, replacing hardcoded defaults with database-driven config.
|
|
4 + //! from `PostgreSQL`, replacing hardcoded defaults with database-driven config.
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/database_loader.rs:8:30
|
|
|
|
|
8 | //! - Hot-reload support via PostgreSQL NOTIFY/LISTEN
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
8 - //! - Hot-reload support via PostgreSQL NOTIFY/LISTEN
|
|
8 + //! - Hot-reload support via `PostgreSQL` NOTIFY/LISTEN
|
|
|
|
|
|
|
warning: variable does not need to be mutable
|
|
--> trading_engine/src/compliance/audit_trails.rs:330:9
|
|
|
|
|
330 | mut receiver: mpsc::UnboundedReceiver<TransactionAuditEvent>,
|
|
| ----^^^^^^^^
|
|
| |
|
|
| help: remove this `mut`
|
|
|
|
|
= note: `#[warn(unused_mut)]` on by default
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:250:13
|
|
|
|
|
250 | /// New ConfidenceAggregator instance
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
250 - /// New ConfidenceAggregator instance
|
|
250 + /// New `ConfidenceAggregator` instance
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:259:18
|
|
|
|
|
259 | vec![0.68, 0.95, 0.99],
|
|
| ^^^^ help: consider adding suffix: `0.68_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:259:24
|
|
|
|
|
259 | vec![0.68, 0.95, 0.99],
|
|
| ^^^^ help: consider adding suffix: `0.95_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:259:30
|
|
|
|
|
259 | vec![0.68, 0.95, 0.99],
|
|
| ^^^^ help: consider adding suffix: `0.99_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:394:32
|
|
|
|
|
394 | let mut weighted_sum = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:395:32
|
|
|
|
|
395 | let mut total_weight = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:399:74
|
|
|
|
|
399 | let base_weight = weights.get(model_name).copied().unwrap_or(0.0);
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:400:85
|
|
|
|
|
400 | let reliability = reliability_scores.get(model_name).copied().unwrap_or(0.5);
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:426:28
|
|
|
|
|
426 | if total_weight == 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:404:17
|
|
|
|
|
404 | base_weight * reliability
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:409:41
|
|
|
|
|
409 | let weighted_contribution = prediction.value * final_weight;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:410:13
|
|
|
|
|
410 | weighted_sum += weighted_contribution;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:411:13
|
|
|
|
|
411 | total_weight += final_weight;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:430:35
|
|
|
|
|
430 | let ensemble_prediction = weighted_sum / total_weight;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:436:5
|
|
|
|
|
436 | / fn filter_outliers(
|
|
437 | | &self,
|
|
438 | | predictions: HashMap<String, ModelPrediction>,
|
|
439 | | ) -> Result<HashMap<String, ModelPrediction>> {
|
|
| |_________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
= note: requested on the command line with `-W clippy::unnecessary-wraps`
|
|
help: remove `Result` from the return type...
|
|
|
|
|
439 - ) -> Result<HashMap<String, ModelPrediction>> {
|
|
439 + ) -> std::collections::HashMap<std::string::String, models::ModelPrediction> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
441 ~ return predictions; // Need at least 3 predictions for outlier detection
|
|
442 | }
|
|
...
|
|
465 | warn!("All predictions were filtered as outliers, using original set");
|
|
466 ~ predictions
|
|
467 | } else {
|
|
468 ~ filtered
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:445:20
|
|
|
|
|
445 | let mean = values.iter().sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:445:49
|
|
|
|
|
445 | let mean = values.iter().sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:446:24
|
|
|
|
|
446 | let variance = values.iter().map(|v| (v - mean).powi(2)).sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:446:81
|
|
|
|
|
446 | let variance = values.iter().map(|v| (v - mean).powi(2)).sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:450:25
|
|
|
|
|
450 | let threshold = self.config.outlier_threshold * std_dev;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:453:16
|
|
|
|
|
453 | if (prediction.value - mean).abs() <= threshold {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:473:5
|
|
|
|
|
473 | / fn calculate_uncertainty_bounds(
|
|
474 | | &self,
|
|
475 | | prediction: f64,
|
|
476 | | uncertainty: &UncertaintyDecomposition,
|
|
477 | | ) -> Result<(f64, f64)> {
|
|
| |___________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
477 - ) -> Result<(f64, f64)> {
|
|
477 + ) -> (f64, f64) {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
483 - Ok((lower_bound, upper_bound))
|
|
483 + (lower_bound, upper_bound)
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:479:33
|
|
|
|
|
479 | let uncertainty_width = 2.0 * uncertainty.total;
|
|
| ^^^ help: consider adding suffix: `2.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:479:33
|
|
|
|
|
479 | let uncertainty_width = 2.0 * uncertainty.total;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:480:27
|
|
|
|
|
480 | let lower_bound = prediction - uncertainty_width;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:481:27
|
|
|
|
|
481 | let upper_bound = prediction + uncertainty_width;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:487:5
|
|
|
|
|
487 | / fn calculate_ensemble_reliability(
|
|
488 | | &self,
|
|
489 | | reliability_scores: &HashMap<String, f64>,
|
|
490 | | weights: &HashMap<String, f64>,
|
|
491 | | ) -> Result<f64> {
|
|
| |____________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
491 - ) -> Result<f64> {
|
|
491 + ) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
503 ~ weighted_reliability / total_weight
|
|
504 | } else {
|
|
505 ~ 0.5 // Default reliability
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:492:40
|
|
|
|
|
492 | let mut weighted_reliability = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:493:32
|
|
|
|
|
493 | let mut total_weight = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:497:17
|
|
|
|
|
497 | weighted_reliability += reliability * weight;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:498:17
|
|
|
|
|
498 | total_weight += weight;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:503:16
|
|
|
|
|
503 | Ok(weighted_reliability / total_weight)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:510:5
|
|
|
|
|
510 | / fn compute_ensemble_confidence(
|
|
511 | | &self,
|
|
512 | | uncertainty: &UncertaintyDecomposition,
|
|
513 | | reliability: f64,
|
|
514 | | ) -> Result<f64> {
|
|
| |____________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
514 - ) -> Result<f64> {
|
|
514 + ) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
519 - Ok(confidence)
|
|
519 + confidence
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:516:34
|
|
|
|
|
516 | let uncertainty_factor = 1.0 - (uncertainty.total / (1.0 + uncertainty.total));
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:516:62
|
|
|
|
|
516 | let uncertainty_factor = 1.0 - (uncertainty.total / (1.0 + uncertainty.total));
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:516:34
|
|
|
|
|
516 | let uncertainty_factor = 1.0 - (uncertainty.total / (1.0 + uncertainty.total));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: clamp-like pattern without using clamp function
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:517:26
|
|
|
|
|
517 | let confidence = (uncertainty_factor * reliability).max(0.0).min(1.0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(uncertainty_factor * reliability).clamp(0.0, 1.0)`
|
|
|
|
|
= note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
|
|
= note: clamp returns NaN if the input is NaN
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp
|
|
= note: `-W clippy::manual-clamp` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::manual_clamp)]`
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:517:26
|
|
|
|
|
517 | let confidence = (uncertainty_factor * reliability).max(0.0).min(1.0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:533:67
|
|
|
|
|
533 | let spread = values.iter().map(|v| (v - mean).abs()).fold(0.0, f64::max);
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:532:20
|
|
|
|
|
532 | let mean = values.iter().sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:532:49
|
|
|
|
|
532 | let mean = values.iter().sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:533:44
|
|
|
|
|
533 | let spread = values.iter().map(|v| (v - mean).abs()).fold(0.0, f64::max);
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:535:38
|
|
|
|
|
535 | let disagreement_magnitude = spread / mean.abs().max(1e-6);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:588:21
|
|
|
|
|
588 | let total = (epistemic.powi(2) + aleatoric.powi(2) + disagreement.powi(2)).sqrt();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:610:20
|
|
|
|
|
610 | let mean = values.iter().sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:610:49
|
|
|
|
|
610 | let mean = values.iter().sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:611:24
|
|
|
|
|
611 | let variance = values.iter().map(|v| (v - mean).powi(2)).sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:611:81
|
|
|
|
|
611 | let variance = values.iter().map(|v| (v - mean).powi(2)).sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:624:22
|
|
|
|
|
624 | .map(|p| 1.0 - p.confidence) // Convert confidence to uncertainty
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:624:22
|
|
|
|
|
624 | .map(|p| 1.0 - p.confidence) // Convert confidence to uncertainty
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:631:32
|
|
|
|
|
631 | let mean_uncertainty = uncertainties.iter().sum::<f64>() / uncertainties.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:631:68
|
|
|
|
|
631 | let mean_uncertainty = uncertainties.iter().sum::<f64>() / uncertainties.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:636:5
|
|
|
|
|
636 | / fn calculate_disagreement_uncertainty(
|
|
637 | | &self,
|
|
638 | | _predictions: &HashMap<String, ModelPrediction>,
|
|
639 | | ) -> Result<f64> {
|
|
| |____________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
639 - ) -> Result<f64> {
|
|
639 + ) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
641 - Ok(recent_disagreement)
|
|
641 + recent_disagreement
|
|
|
|
|
|
|
warning: use of `or_insert_with` to construct default value
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:664:14
|
|
|
|
|
664 | .or_insert_with(Vec::new);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
|
|
= note: `-W clippy::unwrap-or-default` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::unwrap_or_default)]`
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:702:32
|
|
|
|
|
702 | let mut weighted_sum = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:703:30
|
|
|
|
|
703 | let mut weight_sum = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:711:90
|
|
|
|
|
711 | (record.accuracy + record.calibration + record.confidence_reliability) / 3.0;
|
|
| ^^^ help: consider adding suffix: `3.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:707:23
|
|
|
|
|
707 | let age = (current_time - record.timestamp).num_hours() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:707:23
|
|
|
|
|
707 | let age = (current_time - record.timestamp).num_hours() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
= note: requested on the command line with `-W clippy::arithmetic-side-effects`
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:708:49
|
|
|
|
|
708 | let weight = self.decay_factor.powf(age / 24.0); // Daily decay
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:711:17
|
|
|
|
|
711 | (record.accuracy + record.calibration + record.confidence_reliability) / 3.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:712:13
|
|
|
|
|
712 | weighted_sum += reliability_score * weight;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:713:13
|
|
|
|
|
713 | weight_sum += weight;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: clamp-like pattern without using clamp function
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:722:13
|
|
|
|
|
722 | (weighted_sum / weight_sum).max(0.0).min(1.0)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(weighted_sum / weight_sum).clamp(0.0, 1.0)`
|
|
|
|
|
= note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
|
|
= note: clamp returns NaN if the input is NaN
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:722:13
|
|
|
|
|
722 | (weighted_sum / weight_sum).max(0.0).min(1.0)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:731:5
|
|
|
|
|
731 | / pub fn new(
|
|
732 | | combination_method: CombinationMethod,
|
|
733 | | confidence_levels: Vec<f64>,
|
|
734 | | calibration_params: CalibrationParams,
|
|
... |
|
|
741 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
= note: requested on the command line with `-W clippy::missing-const-for-fn`
|
|
help: make the function `const`
|
|
|
|
|
731 | pub const fn new(
|
|
| +++++
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:761:5
|
|
|
|
|
761 | / fn compute_combined_interval(
|
|
762 | | &self,
|
|
763 | | predictions: &HashMap<String, ModelPrediction>,
|
|
764 | | _weights: &HashMap<String, f64>,
|
|
765 | | confidence_level: f64,
|
|
766 | | ) -> Result<PredictionInterval> {
|
|
| |___________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
766 - ) -> Result<PredictionInterval> {
|
|
766 + ) -> ensemble::confidence_aggregator::PredictionInterval {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
788 ~ PredictionInterval {
|
|
789 + confidence_level,
|
|
790 + lower_bound,
|
|
791 + upper_bound,
|
|
792 + width,
|
|
793 + }
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:776:23
|
|
|
|
|
776 | x if x >= 0.99 => 2.576,
|
|
| ^^^^ help: consider adding suffix: `0.99_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:776:31
|
|
|
|
|
776 | x if x >= 0.99 => 2.576,
|
|
| ^^^^^ help: consider adding suffix: `2.576_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:777:23
|
|
|
|
|
777 | x if x >= 0.95 => 1.96,
|
|
| ^^^^ help: consider adding suffix: `0.95_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:777:31
|
|
|
|
|
777 | x if x >= 0.95 => 1.96,
|
|
| ^^^^ help: consider adding suffix: `1.96_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:778:23
|
|
|
|
|
778 | x if x >= 0.90 => 1.645,
|
|
| ^^^^ help: consider adding suffix: `0.90_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:778:31
|
|
|
|
|
778 | x if x >= 0.90 => 1.645,
|
|
| ^^^^^ help: consider adding suffix: `1.645_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:779:23
|
|
|
|
|
779 | x if x >= 0.68 => 1.0,
|
|
| ^^^^ help: consider adding suffix: `0.68_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:779:31
|
|
|
|
|
779 | x if x >= 0.68 => 1.0,
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:780:18
|
|
|
|
|
780 | _ => 1.96,
|
|
| ^^^^ help: consider adding suffix: `1.96_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:769:20
|
|
|
|
|
769 | let mean = values.iter().sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:769:49
|
|
|
|
|
769 | let mean = values.iter().sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:771:24
|
|
|
|
|
771 | let variance = values.iter().map(|v| (v - mean).powi(2)).sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:771:81
|
|
|
|
|
771 | let variance = values.iter().map(|v| (v - mean).powi(2)).sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:783:22
|
|
|
|
|
783 | let margin = z_score * std_dev;
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:784:27
|
|
|
|
|
784 | let lower_bound = mean - margin;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:785:27
|
|
|
|
|
785 | let upper_bound = mean + margin;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:786:21
|
|
|
|
|
786 | let width = upper_bound - lower_bound;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:799:5
|
|
|
|
|
799 | / pub fn new(max_history_length: usize, warning_threshold: f64) -> Self {
|
|
800 | | Self {
|
|
801 | | disagreement_history: Vec::new(),
|
|
802 | | max_history_length,
|
|
... |
|
|
805 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
799 | pub const fn new(max_history_length: usize, warning_threshold: f64) -> Self {
|
|
| +++++
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:823:32
|
|
|
|
|
823 | let mut weighted_sum = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:824:30
|
|
|
|
|
824 | let mut weight_sum = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:827:39
|
|
|
|
|
827 | let weight = 0.9_f64.powi(i as i32);
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:828:13
|
|
|
|
|
828 | weighted_sum += record.magnitude * weight;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:829:13
|
|
|
|
|
829 | weight_sum += weight;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/confidence_aggregator.rs:833:13
|
|
|
|
|
833 | weighted_sum / weight_sum
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:106:9
|
|
|
|
|
106 | /// VaR weight
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
106 - /// VaR weight
|
|
106 + /// `VaR` weight
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:178:13
|
|
|
|
|
178 | /// New WeightOptimizer instance
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
178 - /// New WeightOptimizer instance
|
|
178 + /// New `WeightOptimizer` instance
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:190:82
|
|
|
|
|
190 | algorithm_weights.insert(WeightingAlgorithmType::BayesianModelAveraging, 0.4);
|
|
| ^^^ help: consider adding suffix: `0.4_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:191:76
|
|
|
|
|
191 | algorithm_weights.insert(WeightingAlgorithmType::ExponentialDecay, 0.3);
|
|
| ^^^ help: consider adding suffix: `0.3_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:192:72
|
|
|
|
|
192 | algorithm_weights.insert(WeightingAlgorithmType::RiskAdjusted, 0.2);
|
|
| ^^^ help: consider adding suffix: `0.2_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:193:79
|
|
|
|
|
193 | algorithm_weights.insert(WeightingAlgorithmType::VolatilityTargeting, 0.1);
|
|
| ^^^ help: consider adding suffix: `0.1_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: use of `or_insert_with` to construct default value
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:269:14
|
|
|
|
|
269 | .or_insert_with(Vec::new);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:274:13
|
|
|
|
|
274 | chrono::Utc::now() - chrono::Duration::from_std(self.performance_window).unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: used `unwrap()` on a `Result` value
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:274:34
|
|
|
|
|
274 | chrono::Utc::now() - chrono::Duration::from_std(self.performance_window).unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: if this value is an `Err`, it will panic
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
|
note: the lint level is defined here
|
|
--> adaptive-strategy/src/lib.rs:2:9
|
|
|
|
|
2 | #![deny(clippy::unwrap_used)]
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:320:35
|
|
|
|
|
320 | let mut total_posterior = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:329:30
|
|
|
|
|
329 | if total_posterior > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:335:32
|
|
|
|
|
335 | let equal_weight = 1.0 / model_names.len() as f64;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:325:13
|
|
|
|
|
325 | total_posterior += posterior;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:331:17
|
|
|
|
|
331 | *weight /= total_posterior;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:335:32
|
|
|
|
|
335 | let equal_weight = 1.0 / model_names.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:335:38
|
|
|
|
|
335 | let equal_weight = 1.0 / model_names.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:345:5
|
|
|
|
|
345 | fn calculate_bayesian_posterior(&self, model_name: &str, config: &BMAConfig) -> Result<f64> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
345 - fn calculate_bayesian_posterior(&self, model_name: &str, config: &BMAConfig) -> Result<f64> {
|
|
345 + fn calculate_bayesian_posterior(&self, model_name: &str, config: &BMAConfig) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
354 ~ return config.alpha / (config.alpha + config.beta);
|
|
355 | }
|
|
...
|
|
371 |
|
|
372 ~ (discounted_posterior * (1.0 - complexity_penalty)).max(0.001)
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:367:16
|
|
|
|
|
367 | * (1.0 - config.uncertainty_discount * uncertainty);
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:354:23
|
|
|
|
|
354 | return Ok(config.alpha / (config.alpha + config.beta));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:358:25
|
|
|
|
|
358 | let successes = history.iter().filter(|p| p.accuracy > 0.5).count() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:358:64
|
|
|
|
|
358 | let successes = history.iter().filter(|p| p.accuracy > 0.5).count() as f64;
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:359:22
|
|
|
|
|
359 | let trials = history.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:361:31
|
|
|
|
|
361 | let posterior_alpha = config.alpha + successes;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:362:30
|
|
|
|
|
362 | let posterior_beta = config.beta + trials - successes;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:366:36
|
|
|
|
|
366 | let discounted_posterior = (posterior_alpha / (posterior_alpha + posterior_beta))
|
|
| ____________________________________^
|
|
367 | | * (1.0 - config.uncertainty_discount * uncertainty);
|
|
| |_______________________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:370:34
|
|
|
|
|
370 | let complexity_penalty = config.complexity_penalty * self.get_model_complexity(model_name);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:372:12
|
|
|
|
|
372 | Ok((discounted_posterior * (1.0 - complexity_penalty)).max(0.001))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:395:44
|
|
|
|
|
395 | let mut weighted_performance = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:396:36
|
|
|
|
|
396 | let mut total_weight = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:409:79
|
|
|
|
|
409 | let recency_factor = if i < 5 { config.recency_boost } else { 1.0 };
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:416:55
|
|
|
|
|
416 | let performance_score = if total_weight > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:419:17
|
|
|
|
|
419 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:405:27
|
|
|
|
|
405 | let age = (current_time - record.timestamp).num_minutes() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:405:27
|
|
|
|
|
405 | let age = (current_time - record.timestamp).num_minutes() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:406:36
|
|
|
|
|
406 | let decay_weight = (-age / config.decay_rate).exp();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:410:36
|
|
|
|
|
410 | let final_weight = decay_weight * recency_factor;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:412:17
|
|
|
|
|
412 | weighted_performance += record.sharpe_ratio * final_weight;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:413:17
|
|
|
|
|
413 | total_weight += final_weight;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:417:17
|
|
|
|
|
417 | weighted_performance / total_weight
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:422:26
|
|
|
|
|
422 | let weight = (performance_score.max(0.0) + config.min_weight).min(1.0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:446:28
|
|
|
|
|
446 | .unwrap_or(0.5);
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:451:20
|
|
|
|
|
451 | + (1.0 - config.smoothing_factor) * regime_performance;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:450:35
|
|
|
|
|
450 | let smoothed_weight = config.smoothing_factor * regime_preference
|
|
| ___________________________________^
|
|
451 | | + (1.0 - config.smoothing_factor) * regime_performance;
|
|
| |______________________________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:475:52
|
|
|
|
|
475 | weights.insert(model_name.clone(), 1.0 / model_names.len() as f64);
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:475:52
|
|
|
|
|
475 | weights.insert(model_name.clone(), 1.0 / model_names.len() as f64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:475:58
|
|
|
|
|
475 | weights.insert(model_name.clone(), 1.0 / model_names.len() as f64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:486:30
|
|
|
|
|
486 | let risk_score = config.sharpe_weight * sharpe_ratio.max(0.0)
|
|
| ______________________________^
|
|
487 | | - config.drawdown_weight * max_drawdown.abs()
|
|
488 | | - config.var_weight * var_95.abs()
|
|
489 | | - config.volatility_adjustment * volatility;
|
|
| |___________________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:514:52
|
|
|
|
|
514 | weights.insert(model_name.clone(), 1.0 / model_names.len() as f64);
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:522:56
|
|
|
|
|
522 | let vol_adjustment = if model_volatility > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:525:17
|
|
|
|
|
525 | 1.0
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:514:52
|
|
|
|
|
514 | weights.insert(model_name.clone(), 1.0 / model_names.len() as f64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:514:58
|
|
|
|
|
514 | weights.insert(model_name.clone(), 1.0 / model_names.len() as f64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: slicing may panic
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:518:35
|
|
|
|
|
518 | let recent_history = &history[history.len().saturating_sub(config.estimation_window)..];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n..)` or .get_mut(n..)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
= note: requested on the command line with `-W clippy::indexing-slicing`
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:523:17
|
|
|
|
|
523 | config.target_volatility / model_volatility
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: clamp-like pattern without using clamp function
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:528:26
|
|
|
|
|
528 | let weight = vol_adjustment.min(2.0).max(0.1); // Cap weights
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `vol_adjustment.clamp(0.1, 2.0)`
|
|
|
|
|
= note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
|
|
= note: clamp returns NaN if the input is NaN
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:536:5
|
|
|
|
|
536 | / fn combine_algorithm_results(
|
|
537 | | &self,
|
|
538 | | algorithm_results: HashMap<WeightingAlgorithmType, HashMap<String, f64>>,
|
|
539 | | ) -> Result<HashMap<String, f64>> {
|
|
| |_____________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
539 - ) -> Result<HashMap<String, f64>> {
|
|
539 + ) -> std::collections::HashMap<std::string::String, f64> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
574 - Ok(combined_weights)
|
|
574 + combined_weights
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:550:36
|
|
|
|
|
550 | let mut weighted_sum = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:551:46
|
|
|
|
|
551 | let mut total_algorithm_weight = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:559:36
|
|
|
|
|
559 | .unwrap_or(0.0);
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:565:60
|
|
|
|
|
565 | let final_weight = if total_algorithm_weight > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:568:17
|
|
|
|
|
568 | 1.0 / model_names.len() as f64
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:560:21
|
|
|
|
|
560 | weighted_sum += model_weight * algorithm_weight;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:561:21
|
|
|
|
|
561 | total_algorithm_weight += algorithm_weight;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:566:17
|
|
|
|
|
566 | weighted_sum / total_algorithm_weight
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:568:17
|
|
|
|
|
568 | 1.0 / model_names.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:568:23
|
|
|
|
|
568 | 1.0 / model_names.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:578:5
|
|
|
|
|
578 | fn normalize_weights(&self, mut weights: HashMap<String, f64>) -> Result<HashMap<String, f64>> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
578 - fn normalize_weights(&self, mut weights: HashMap<String, f64>) -> Result<HashMap<String, f64>> {
|
|
578 + fn normalize_weights(&self, mut weights: HashMap<String, f64>) -> std::collections::HashMap<std::string::String, f64> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
593 - Ok(weights)
|
|
593 + weights
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:581:21
|
|
|
|
|
581 | if total <= 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:583:32
|
|
|
|
|
583 | let equal_weight = 1.0 / weights.len() as f64;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:583:32
|
|
|
|
|
583 | let equal_weight = 1.0 / weights.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:583:38
|
|
|
|
|
583 | let equal_weight = 1.0 / weights.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:589:17
|
|
|
|
|
589 | *weight /= total;
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:597:5
|
|
|
|
|
597 | fn calculate_weight_confidence(&self, weights: &HashMap<String, f64>) -> Result<f64> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
597 - fn calculate_weight_confidence(&self, weights: &HashMap<String, f64>) -> Result<f64> {
|
|
597 + fn calculate_weight_confidence(&self, weights: &HashMap<String, f64>) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
602 - Ok((1.0 - entropy) * stability)
|
|
602 + (1.0 - entropy) * stability
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:602:12
|
|
|
|
|
602 | Ok((1.0 - entropy) * stability)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:606:5
|
|
|
|
|
606 | fn calculate_expected_variance(&self, weights: &HashMap<String, f64>) -> Result<f64> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
606 - fn calculate_expected_variance(&self, weights: &HashMap<String, f64>) -> Result<f64> {
|
|
606 + fn calculate_expected_variance(&self, weights: &HashMap<String, f64>) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
620 - Ok(weighted_variance)
|
|
620 + weighted_variance
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:608:37
|
|
|
|
|
608 | let mut weighted_variance = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:617:13
|
|
|
|
|
617 | weighted_variance += weight * weight * model_variance;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:630:13
|
|
|
|
|
630 | history.iter().map(|p| p.confidence).sum::<f64>() / history.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:630:65
|
|
|
|
|
630 | history.iter().map(|p| p.confidence).sum::<f64>() / history.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:631:24
|
|
|
|
|
631 | let variance = history
|
|
| ________________________^
|
|
632 | | .iter()
|
|
633 | | .map(|p| (p.confidence - mean_confidence).powi(2))
|
|
634 | | .sum::<f64>()
|
|
635 | | / history.len() as f64;
|
|
| |__________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:635:15
|
|
|
|
|
635 | / history.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:640:5
|
|
|
|
|
640 | / fn get_model_complexity(&self, _model_name: &str) -> f64 {
|
|
641 | | // Production - would calculate based on model parameters
|
|
642 | | 0.1
|
|
643 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
640 | const fn get_model_complexity(&self, _model_name: &str) -> f64 {
|
|
| +++++
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:645:5
|
|
|
|
|
645 | fn calculate_regime_performance(&self, model_name: &str, regime: &str) -> Result<f64> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
645 - fn calculate_regime_performance(&self, model_name: &str, regime: &str) -> Result<f64> {
|
|
645 + fn calculate_regime_performance(&self, model_name: &str, regime: &str) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
658 ~ return 0.5;
|
|
659 | }
|
|
...
|
|
663 |
|
|
664 ~ avg_performance
|
|
|
|
|
|
|
warning: this `map_or` can be simplified
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:654:25
|
|
|
|
|
654 | .filter(|p| p.regime.as_ref().map_or(false, |r| r == regime))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or
|
|
= note: `-W clippy::unnecessary-map-or` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::unnecessary_map_or)]`
|
|
help: use is_some_and instead
|
|
|
|
|
654 - .filter(|p| p.regime.as_ref().map_or(false, |r| r == regime))
|
|
654 + .filter(|p| p.regime.as_ref().is_some_and(|r| r == regime))
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:662:13
|
|
|
|
|
662 | regime_records.iter().map(|p| p.accuracy).sum::<f64>() / regime_records.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:662:70
|
|
|
|
|
662 | regime_records.iter().map(|p| p.accuracy).sum::<f64>() / regime_records.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:671:9
|
|
|
|
|
671 | history.iter().map(|p| p.sharpe_ratio).sum::<f64>() / history.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:671:63
|
|
|
|
|
671 | history.iter().map(|p| p.sharpe_ratio).sum::<f64>() / history.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: used `unwrap()` on an `Option` value
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:687:32
|
|
|
|
|
687 | returns.sort_by(|a, b| a.partial_cmp(b).unwrap());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: if this value is `None`, it will panic
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:689:21
|
|
|
|
|
689 | let index = (returns.len() as f64 * 0.05).floor() as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:689:21
|
|
|
|
|
689 | let index = (returns.len() as f64 * 0.05).floor() as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:689:22
|
|
|
|
|
689 | let index = (returns.len() as f64 * 0.05).floor() as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:699:13
|
|
|
|
|
699 | history.iter().map(|p| p.return_value).sum::<f64>() / history.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:699:67
|
|
|
|
|
699 | history.iter().map(|p| p.return_value).sum::<f64>() / history.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:700:24
|
|
|
|
|
700 | let variance = history
|
|
| ________________________^
|
|
701 | | .iter()
|
|
702 | | .map(|p| (p.return_value - mean_return).powi(2))
|
|
703 | | .sum::<f64>()
|
|
704 | | / (history.len() - 1) as f64;
|
|
| |________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:704:15
|
|
|
|
|
704 | / (history.len() - 1) as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:704:15
|
|
|
|
|
704 | / (history.len() - 1) as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:710:27
|
|
|
|
|
710 | let mut entropy = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:712:25
|
|
|
|
|
712 | if weight > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:713:17
|
|
|
|
|
713 | entropy -= weight * weight.ln();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:716:9
|
|
|
|
|
716 | entropy / (weights.len() as f64).ln()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:716:19
|
|
|
|
|
716 | entropy / (weights.len() as f64).ln()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:719:5
|
|
|
|
|
719 | / fn calculate_weight_stability(&self, _weights: &HashMap<String, f64>) -> f64 {
|
|
720 | | // Production - would compare with historical weights
|
|
721 | | 0.8
|
|
722 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
719 | const fn calculate_weight_stability(&self, _weights: &HashMap<String, f64>) -> f64 {
|
|
| +++++
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:727:5
|
|
|
|
|
727 | / pub fn get_type(&self) -> WeightingAlgorithmType {
|
|
728 | | match self {
|
|
729 | | WeightingAlgorithm::BayesianModelAveraging(_) => {
|
|
730 | | WeightingAlgorithmType::BayesianModelAveraging
|
|
... |
|
|
739 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
727 | pub const fn get_type(&self) -> WeightingAlgorithmType {
|
|
| +++++
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:746:86
|
|
|
|
|
746 | algorithm_performance.insert(WeightingAlgorithmType::BayesianModelAveraging, 0.5);
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:747:80
|
|
|
|
|
747 | algorithm_performance.insert(WeightingAlgorithmType::ExponentialDecay, 0.5);
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:748:76
|
|
|
|
|
748 | algorithm_performance.insert(WeightingAlgorithmType::RiskAdjusted, 0.5);
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:749:83
|
|
|
|
|
749 | algorithm_performance.insert(WeightingAlgorithmType::VolatilityTargeting, 0.5);
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: used `unwrap()` on an `Option` value
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:761:38
|
|
|
|
|
761 | .max_by(|(_, a), (_, b)| a.partial_cmp(b).unwrap())
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: if this value is `None`, it will panic
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:770:53
|
|
|
|
|
770 | self.learning_rate * performance + (1.0 - self.learning_rate) * *current_perf;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/weight_optimizer.rs:770:17
|
|
|
|
|
770 | self.learning_rate * performance + (1.0 - self.learning_rate) * *current_perf;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/ensemble/mod.rs:38:12
|
|
|
|
|
38 | pub struct EnsembleCoordinator {
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/ensemble/mod.rs:47:59
|
|
|
|
|
47 | /// Model performance tracking (legacy - migrating to weight_optimizer)
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
47 - /// Model performance tracking (legacy - migrating to weight_optimizer)
|
|
47 + /// Model performance tracking (legacy - migrating to `weight_optimizer`)
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/ensemble/mod.rs:49:64
|
|
|
|
|
49 | /// Prediction history for analysis (legacy - migrating to confidence_aggregator)
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
49 - /// Prediction history for analysis (legacy - migrating to confidence_aggregator)
|
|
49 + /// Prediction history for analysis (legacy - migrating to `confidence_aggregator`)
|
|
|
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/ensemble/mod.rs:96:12
|
|
|
|
|
96 | pub struct EnsemblePrediction {
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: the function has a cognitive complexity of (31/30)
|
|
--> adaptive-strategy/src/ensemble/mod.rs:200:18
|
|
|
|
|
200 | pub async fn predict_with_uncertainty(
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cognitive_complexity
|
|
= note: requested on the command line with `-W clippy::cognitive-complexity`
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/mod.rs:371:21
|
|
|
|
|
371 | 1.0 - (predicted_value - actual_outcome).abs() / actual_outcome.abs().max(1e-6);
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/mod.rs:396:21
|
|
|
|
|
396 | 1.0 - (predicted_value - actual_outcome).abs() / actual_outcome.abs().max(1e-6);
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/mod.rs:371:21
|
|
|
|
|
371 | 1.0 - (predicted_value - actual_outcome).abs() / actual_outcome.abs().max(1e-6);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: clamp-like pattern without using clamp function
|
|
--> adaptive-strategy/src/ensemble/mod.rs:372:32
|
|
|
|
|
372 | let accuracy = accuracy.max(0.0).min(1.0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `accuracy.clamp(0.0, 1.0)`
|
|
|
|
|
= note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
|
|
= note: clamp returns NaN if the input is NaN
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp
|
|
|
|
error: `accuracy` is shadowed
|
|
--> adaptive-strategy/src/ensemble/mod.rs:372:21
|
|
|
|
|
372 | let accuracy = accuracy.max(0.0).min(1.0);
|
|
| ^^^^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> adaptive-strategy/src/ensemble/mod.rs:370:21
|
|
|
|
|
370 | let accuracy =
|
|
| ^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_reuse
|
|
= note: requested on the command line with `-D clippy::shadow-reuse`
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/mod.rs:380:35
|
|
|
|
|
380 | return_value: (predicted_value - actual_outcome)
|
|
| ___________________________________^
|
|
381 | | / actual_outcome.abs().max(1e-6),
|
|
| |________________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/mod.rs:396:21
|
|
|
|
|
396 | 1.0 - (predicted_value - actual_outcome).abs() / actual_outcome.abs().max(1e-6);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: clamp-like pattern without using clamp function
|
|
--> adaptive-strategy/src/ensemble/mod.rs:397:32
|
|
|
|
|
397 | let accuracy = accuracy.max(0.0).min(1.0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `accuracy.clamp(0.0, 1.0)`
|
|
|
|
|
= note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
|
|
= note: clamp returns NaN if the input is NaN
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp
|
|
|
|
error: `accuracy` is shadowed
|
|
--> adaptive-strategy/src/ensemble/mod.rs:397:21
|
|
|
|
|
397 | let accuracy = accuracy.max(0.0).min(1.0);
|
|
| ^^^^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> adaptive-strategy/src/ensemble/mod.rs:395:21
|
|
|
|
|
395 | let accuracy =
|
|
| ^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_reuse
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/mod.rs:458:32
|
|
|
|
|
458 | let mut weighted_sum = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/mod.rs:459:32
|
|
|
|
|
459 | let mut total_weight = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/mod.rs:460:39
|
|
|
|
|
460 | let mut weighted_confidence = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/mod.rs:484:28
|
|
|
|
|
484 | if total_weight == 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/mod.rs:465:43
|
|
|
|
|
465 | let weighted_prediction = prediction.value * weight;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/mod.rs:466:37
|
|
|
|
|
466 | let weighted_conf = prediction.confidence * weight;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/mod.rs:468:17
|
|
|
|
|
468 | weighted_sum += weighted_prediction;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/mod.rs:469:17
|
|
|
|
|
469 | weighted_confidence += weighted_conf;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/mod.rs:470:17
|
|
|
|
|
470 | total_weight += weight;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/mod.rs:488:35
|
|
|
|
|
488 | let ensemble_prediction = weighted_sum / total_weight;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/mod.rs:489:35
|
|
|
|
|
489 | let ensemble_confidence = weighted_confidence / total_weight;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/mod.rs:574:49
|
|
|
|
|
574 | .insert(model_name.clone(), recent_predictions.len() as u64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/mod.rs:593:43
|
|
|
|
|
593 | (p.prediction.value > 0.0 && actual > 0.0)
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/mod.rs:593:59
|
|
|
|
|
593 | (p.prediction.value > 0.0 && actual > 0.0)
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/mod.rs:594:50
|
|
|
|
|
594 | || (p.prediction.value < 0.0 && actual < 0.0)
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/mod.rs:594:66
|
|
|
|
|
594 | || (p.prediction.value < 0.0 && actual < 0.0)
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/mod.rs:601:9
|
|
|
|
|
601 | correct_predictions as f64 / predictions.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/mod.rs:601:9
|
|
|
|
|
601 | correct_predictions as f64 / predictions.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/mod.rs:601:38
|
|
|
|
|
601 | correct_predictions as f64 / predictions.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/ensemble/mod.rs:626:24
|
|
|
|
|
626 | if variance == 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/mod.rs:619:27
|
|
|
|
|
619 | let mean_return = returns.iter().sum::<f64>() / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/mod.rs:619:57
|
|
|
|
|
619 | let mean_return = returns.iter().sum::<f64>() / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/mod.rs:620:24
|
|
|
|
|
620 | let variance = returns
|
|
| ________________________^
|
|
621 | | .iter()
|
|
622 | | .map(|r| (r - mean_return).powi(2))
|
|
623 | | .sum::<f64>()
|
|
624 | | / returns.len() as f64;
|
|
| |__________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/ensemble/mod.rs:624:15
|
|
|
|
|
624 | / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/ensemble/mod.rs:630:9
|
|
|
|
|
630 | mean_return / variance.sqrt()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: you should consider adding a `Default` implementation for `PerformanceTracker`
|
|
--> adaptive-strategy/src/ensemble/mod.rs:636:5
|
|
|
|
|
636 | / pub fn new() -> Self {
|
|
637 | | Self {
|
|
638 | | accuracy: HashMap::new(),
|
|
639 | | precision: HashMap::new(),
|
|
... |
|
|
645 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
= note: `-W clippy::new-without-default` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::new_without_default)]`
|
|
help: try adding this
|
|
|
|
|
634 + impl Default for PerformanceTracker {
|
|
635 + fn default() -> Self {
|
|
636 + Self::new()
|
|
637 + }
|
|
638 + }
|
|
|
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/ensemble/mod.rs:648:5
|
|
|
|
|
648 | / pub fn accuracy(&self) -> &HashMap<String, f64> {
|
|
649 | | &self.accuracy
|
|
650 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
648 | pub const fn accuracy(&self) -> &HashMap<String, f64> {
|
|
| +++++
|
|
|
|
warning: use of `or_insert_with` to construct default value
|
|
--> adaptive-strategy/src/ensemble/mod.rs:664:62
|
|
|
|
|
664 | let predictions = self.predictions.entry(model_name).or_insert_with(Vec::new);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/ensemble/mod.rs:683:20
|
|
|
|
|
683 | if (prediction.timestamp - timestamp).num_seconds().abs() < 60
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/execution/mod.rs:30:12
|
|
|
|
|
30 | pub struct ExecutionEngine {
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/execution/mod.rs:110:12
|
|
|
|
|
110 | pub struct ExecutionPerformanceTracker {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
error: found empty brackets on struct declaration
|
|
--> adaptive-strategy/src/execution/mod.rs:187:28
|
|
|
|
|
187 | pub struct ShortfallTracker {}
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_structs_with_brackets
|
|
= note: requested on the command line with `-D clippy::empty-structs-with-brackets`
|
|
= help: remove the brackets
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/execution/mod.rs:297:12
|
|
|
|
|
297 | pub struct ExecutionRequest {
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/execution/mod.rs:320:12
|
|
|
|
|
320 | pub struct ExecutionResult {
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/execution/mod.rs:337:10
|
|
|
|
|
337 | pub enum ExecutionStatus {
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/execution/mod.rs:352:12
|
|
|
|
|
352 | pub struct ExecutionMetrics {
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/execution/mod.rs:372:11
|
|
|
|
|
372 | pub trait ExecutionAlgorithmTrait: std::fmt::Debug {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:526:27
|
|
|
|
|
526 | algorithms.insert("TWAP".to_string(), Box::new(TWAPAlgorithm::new()?));
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"TWAP".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:527:27
|
|
|
|
|
527 | algorithms.insert("VWAP".to_string(), Box::new(VWAPAlgorithm::new()?));
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"VWAP".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:529:13
|
|
|
|
|
529 | "ImplementationShortfall".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"ImplementationShortfall".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/execution/mod.rs:563:13
|
|
|
|
|
563 | request.side.clone() as u8,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using `clone` on type `OrderSide` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/execution/mod.rs:563:13
|
|
|
|
|
563 | request.side.clone() as u8,
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `request.side`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
= note: `-W clippy::clone-on-copy` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::clone_on_copy)]`
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/execution/mod.rs:601:30
|
|
|
|
|
601 | let execution_time = start_time.elapsed().as_millis() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/execution/mod.rs:649:45
|
|
|
|
|
649 | let timeout = Duration::from_millis(self.config.order_timeout.as_millis() as u64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/execution/mod.rs:681:5
|
|
|
|
|
681 | / fn calculate_execution_metrics(
|
|
682 | | &self,
|
|
683 | | request: &ExecutionRequest,
|
|
684 | | fills: &[Fill],
|
|
685 | | execution_time_ms: f64,
|
|
686 | | ) -> Result<ExecutionMetrics> {
|
|
| |_________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
686 - ) -> Result<ExecutionMetrics> {
|
|
686 + ) -> execution::ExecutionMetrics {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
688 ~ return ExecutionMetrics {
|
|
689 + vwap: 0.0,
|
|
690 + slippage_bps: 0.0,
|
|
691 + implementation_shortfall_bps: 0.0,
|
|
692 + market_impact_bps: 0.0,
|
|
693 + execution_time_ms,
|
|
694 + fill_rate: 0.0,
|
|
695 + child_order_count: 0,
|
|
696 + venue_count: 0,
|
|
697 ~ };
|
|
698 | }
|
|
...
|
|
711 |
|
|
712 ~ ExecutionMetrics {
|
|
713 + vwap,
|
|
714 + slippage_bps: 0.0, // Would calculate based on benchmark
|
|
715 + implementation_shortfall_bps: 0.0, // Would calculate based on decision price
|
|
716 + market_impact_bps: 0.0, // Would calculate based on price movement
|
|
717 + execution_time_ms,
|
|
718 + fill_rate,
|
|
719 + child_order_count: 0, // Would track actual child orders
|
|
720 + venue_count,
|
|
721 + }
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/execution/mod.rs:701:53
|
|
|
|
|
701 | let total_value: f64 = fills.iter().map(|f| f.price * f.quantity).sum();
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/execution/mod.rs:703:20
|
|
|
|
|
703 | let vwap = total_value / total_quantity;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/execution/mod.rs:706:25
|
|
|
|
|
706 | let fill_rate = total_quantity / request.quantity;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/execution/mod.rs:710:27
|
|
|
|
|
710 | let venue_count = venues.len() as u32;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/execution/mod.rs:725:5
|
|
|
|
|
725 | / pub fn get_performance_metrics(&self) -> &HashMap<String, AlgorithmPerformance> {
|
|
726 | | &self.performance_tracker.algorithm_performance
|
|
727 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
725 | pub const fn get_performance_metrics(&self) -> &HashMap<String, AlgorithmPerformance> {
|
|
| +++++
|
|
|
|
warning: you should consider adding a `Default` implementation for `OrderManager`
|
|
--> adaptive-strategy/src/execution/mod.rs:747:5
|
|
|
|
|
747 | / pub fn new() -> Self {
|
|
748 | | Self {
|
|
749 | | active_orders: HashMap::new(),
|
|
750 | | order_history: VecDeque::new(),
|
|
... |
|
|
754 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
745 + impl Default for OrderManager {
|
|
746 + fn default() -> Self {
|
|
747 + Self::new()
|
|
748 + }
|
|
749 + }
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/execution/mod.rs:767:9
|
|
|
|
|
767 | self.next_order_id += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using `clone` on type `OrderStatus` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/execution/mod.rs:817:28
|
|
|
|
|
817 | order.status = status.clone();
|
|
| ^^^^^^^^^^^^^^ help: try removing the `clone` call: `status`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
error: wildcard matches known variants and will also match future added variants
|
|
--> adaptive-strategy/src/execution/mod.rs:835:17
|
|
|
|
|
835 | _ => {},
|
|
| ^ help: try: `OrderStatus::Created | OrderStatus::Submitted | OrderStatus::PartiallyFilled | OrderStatus::New | OrderStatus::Pending | OrderStatus::Working | OrderStatus::Unknown | OrderStatus::Suspended | OrderStatus::PendingCancel | OrderStatus::PendingReplace | _`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_enum_match_arm
|
|
= note: requested on the command line with `-D clippy::wildcard-enum-match-arm`
|
|
|
|
error: `order` shadows a previous, unrelated binding
|
|
--> adaptive-strategy/src/execution/mod.rs:826:33
|
|
|
|
|
826 | if let Some(order) = self.active_orders.remove(order_id) {
|
|
| ^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> adaptive-strategy/src/execution/mod.rs:816:21
|
|
|
|
|
816 | if let Some(order) = self.active_orders.get_mut(order_id) {
|
|
| ^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
|
|
= note: requested on the command line with `-D clippy::shadow-unrelated`
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/execution/mod.rs:849:53
|
|
|
|
|
849 | if order.remaining_quantity.to_f64() <= 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/execution/mod.rs:846:33
|
|
|
|
|
846 | let new_remaining = current_remaining - fill.quantity;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/execution/mod.rs:864:5
|
|
|
|
|
864 | / pub fn get_active_orders(&self) -> &HashMap<String, Order> {
|
|
865 | | &self.active_orders
|
|
866 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
864 | pub const fn get_active_orders(&self) -> &HashMap<String, Order> {
|
|
| +++++
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/execution/mod.rs:869:5
|
|
|
|
|
869 | / pub fn get_order_history(&self) -> &VecDeque<Order> {
|
|
870 | | &self.order_history
|
|
871 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
869 | pub const fn get_order_history(&self) -> &VecDeque<Order> {
|
|
| +++++
|
|
|
|
warning: you should consider adding a `Default` implementation for `FillTracker`
|
|
--> adaptive-strategy/src/execution/mod.rs:876:5
|
|
|
|
|
876 | / pub fn new() -> Self {
|
|
877 | | Self {
|
|
878 | | fills: VecDeque::new(),
|
|
879 | | fill_stats: HashMap::new(),
|
|
880 | | }
|
|
881 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
874 + impl Default for FillTracker {
|
|
875 + fn default() -> Self {
|
|
876 + Self::new()
|
|
877 + }
|
|
878 + }
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/execution/mod.rs:897:9
|
|
|
|
|
897 | stats.total_fills += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/execution/mod.rs:898:9
|
|
|
|
|
898 | stats.total_volume += fill.quantity;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/execution/mod.rs:900:13
|
|
|
|
|
900 | ((stats.vwap * (stats.total_fills - 1) as f64) + fill.price) / stats.total_fills as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/execution/mod.rs:900:28
|
|
|
|
|
900 | ((stats.vwap * (stats.total_fills - 1) as f64) + fill.price) / stats.total_fills as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/execution/mod.rs:900:28
|
|
|
|
|
900 | ((stats.vwap * (stats.total_fills - 1) as f64) + fill.price) / stats.total_fills as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/execution/mod.rs:900:76
|
|
|
|
|
900 | ((stats.vwap * (stats.total_fills - 1) as f64) + fill.price) / stats.total_fills as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/execution/mod.rs:901:35
|
|
|
|
|
901 | stats.average_fill_size = stats.total_volume / stats.total_fills as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/execution/mod.rs:901:56
|
|
|
|
|
901 | stats.average_fill_size = stats.total_volume / stats.total_fills as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: you should consider adding a `Default` implementation for `ExecutionPerformanceTracker`
|
|
--> adaptive-strategy/src/execution/mod.rs:922:5
|
|
|
|
|
922 | / pub fn new() -> Self {
|
|
923 | | Self {
|
|
924 | | algorithm_performance: HashMap::new(),
|
|
925 | | slippage_tracker: SlippageTracker::new(),
|
|
... |
|
|
928 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
920 + impl Default for ExecutionPerformanceTracker {
|
|
921 + fn default() -> Self {
|
|
922 + Self::new()
|
|
923 + }
|
|
924 + }
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/execution/mod.rs:947:22
|
|
|
|
|
947 | let weight = 1.0 / (perf.total_executions + 1) as f64;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/execution/mod.rs:949:14
|
|
|
|
|
949 | (1.0 - weight) * perf.average_slippage_bps + weight * metrics.slippage_bps;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/execution/mod.rs:951:14
|
|
|
|
|
951 | (1.0 - weight) * perf.average_execution_time_ms + weight * metrics.execution_time_ms;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/execution/mod.rs:952:27
|
|
|
|
|
952 | perf.fill_rate = (1.0 - weight) * perf.fill_rate + weight * metrics.fill_rate;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/execution/mod.rs:954:14
|
|
|
|
|
954 | (1.0 - weight) * perf.average_market_impact_bps + weight * metrics.market_impact_bps;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:934:20
|
|
|
|
|
934 | .entry(algorithm.to_string())
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `algorithm.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:936:28
|
|
|
|
|
936 | algorithm: algorithm.to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `algorithm.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/execution/mod.rs:947:22
|
|
|
|
|
947 | let weight = 1.0 / (perf.total_executions + 1) as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/execution/mod.rs:947:28
|
|
|
|
|
947 | let weight = 1.0 / (perf.total_executions + 1) as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/execution/mod.rs:947:28
|
|
|
|
|
947 | let weight = 1.0 / (perf.total_executions + 1) as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/execution/mod.rs:949:13
|
|
|
|
|
949 | (1.0 - weight) * perf.average_slippage_bps + weight * metrics.slippage_bps;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/execution/mod.rs:951:13
|
|
|
|
|
951 | (1.0 - weight) * perf.average_execution_time_ms + weight * metrics.execution_time_ms;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/execution/mod.rs:952:26
|
|
|
|
|
952 | perf.fill_rate = (1.0 - weight) * perf.fill_rate + weight * metrics.fill_rate;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/execution/mod.rs:954:13
|
|
|
|
|
954 | (1.0 - weight) * perf.average_market_impact_bps + weight * metrics.market_impact_bps;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/execution/mod.rs:956:9
|
|
|
|
|
956 | perf.total_executions += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: you should consider adding a `Default` implementation for `SlippageTracker`
|
|
--> adaptive-strategy/src/execution/mod.rs:963:5
|
|
|
|
|
963 | / pub fn new() -> Self {
|
|
964 | | Self {
|
|
965 | | measurements: VecDeque::new(),
|
|
966 | | stats_by_symbol: HashMap::new(),
|
|
967 | | }
|
|
968 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
961 + impl Default for SlippageTracker {
|
|
962 + fn default() -> Self {
|
|
963 + Self::new()
|
|
964 + }
|
|
965 + }
|
|
|
|
|
|
|
warning: you should consider adding a `Default` implementation for `ShortfallTracker`
|
|
--> adaptive-strategy/src/execution/mod.rs:973:5
|
|
|
|
|
973 | / pub fn new() -> Self {
|
|
974 | | Self {}
|
|
975 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
971 + impl Default for ShortfallTracker {
|
|
972 + fn default() -> Self {
|
|
973 + Self::new()
|
|
974 + }
|
|
975 + }
|
|
|
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/execution/mod.rs:973:5
|
|
|
|
|
973 | / pub fn new() -> Self {
|
|
974 | | Self {}
|
|
975 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
973 | pub const fn new() -> Self {
|
|
| +++++
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:984:23
|
|
|
|
|
984 | name: "PRIMARY".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"PRIMARY".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:986:41
|
|
|
|
|
986 | supported_symbols: vec!["*".to_string()], // All symbols
|
|
| ^^^^^^^^^^^^^^^ help: try: `"*".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:994:23
|
|
|
|
|
994 | name: "DARK1".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"DARK1".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:996:41
|
|
|
|
|
996 | supported_symbols: vec!["*".to_string()],
|
|
| ^^^^^^^^^^^^^^^ help: try: `"*".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:1026:32
|
|
|
|
|
1026 | .unwrap_or_else(|| "DEFAULT".to_string()))
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"DEFAULT".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:1036:19
|
|
|
|
|
1036 | name: "TWAP".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"TWAP".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/execution/mod.rs:1056:26
|
|
|
|
|
1056 | let slice_size = request.quantity / self.slice_count as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/execution/mod.rs:1056:45
|
|
|
|
|
1056 | let slice_size = request.quantity / self.slice_count as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using `clone` on type `OrderSide` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/execution/mod.rs:1063:17
|
|
|
|
|
1063 | request.side.clone(),
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `request.side`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:1067:17
|
|
|
|
|
1067 | "TWAP".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"TWAP".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:1089:13
|
|
|
|
|
1089 | "window_duration_seconds".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"window_duration_seconds".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/execution/mod.rs:1090:13
|
|
|
|
|
1090 | self.window_duration.as_secs() as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:1092:23
|
|
|
|
|
1092 | params.insert("slice_count".to_string(), self.slice_count as f64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"slice_count".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/execution/mod.rs:1092:50
|
|
|
|
|
1092 | params.insert("slice_count".to_string(), self.slice_count as f64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/execution/mod.rs:1098:56
|
|
|
|
|
1098 | self.window_duration = Duration::from_secs(duration as u64);
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/execution/mod.rs:1101:32
|
|
|
|
|
1101 | self.slice_count = count as u32;
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:1111:19
|
|
|
|
|
1111 | name: "VWAP".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"VWAP".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using `clone` on type `OrderSide` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/execution/mod.rs:1133:13
|
|
|
|
|
1133 | request.side.clone(),
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `request.side`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:1137:13
|
|
|
|
|
1137 | "VWAP".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"VWAP".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:1157:23
|
|
|
|
|
1157 | params.insert("participation_rate".to_string(), self.participation_rate);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"participation_rate".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: you should consider adding a `Default` implementation for `VolumeTracker`
|
|
--> adaptive-strategy/src/execution/mod.rs:1171:5
|
|
|
|
|
1171 | / pub fn new() -> Self {
|
|
1172 | | Self {
|
|
1173 | | period_volumes: HashMap::new(),
|
|
1174 | | target_volumes: HashMap::new(),
|
|
1175 | | }
|
|
1176 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
1169 + impl Default for VolumeTracker {
|
|
1170 + fn default() -> Self {
|
|
1171 + Self::new()
|
|
1172 + }
|
|
1173 + }
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:1183:19
|
|
|
|
|
1183 | name: "ImplementationShortfall".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"ImplementationShortfall".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/execution/mod.rs:1213:32
|
|
|
|
|
1213 | .unwrap_or(100.0),
|
|
| ^^^^^ help: consider adding suffix: `100.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using `clone` on type `OrderSide` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/execution/mod.rs:1205:13
|
|
|
|
|
1205 | request.side.clone(),
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `request.side`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:1215:13
|
|
|
|
|
1215 | "ImplementationShortfall".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"ImplementationShortfall".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/execution/mod.rs:1234:23
|
|
|
|
|
1234 | params.insert("risk_aversion".to_string(), self.risk_aversion);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"risk_aversion".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: you should consider adding a `Default` implementation for `MarketImpactModel`
|
|
--> adaptive-strategy/src/execution/mod.rs:1248:5
|
|
|
|
|
1248 | / pub fn new() -> Self {
|
|
1249 | | Self {
|
|
1250 | | temp_impact_coeff: 0.01,
|
|
1251 | | perm_impact_coeff: 0.001,
|
|
... |
|
|
1254 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
1246 + impl Default for MarketImpactModel {
|
|
1247 + fn default() -> Self {
|
|
1248 + Self::new()
|
|
1249 + }
|
|
1250 + }
|
|
|
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/execution/mod.rs:1248:5
|
|
|
|
|
1248 | / pub fn new() -> Self {
|
|
1249 | | Self {
|
|
1250 | | temp_impact_coeff: 0.01,
|
|
1251 | | perm_impact_coeff: 0.001,
|
|
... |
|
|
1254 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
1248 | pub const fn new() -> Self {
|
|
| +++++
|
|
|
|
error: found empty brackets on struct declaration
|
|
--> adaptive-strategy/src/microstructure/mod.rs:31:26
|
|
|
|
|
31 | pub struct VPINCalculator {}
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_structs_with_brackets
|
|
= help: remove the brackets
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:39:5
|
|
|
|
|
39 | / pub fn new(_config: VPINConfig) -> Self {
|
|
40 | | Self {}
|
|
41 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
39 | pub const fn new(_config: VPINConfig) -> Self {
|
|
| +++++
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:61:5
|
|
|
|
|
61 | / pub fn get_result(&self) -> VPINMetrics {
|
|
62 | | VPINMetrics {
|
|
63 | | vpin: 0.3,
|
|
64 | | confidence: 0.8,
|
|
... |
|
|
71 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
61 | pub const fn get_result(&self) -> VPINMetrics {
|
|
| +++++
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:78:5
|
|
|
|
|
78 | / pub fn is_toxic(&self) -> bool {
|
|
79 | | false
|
|
80 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
78 | pub const fn is_toxic(&self) -> bool {
|
|
| +++++
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/microstructure/mod.rs:176:12
|
|
|
|
|
176 | pub struct MicrostructureAnalyzer {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/microstructure/mod.rs:336:10
|
|
|
|
|
336 | pub enum MicrostructureFeature {
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/microstructure/mod.rs:395:12
|
|
|
|
|
395 | pub struct MicrostructureFeatures {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:612:13
|
|
|
|
|
612 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/microstructure/mod.rs:608:28
|
|
|
|
|
608 | let book_latency = (now - self.order_book.last_update).num_milliseconds() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/microstructure/mod.rs:608:28
|
|
|
|
|
608 | let book_latency = (now - self.order_book.last_update).num_milliseconds() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/microstructure/mod.rs:610:13
|
|
|
|
|
610 | (now - last_trade.timestamp).num_milliseconds() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/microstructure/mod.rs:610:13
|
|
|
|
|
610 | (now - last_trade.timestamp).num_milliseconds() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:615:9
|
|
|
|
|
615 | (book_latency + trade_latency) / 2.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:619:5
|
|
|
|
|
619 | / fn count_missing_data_points(&self) -> u32 {
|
|
620 | | // Production implementation
|
|
621 | | 0
|
|
622 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
619 | const fn count_missing_data_points(&self) -> u32 {
|
|
| +++++
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/microstructure/mod.rs:624:26
|
|
|
|
|
624 | /// Convert Trade to MarketDataUpdate for VPIN calculator
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
624 - /// Convert Trade to MarketDataUpdate for VPIN calculator
|
|
624 + /// Convert Trade to `MarketDataUpdate` for VPIN calculator
|
|
|
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:625:5
|
|
|
|
|
625 | fn convert_trade_to_market_data_update(&self, trade: &Trade) -> Result<MarketDataUpdate> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
625 - fn convert_trade_to_market_data_update(&self, trade: &Trade) -> Result<MarketDataUpdate> {
|
|
625 + fn convert_trade_to_market_data_update(&self, trade: &Trade) -> microstructure::MarketDataUpdate {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
655 ~ MarketDataUpdate {
|
|
656 + timestamp: trade.timestamp.timestamp_micros() as u64,
|
|
657 + symbol: "MULTI".to_string(), // Generic symbol for adaptive strategy
|
|
658 + price: (trade.price * 10000.0) as i64, // Scale to match VPIN precision
|
|
659 + volume: trade.quantity as u64,
|
|
660 + side,
|
|
661 + bid,
|
|
662 + ask,
|
|
663 + bid_size,
|
|
664 + ask_size,
|
|
665 + direction,
|
|
666 + }
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:631:35
|
|
|
|
|
631 | (best_bid.price * 10000.0) as i64, // Scale to match VPIN precision
|
|
| ^^^^^^^ help: consider adding suffix: `10_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:632:35
|
|
|
|
|
632 | (best_ask.price * 10000.0) as i64,
|
|
| ^^^^^^^ help: consider adding suffix: `10_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:639:32
|
|
|
|
|
639 | (trade.price * 10000.0) as i64 - 50, // Assume 0.005 spread
|
|
| ^^^^^^^ help: consider adding suffix: `10_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:640:32
|
|
|
|
|
640 | (trade.price * 10000.0) as i64 + 50,
|
|
| ^^^^^^^ help: consider adding suffix: `10_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/microstructure/mod.rs:631:17
|
|
|
|
|
631 | (best_bid.price * 10000.0) as i64, // Scale to match VPIN precision
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:631:17
|
|
|
|
|
631 | (best_bid.price * 10000.0) as i64, // Scale to match VPIN precision
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/microstructure/mod.rs:632:17
|
|
|
|
|
632 | (best_ask.price * 10000.0) as i64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:632:17
|
|
|
|
|
632 | (best_ask.price * 10000.0) as i64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/microstructure/mod.rs:633:17
|
|
|
|
|
633 | best_bid.quantity as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/microstructure/mod.rs:634:17
|
|
|
|
|
634 | best_ask.quantity as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/microstructure/mod.rs:639:17
|
|
|
|
|
639 | (trade.price * 10000.0) as i64 - 50, // Assume 0.005 spread
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/microstructure/mod.rs:639:17
|
|
|
|
|
639 | (trade.price * 10000.0) as i64 - 50, // Assume 0.005 spread
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:639:17
|
|
|
|
|
639 | (trade.price * 10000.0) as i64 - 50, // Assume 0.005 spread
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/microstructure/mod.rs:640:17
|
|
|
|
|
640 | (trade.price * 10000.0) as i64 + 50,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/microstructure/mod.rs:640:17
|
|
|
|
|
640 | (trade.price * 10000.0) as i64 + 50,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:640:17
|
|
|
|
|
640 | (trade.price * 10000.0) as i64 + 50,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/microstructure/mod.rs:656:24
|
|
|
|
|
656 | timestamp: trade.timestamp.timestamp_micros() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:657:21
|
|
|
|
|
657 | symbol: "MULTI".to_string(), // Generic symbol for adaptive strategy
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"MULTI".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/microstructure/mod.rs:658:20
|
|
|
|
|
658 | price: (trade.price * 10000.0) as i64, // Scale to match VPIN precision
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:658:20
|
|
|
|
|
658 | price: (trade.price * 10000.0) as i64, // Scale to match VPIN precision
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/microstructure/mod.rs:659:21
|
|
|
|
|
659 | volume: trade.quantity as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:686:27
|
|
|
|
|
686 | let vpin_signal = 1.0 - (vpin_metrics.vpin * 2.0).min(1.0); // Scale and cap at 1.0
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:689:75
|
|
|
|
|
689 | let imbalance_penalty = vpin_metrics.order_flow_imbalance.abs() * 0.3;
|
|
| ^^^ help: consider adding suffix: `0.3_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:693:13
|
|
|
|
|
693 | 0.8 // Reduce confidence with few buckets
|
|
| ^^^ help: consider adding suffix: `0.8_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:695:13
|
|
|
|
|
695 | 1.0
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:686:27
|
|
|
|
|
686 | let vpin_signal = 1.0 - (vpin_metrics.vpin * 2.0).min(1.0); // Scale and cap at 1.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:689:33
|
|
|
|
|
689 | let imbalance_penalty = vpin_metrics.order_flow_imbalance.abs() * 0.3;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:699:27
|
|
|
|
|
699 | let risk_signal = (vpin_signal - imbalance_penalty) * stability_factor;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: clamp-like pattern without using clamp function
|
|
--> adaptive-strategy/src/microstructure/mod.rs:702:9
|
|
|
|
|
702 | risk_signal.max(-1.0_f64).min(1.0_f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `risk_signal.clamp(-1.0_f64, 1.0_f64)`
|
|
|
|
|
= note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
|
|
= note: clamp returns NaN if the input is NaN
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp
|
|
|
|
warning: clamp-like pattern without using clamp function
|
|
--> adaptive-strategy/src/microstructure/mod.rs:736:18
|
|
|
|
|
736 | _ => (0.5 + risk_signal * 0.5).max(0.2).min(1.0), // Scale with risk signal
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(0.5 + risk_signal * 0.5).clamp(0.2, 1.0)`
|
|
|
|
|
= note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
|
|
= note: clamp returns NaN if the input is NaN
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:736:18
|
|
|
|
|
736 | _ => (0.5 + risk_signal * 0.5).max(0.2).min(1.0), // Scale with risk signal
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:776:39
|
|
|
|
|
776 | if bid_volume + ask_volume == 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:776:12
|
|
|
|
|
776 | if bid_volume + ask_volume == 0.0 {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:780:12
|
|
|
|
|
780 | Ok((bid_volume - ask_volume) / (bid_volume + ask_volume))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:786:16
|
|
|
|
|
786 | Ok(best_ask.price - best_bid.price)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:796:12
|
|
|
|
|
796 | Ok(bid_depth + ask_depth)
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/microstructure/mod.rs:801:31
|
|
|
|
|
801 | let expected_levels = self.max_depth * 2; // Both bids and asks
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/microstructure/mod.rs:802:29
|
|
|
|
|
802 | let actual_levels = self.bids.len() + self.asks.len();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:803:9
|
|
|
|
|
803 | actual_levels as f64 / expected_levels as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/microstructure/mod.rs:803:9
|
|
|
|
|
803 | actual_levels as f64 / expected_levels as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/microstructure/mod.rs:803:32
|
|
|
|
|
803 | actual_levels as f64 / expected_levels as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/microstructure/mod.rs:840:24
|
|
|
|
|
840 | if quantity <= self.size_buckets[0] {
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/microstructure/mod.rs:842:31
|
|
|
|
|
842 | } else if quantity <= self.size_buckets[1] {
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/microstructure/mod.rs:844:31
|
|
|
|
|
844 | } else if quantity <= self.size_buckets[2] {
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:863:36
|
|
|
|
|
863 | let price_change = window[1].price / window[0].price;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/microstructure/mod.rs:863:36
|
|
|
|
|
863 | let price_change = window[1].price / window[0].price;
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/microstructure/mod.rs:863:54
|
|
|
|
|
863 | let price_change = window[1].price / window[0].price;
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:872:27
|
|
|
|
|
872 | let mean_return = returns.iter().sum::<f64>() / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/microstructure/mod.rs:872:57
|
|
|
|
|
872 | let mean_return = returns.iter().sum::<f64>() / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:873:24
|
|
|
|
|
873 | let variance = returns
|
|
| ________________________^
|
|
874 | | .iter()
|
|
875 | | .map(|r| (r - mean_return).powi(2))
|
|
876 | | .sum::<f64>()
|
|
877 | | / returns.len() as f64;
|
|
| |__________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/microstructure/mod.rs:877:15
|
|
|
|
|
877 | / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/microstructure/mod.rs:884:22
|
|
|
|
|
884 | let cutoff = chrono::Utc::now() - Duration::minutes(5);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:906:5
|
|
|
|
|
906 | / pub fn calculate_completeness(&self) -> f64 {
|
|
907 | | // Production - would implement based on expected trade frequency
|
|
908 | | 1.0
|
|
909 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
906 | pub const fn calculate_completeness(&self) -> f64 {
|
|
| +++++
|
|
|
|
warning: you should consider adding a `Default` implementation for `PriceImpactModel`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:914:5
|
|
|
|
|
914 | / pub fn new() -> Self {
|
|
915 | | Self {
|
|
916 | | impact_history: VecDeque::new(),
|
|
917 | | linear_coefficient: 0.01,
|
|
... |
|
|
920 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
912 + impl Default for PriceImpactModel {
|
|
913 + fn default() -> Self {
|
|
914 + Self::new()
|
|
915 + }
|
|
916 + }
|
|
|
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:914:5
|
|
|
|
|
914 | / pub fn new() -> Self {
|
|
915 | | Self {
|
|
916 | | impact_history: VecDeque::new(),
|
|
917 | | linear_coefficient: 0.01,
|
|
... |
|
|
920 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
914 | pub const fn new() -> Self {
|
|
| +++++
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:936:59
|
|
|
|
|
936 | spread: order_book.get_spread().unwrap_or(0.0),
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:939:57
|
|
|
|
|
939 | depth: order_book.get_depth().unwrap_or(0.0),
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:960:54
|
|
|
|
|
960 | let depth = order_book.get_depth().unwrap_or(1.0);
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:961:56
|
|
|
|
|
961 | let spread = order_book.get_spread().unwrap_or(0.01);
|
|
| ^^^^ help: consider adding suffix: `0.01_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:966:38
|
|
|
|
|
966 | let spread_impact = spread * 0.5; // Half-spread crossing cost
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:964:29
|
|
|
|
|
964 | let linear_impact = self.linear_coefficient * trade_size / depth;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:965:27
|
|
|
|
|
965 | let sqrt_impact = self.sqrt_coefficient * trade_size.sqrt() / depth.sqrt();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:966:29
|
|
|
|
|
966 | let spread_impact = spread * 0.5; // Half-spread crossing cost
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:968:12
|
|
|
|
|
968 | Ok(linear_impact + sqrt_impact + spread_impact)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:972:5
|
|
|
|
|
972 | / fn measure_immediate_impact(
|
|
973 | | &self,
|
|
974 | | _trade: &Trade,
|
|
975 | | _order_book: &OrderBookTracker,
|
|
... |
|
|
978 | | Ok(0.001)
|
|
979 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
972 | const fn measure_immediate_impact(
|
|
| +++++
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:972:5
|
|
|
|
|
972 | / fn measure_immediate_impact(
|
|
973 | | &self,
|
|
974 | | _trade: &Trade,
|
|
975 | | _order_book: &OrderBookTracker,
|
|
976 | | ) -> Result<f64> {
|
|
| |____________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
976 - ) -> Result<f64> {
|
|
976 + ) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
978 - Ok(0.001)
|
|
978 + 0.001
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1046:39
|
|
|
|
|
1046 | if total_volume > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1049:70
|
|
|
|
|
1049 | features.insert("sell_pressure".to_string(), 1.0 - buy_pressure);
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1082:52
|
|
|
|
|
1082 | if vpin_metrics.is_toxic { 1.0 } else { 0.0 },
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1082:65
|
|
|
|
|
1082 | if vpin_metrics.is_toxic { 1.0 } else { 0.0 },
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1026:41
|
|
|
|
|
1026 | features.insert("bid_ask_spread".to_string(), spread);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"bid_ask_spread".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1030:51
|
|
|
|
|
1030 | ... let relative_spread = spread / best_bid.price;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1031:45
|
|
|
|
|
1031 | ... features.insert("relative_spread".to_string(), relative_spread);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"relative_spread".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1037:41
|
|
|
|
|
1037 | features.insert("order_book_imbalance".to_string(), imbalance);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"order_book_imbalance".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1044:40
|
|
|
|
|
1044 | let total_volume = buy_volume + sell_volume;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1047:44
|
|
|
|
|
1047 | let buy_pressure = buy_volume / total_volume;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1048:41
|
|
|
|
|
1048 | features.insert("buy_pressure".to_string(), buy_pressure);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"buy_pressure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1049:41
|
|
|
|
|
1049 | features.insert("sell_pressure".to_string(), 1.0 - buy_pressure);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"sell_pressure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1049:70
|
|
|
|
|
1049 | features.insert("sell_pressure".to_string(), 1.0 - buy_pressure);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1054:41
|
|
|
|
|
1054 | features.insert("recent_volume".to_string(), volume);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"recent_volume".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1059:38
|
|
|
|
|
1059 | let avg_impact = price_impact
|
|
| ______________________________________^
|
|
1060 | | .impact_history
|
|
1061 | | .iter()
|
|
1062 | | .map(|m| m.impact)
|
|
1063 | | .sum::<f64>()
|
|
1064 | | / price_impact.impact_history.len().max(1) as f64;
|
|
| |_________________________________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1064:27
|
|
|
|
|
1064 | / price_impact.impact_history.len().max(1) as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1065:37
|
|
|
|
|
1065 | features.insert("average_price_impact".to_string(), avg_impact);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"average_price_impact".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1069:41
|
|
|
|
|
1069 | features.insert("microstructure_noise".to_string(), volatility);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"microstructure_noise".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1074:37
|
|
|
|
|
1074 | features.insert("vpin".to_string(), vpin_metrics.vpin);
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"vpin".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1076:25
|
|
|
|
|
1076 | "order_flow_imbalance".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"order_flow_imbalance".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1079:37
|
|
|
|
|
1079 | features.insert("toxicity_score".to_string(), vpin_metrics.toxicity_score);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"toxicity_score".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1081:25
|
|
|
|
|
1081 | "is_toxic".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `"is_toxic".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1085:25
|
|
|
|
|
1085 | "vpin_bucket_count".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"vpin_bucket_count".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1086:25
|
|
|
|
|
1086 | vpin_metrics.bucket_count as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1089:25
|
|
|
|
|
1089 | "vpin_bucket_fill".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"vpin_bucket_fill".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1117:22
|
|
|
|
|
1117 | let cutoff = chrono::Utc::now() - Duration::minutes(5);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1135:5
|
|
|
|
|
1135 | / pub fn new(window: Duration) -> Self {
|
|
1136 | | Self {
|
|
1137 | | price_volume_pairs: VecDeque::new(),
|
|
1138 | | window_duration: window,
|
|
1139 | | }
|
|
1140 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
1135 | pub const fn new(window: Duration) -> Self {
|
|
| +++++
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1148:22
|
|
|
|
|
1148 | let cutoff = chrono::Utc::now() - self.window_duration;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1167:20
|
|
|
|
|
1167 | .fold((0.0, 0.0), |(acc_pv, acc_vol), (pv, vol)| {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1167:25
|
|
|
|
|
1167 | .fold((0.0, 0.0), |(acc_pv, acc_vol), (pv, vol)| {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1171:28
|
|
|
|
|
1171 | if total_volume == 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1160:22
|
|
|
|
|
1160 | let cutoff = chrono::Utc::now() - window;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1166:40
|
|
|
|
|
1166 | .map(|(price, volume, _)| (price * volume, *volume))
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1168:18
|
|
|
|
|
1168 | (acc_pv + pv, acc_vol + vol)
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1168:31
|
|
|
|
|
1168 | (acc_pv + pv, acc_vol + vol)
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1175:12
|
|
|
|
|
1175 | Ok(total_pv / total_volume)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1181:5
|
|
|
|
|
1181 | / pub fn new(method: TradeSignMethod) -> Self {
|
|
1182 | | Self { method }
|
|
1183 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
1181 | pub const fn new(method: TradeSignMethod) -> Self {
|
|
| +++++
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1195:5
|
|
|
|
|
1195 | / fn classify_quote_based(
|
|
1196 | | &self,
|
|
1197 | | trade: &Trade,
|
|
1198 | | order_book: &OrderBookTracker,
|
|
1199 | | ) -> Result<TradeSide> {
|
|
| |__________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1199 - ) -> Result<TradeSide> {
|
|
1199 + ) -> microstructure::TradeSide {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1205 ~ TradeSide::Buy
|
|
1206 | } else if trade.price < mid_price {
|
|
1207 ~ TradeSide::Sell
|
|
1208 | } else {
|
|
1209 ~ TradeSide::Unknown
|
|
1210 | }
|
|
1211 | } else {
|
|
1212 ~ TradeSide::Unknown
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1202:29
|
|
|
|
|
1202 | let mid_price = (best_bid.price + best_ask.price) / 2.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1217:5
|
|
|
|
|
1217 | / fn classify_tick_rule(&self, _trade: &Trade) -> Result<TradeSide> {
|
|
1218 | | // Production implementation
|
|
1219 | | Ok(TradeSide::Unknown)
|
|
1220 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
1217 | const fn classify_tick_rule(&self, _trade: &Trade) -> Result<TradeSide> {
|
|
| +++++
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/microstructure/mod.rs:1217:5
|
|
|
|
|
1217 | fn classify_tick_rule(&self, _trade: &Trade) -> Result<TradeSide> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1217 - fn classify_tick_rule(&self, _trade: &Trade) -> Result<TradeSide> {
|
|
1217 + fn classify_tick_rule(&self, _trade: &Trade) -> microstructure::TradeSide {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1219 - Ok(TradeSide::Unknown)
|
|
1219 + TradeSide::Unknown
|
|
|
|
|
|
|
warning: you should consider adding a `Default` implementation for `Mamba2SSM`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:45:5
|
|
|
|
|
45 | / pub fn new() -> Self {
|
|
46 | | Self { ready: false }
|
|
47 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
43 + impl Default for Mamba2SSM {
|
|
44 + fn default() -> Self {
|
|
45 + Self::new()
|
|
46 + }
|
|
47 + }
|
|
|
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:45:5
|
|
|
|
|
45 | / pub fn new() -> Self {
|
|
46 | | Self { ready: false }
|
|
47 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
45 | pub const fn new() -> Self {
|
|
| +++++
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/models/deep_learning.rs:206:26
|
|
|
|
|
206 | let confidence = 0.7; // Production confidence
|
|
| ^^^ help: consider adding suffix: `0.7_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/deep_learning.rs:205:32
|
|
|
|
|
205 | let prediction_value = features.iter().sum::<f64>() / features.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/deep_learning.rs:205:63
|
|
|
|
|
205 | let prediction_value = features.iter().sum::<f64>() / features.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:238:25
|
|
|
|
|
238 | model_type: "lstm".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"lstm".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:239:22
|
|
|
|
|
239 | version: "1.0.0".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"1.0.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:244:31
|
|
|
|
|
244 | description: Some("LSTM model for time series prediction".to_string()),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"LSTM model for time series prediction".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:340:25
|
|
|
|
|
340 | model_type: "gru".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"gru".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:341:22
|
|
|
|
|
341 | version: "1.0.0".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"1.0.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:346:31
|
|
|
|
|
346 | description: Some("GRU model for recurrent neural network predictions".to_string()),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"GRU model for recurrent neural network predictions".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:409:25
|
|
|
|
|
409 | model_type: "transformer".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"transformer".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:410:22
|
|
|
|
|
410 | version: "1.0.0".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"1.0.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:416:17
|
|
|
|
|
416 | "Transformer model for attention-based sequence modeling".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Transformer model for attention-based sequence modeling".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:480:25
|
|
|
|
|
480 | model_type: "cnn".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"cnn".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:481:22
|
|
|
|
|
481 | version: "1.0.0".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"1.0.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:486:31
|
|
|
|
|
486 | description: Some("CNN model for convolutional neural network predictions".to_string()),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"CNN model for convolutional neural network predictions".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/models/deep_learning.rs:643:39
|
|
|
|
|
643 | let mut padded = vec![0.0; self.mamba_config.d_model];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: used `unwrap()` on an `Option` value
|
|
--> adaptive-strategy/src/models/deep_learning.rs:638:35
|
|
|
|
|
638 | let latest_features = sequence.last().unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: if this value is `None`, it will panic
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
|
|
|
warning: slicing may panic
|
|
--> adaptive-strategy/src/models/deep_learning.rs:645:17
|
|
|
|
|
645 | padded[..copy_len].copy_from_slice(&latest_features[..copy_len]);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(..n)`or `.get_mut(..n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: slicing may panic
|
|
--> adaptive-strategy/src/models/deep_learning.rs:645:53
|
|
|
|
|
645 | padded[..copy_len].copy_from_slice(&latest_features[..copy_len]);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(..n)`or `.get_mut(..n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:667:17
|
|
|
|
|
667 | "sequence_length".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"sequence_length".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:671:17
|
|
|
|
|
671 | "model_type".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"model_type".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:672:43
|
|
|
|
|
672 | serde_json::Value::String("mamba2_ssm".to_string()),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"mamba2_ssm".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:675:17
|
|
|
|
|
675 | "compression_ratio".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"compression_ratio".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:679:17
|
|
|
|
|
679 | "target_latency_us".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"target_latency_us".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/models/deep_learning.rs:704:31
|
|
|
|
|
704 | for feature_idx in 0..sequence[0].len() {
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/models/deep_learning.rs:707:68
|
|
|
|
|
707 | .map(|seq| seq.get(feature_idx).copied().unwrap_or(0.0))
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/deep_learning.rs:710:24
|
|
|
|
|
710 | let mean = values.iter().sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/deep_learning.rs:710:53
|
|
|
|
|
710 | let mean = values.iter().sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/deep_learning.rs:712:17
|
|
|
|
|
712 | values.iter().map(|v| (v - mean).powi(2)).sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/deep_learning.rs:712:74
|
|
|
|
|
712 | values.iter().map(|v| (v - mean).powi(2)).sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/deep_learning.rs:717:28
|
|
|
|
|
717 | let avg_variance = variances.iter().sum::<f64>() / variances.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/deep_learning.rs:717:60
|
|
|
|
|
717 | let avg_variance = variances.iter().sum::<f64>() / variances.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/deep_learning.rs:721:9
|
|
|
|
|
721 | (1.0 / (1.0 + avg_variance)).clamp(0.0, 1.0)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:744:24
|
|
|
|
|
744 | metrics.insert("sequence_length".to_string(), sequence_len as f64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"sequence_length".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/deep_learning.rs:744:55
|
|
|
|
|
744 | metrics.insert("sequence_length".to_string(), sequence_len as f64);
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:746:13
|
|
|
|
|
746 | "max_sequence_length".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"max_sequence_length".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/deep_learning.rs:747:13
|
|
|
|
|
747 | self.max_sequence_length as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:749:24
|
|
|
|
|
749 | metrics.insert("compression_ratio".to_string(), self.compression_ratio);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"compression_ratio".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:751:13
|
|
|
|
|
751 | "target_latency_us".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"target_latency_us".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/deep_learning.rs:752:13
|
|
|
|
|
752 | self.mamba_config.target_latency_us as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: used underscore-prefixed binding
|
|
--> adaptive-strategy/src/models/deep_learning.rs:758:33
|
|
|
|
|
758 | let mamba_metrics = _mamba_model.get_performance_metrics();
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
note: binding is defined here
|
|
--> adaptive-strategy/src/models/deep_learning.rs:757:21
|
|
|
|
|
757 | if let Some(ref _mamba_model) = *model_guard {
|
|
| ^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding
|
|
= note: requested on the command line with `-W clippy::used-underscore-binding`
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/deep_learning.rs:817:38
|
|
|
|
|
817 | validation_loss: last_epoch.loss * 1.1, // Approximate
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/deep_learning.rs:819:42
|
|
|
|
|
819 | validation_accuracy: last_epoch.accuracy * 0.95, // Approximate
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/deep_learning.rs:820:29
|
|
|
|
|
820 | epochs: training_epochs.len() as u32,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:835:13
|
|
|
|
|
835 | "d_model".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"d_model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:839:13
|
|
|
|
|
839 | "d_state".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"d_state".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:843:13
|
|
|
|
|
843 | "num_layers".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"num_layers".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:847:13
|
|
|
|
|
847 | "target_latency_us".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"target_latency_us".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:853:13
|
|
|
|
|
853 | "max_seq_len".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"max_seq_len".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:857:13
|
|
|
|
|
857 | "compression_ratio".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"compression_ratio".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: used `unwrap()` on an `Option` value
|
|
--> adaptive-strategy/src/models/deep_learning.rs:859:17
|
|
|
|
|
859 | serde_json::Number::from_f64(self.compression_ratio).unwrap(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: if this value is `None`, it will panic
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:865:25
|
|
|
|
|
865 | model_type: "mamba2_ssm".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"mamba2_ssm".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:866:22
|
|
|
|
|
866 | version: "2.0.0".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"2.0.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:872:17
|
|
|
|
|
872 | / "MAMBA-2 State Space Model for HFT temporal sequence modeling with O(n) complexity"
|
|
873 | | .to_string(),
|
|
| |________________________________^ help: try: `"MAMBA-2 State Space Model for HFT temporal sequence modeling with O(n) complexity".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/models/deep_learning.rs:891:28
|
|
|
|
|
891 | .unwrap_or(0.85),
|
|
| ^^^^ help: consider adding suffix: `0.85_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/models/deep_learning.rs:900:28
|
|
|
|
|
900 | .unwrap_or(0.0) as u64,
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/models/deep_learning.rs:886:25
|
|
|
|
|
886 | 0.95
|
|
| ^^^^ help: consider adding suffix: `0.95_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/models/deep_learning.rs:888:25
|
|
|
|
|
888 | 0.8
|
|
| ^^^ help: consider adding suffix: `0.8_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/deep_learning.rs:897:31
|
|
|
|
|
897 | prediction_count: temporal_metrics
|
|
| _______________________________^
|
|
898 | | .get("mamba2_total_inferences")
|
|
899 | | .copied()
|
|
900 | | .unwrap_or(0.0) as u64,
|
|
| |______________________________________^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/models/deep_learning.rs:921:26
|
|
|
|
|
921 | let model_size = self.mamba_config.d_model
|
|
| __________________________^
|
|
922 | | * self.mamba_config.d_state
|
|
923 | | * self.mamba_config.num_layers
|
|
924 | | * 4; // f32 bytes
|
|
| |_______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/models/deep_learning.rs:925:27
|
|
|
|
|
925 | let buffer_size = self.max_sequence_length * self.mamba_config.d_model * 8; // f64 bytes
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/models/deep_learning.rs:926:9
|
|
|
|
|
926 | model_size + buffer_size
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:965:5
|
|
|
|
|
965 | / fn convert_training_data(
|
|
966 | | &self,
|
|
967 | | _training_data: &TrainingData,
|
|
968 | | ) -> Result<Vec<(Vec<f64>, Vec<f64>)>> {
|
|
... |
|
|
971 | | Ok(Vec::new())
|
|
972 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
965 | const fn convert_training_data(
|
|
| +++++
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/models/deep_learning.rs:965:5
|
|
|
|
|
965 | / fn convert_training_data(
|
|
966 | | &self,
|
|
967 | | _training_data: &TrainingData,
|
|
968 | | ) -> Result<Vec<(Vec<f64>, Vec<f64>)>> {
|
|
| |__________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
968 - ) -> Result<Vec<(Vec<f64>, Vec<f64>)>> {
|
|
968 + ) -> std::vec::Vec<(std::vec::Vec<f64>, std::vec::Vec<f64>)> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
971 - Ok(Vec::new())
|
|
971 + Vec::new()
|
|
|
|
|
|
|
warning: item name ends with its containing module's name
|
|
--> adaptive-strategy/src/models/mod.rs:18:9
|
|
|
|
|
18 | pub mod ensemble_models;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: usage of wildcard import
|
|
--> adaptive-strategy/src/models/ensemble_models.rs:6:5
|
|
|
|
|
6 | use super::*;
|
|
| ^^^^^^^^ help: try: `super::{ModelConfig, ModelTrait, ModelPrediction, TrainingData, TrainingMetrics, ModelMetadata, HashMap, ModelPerformance}`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports
|
|
= note: requested on the command line with `-W clippy::wildcard-imports`
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/ensemble_models.rs:50:25
|
|
|
|
|
50 | model_type: "ensemble".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `"ensemble".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/ensemble_models.rs:51:22
|
|
|
|
|
51 | version: "0.1.0".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"0.1.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/ensemble_models.rs:57:17
|
|
|
|
|
57 | "Ensemble model combining multiple base models (not yet implemented)".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Ensemble model combining multiple base models (not yet implemented)".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/models/tlob_model.rs:88:5
|
|
|
|
|
88 | / pub fn new(_config: &TLOBConfig) -> Self {
|
|
89 | | Self
|
|
90 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
88 | pub const fn new(_config: &TLOBConfig) -> Self {
|
|
| +++++
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/tlob_model.rs:98:33
|
|
|
|
|
98 | features_used: vec!["tlob_feature".to_string()],
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"tlob_feature".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/tlob_model.rs:101:21
|
|
|
|
|
101 | "model_name".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"model_name".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/tlob_model.rs:102:47
|
|
|
|
|
102 | serde_json::Value::String("TLOB-stub".to_string()),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"TLOB-stub".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/tlob_model.rs:105:21
|
|
|
|
|
105 | "prediction_time_us".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"prediction_time_us".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/models/tlob_model.rs:141:37
|
|
|
|
|
141 | /// TLOB Model adapter implementing ModelTrait
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
141 - /// TLOB Model adapter implementing ModelTrait
|
|
141 + /// TLOB Model adapter implementing `ModelTrait`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/models/tlob_model.rs:177:25
|
|
|
|
|
177 | /// Convert generic ModelConfig to TLOBConfig
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
177 - /// Convert generic ModelConfig to TLOBConfig
|
|
177 + /// Convert generic `ModelConfig` to TLOBConfig
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/models/tlob_model.rs:177:40
|
|
|
|
|
177 | /// Convert generic ModelConfig to TLOBConfig
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
177 - /// Convert generic ModelConfig to TLOBConfig
|
|
177 + /// Convert generic ModelConfig to `TLOBConfig`
|
|
|
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/models/tlob_model.rs:178:5
|
|
|
|
|
178 | fn map_config(config: ModelConfig) -> Result<TLOBConfig> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
178 - fn map_config(config: ModelConfig) -> Result<TLOBConfig> {
|
|
178 + fn map_config(config: ModelConfig) -> models::tlob_model::TLOBConfig {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
179 ~ TLOBConfig {
|
|
180 + model_path: "models/tlob_transformer.onnx".to_string(),
|
|
181 + feature_dim: 51,
|
|
182 + prediction_horizon: config
|
|
183 + .custom_parameters
|
|
184 + .get("prediction_horizon")
|
|
185 + .and_then(|v| v.as_u64())
|
|
186 + .unwrap_or(10) as usize,
|
|
187 + batch_size: config.batch_size.min(32), // HFT constraint
|
|
188 + device: if config.custom_parameters.contains_key("cuda") {
|
|
189 + "cuda".to_string()
|
|
190 + } else {
|
|
191 + "cpu".to_string()
|
|
192 + },
|
|
193 + }
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/tlob_model.rs:180:25
|
|
|
|
|
180 | model_path: "models/tlob_transformer.onnx".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"models/tlob_transformer.onnx".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/tlob_model.rs:182:33
|
|
|
|
|
182 | prediction_horizon: config
|
|
| _________________________________^
|
|
183 | | .custom_parameters
|
|
184 | | .get("prediction_horizon")
|
|
185 | | .and_then(|v| v.as_u64())
|
|
186 | | .unwrap_or(10) as usize,
|
|
| |_______________________________________^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/tlob_model.rs:189:17
|
|
|
|
|
189 | "cuda".to_string()
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"cuda".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/tlob_model.rs:191:17
|
|
|
|
|
191 | "cpu".to_string()
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"cpu".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/models/tlob_model.rs:196:30
|
|
|
|
|
196 | /// Convert f64 array to TLOBFeatures (PERFORMANCE CRITICAL)
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
196 - /// Convert f64 array to TLOBFeatures (PERFORMANCE CRITICAL)
|
|
196 + /// Convert f64 array to `TLOBFeatures` (PERFORMANCE CRITICAL)
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/models/tlob_model.rs:197:27
|
|
|
|
|
197 | /// Expected format: [bid_prices(10), ask_prices(10), bid_volumes(10), ask_volumes(10),
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
197 - /// Expected format: [bid_prices(10), ask_prices(10), bid_volumes(10), ask_volumes(10),
|
|
197 + /// Expected format: [`bid_prices(10)`, ask_prices(10), bid_volumes(10), ask_volumes(10),
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/models/tlob_model.rs:197:43
|
|
|
|
|
197 | /// Expected format: [bid_prices(10), ask_prices(10), bid_volumes(10), ask_volumes(10),
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
197 - /// Expected format: [bid_prices(10), ask_prices(10), bid_volumes(10), ask_volumes(10),
|
|
197 + /// Expected format: [bid_prices(10), `ask_prices(10)`, bid_volumes(10), ask_volumes(10),
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/models/tlob_model.rs:197:59
|
|
|
|
|
197 | /// Expected format: [bid_prices(10), ask_prices(10), bid_volumes(10), ask_volumes(10),
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
197 - /// Expected format: [bid_prices(10), ask_prices(10), bid_volumes(10), ask_volumes(10),
|
|
197 + /// Expected format: [bid_prices(10), ask_prices(10), `bid_volumes(10)`, ask_volumes(10),
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/models/tlob_model.rs:197:76
|
|
|
|
|
197 | /// Expected format: [bid_prices(10), ask_prices(10), bid_volumes(10), ask_volumes(10),
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
197 - /// Expected format: [bid_prices(10), ask_prices(10), bid_volumes(10), ask_volumes(10),
|
|
197 + /// Expected format: [bid_prices(10), ask_prices(10), bid_volumes(10), `ask_volumes(10)`,
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/models/tlob_model.rs:198:27
|
|
|
|
|
198 | /// last_price, volume, volatility, momentum, microstructure(3)]
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
198 - /// last_price, volume, volatility, momentum, microstructure(3)]
|
|
198 + /// `last_price`, volume, volatility, momentum, microstructure(3)]
|
|
|
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> adaptive-strategy/src/models/tlob_model.rs:210:22
|
|
|
|
|
210 | .map_err(|_| anyhow::anyhow!("Failed to convert bid_prices to array"))?;
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
= note: requested on the command line with `-W clippy::map-err-ignore`
|
|
|
|
warning: slicing may panic
|
|
--> adaptive-strategy/src/models/tlob_model.rs:205:37
|
|
|
|
|
205 | let bid_prices: [i64; 10] = features[0..10]
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/models/tlob_model.rs:207:28
|
|
|
|
|
207 | .map(|&f| (f * 10000.0) as i64) // Convert to integer with 4 decimal precision
|
|
| ^^^^^^^ help: consider adding suffix: `10_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/tlob_model.rs:207:23
|
|
|
|
|
207 | .map(|&f| (f * 10000.0) as i64) // Convert to integer with 4 decimal precision
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/tlob_model.rs:207:23
|
|
|
|
|
207 | .map(|&f| (f * 10000.0) as i64) // Convert to integer with 4 decimal precision
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> adaptive-strategy/src/models/tlob_model.rs:217:22
|
|
|
|
|
217 | .map_err(|_| anyhow::anyhow!("Failed to convert ask_prices to array"))?;
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: slicing may panic
|
|
--> adaptive-strategy/src/models/tlob_model.rs:212:37
|
|
|
|
|
212 | let ask_prices: [i64; 10] = features[10..20]
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/models/tlob_model.rs:214:28
|
|
|
|
|
214 | .map(|&f| (f * 10000.0) as i64)
|
|
| ^^^^^^^ help: consider adding suffix: `10_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/tlob_model.rs:214:23
|
|
|
|
|
214 | .map(|&f| (f * 10000.0) as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/tlob_model.rs:214:23
|
|
|
|
|
214 | .map(|&f| (f * 10000.0) as i64)
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> adaptive-strategy/src/models/tlob_model.rs:224:22
|
|
|
|
|
224 | .map_err(|_| anyhow::anyhow!("Failed to convert bid_sizes to array"))?;
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: slicing may panic
|
|
--> adaptive-strategy/src/models/tlob_model.rs:219:36
|
|
|
|
|
219 | let bid_sizes: [i64; 10] = features[20..30]
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/tlob_model.rs:221:23
|
|
|
|
|
221 | .map(|&f| f as i64)
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> adaptive-strategy/src/models/tlob_model.rs:231:22
|
|
|
|
|
231 | .map_err(|_| anyhow::anyhow!("Failed to convert ask_sizes to array"))?;
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: slicing may panic
|
|
--> adaptive-strategy/src/models/tlob_model.rs:226:36
|
|
|
|
|
226 | let ask_sizes: [i64; 10] = features[30..40]
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/tlob_model.rs:228:23
|
|
|
|
|
228 | .map(|&f| f as i64)
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> adaptive-strategy/src/models/tlob_model.rs:238:22
|
|
|
|
|
238 | .map_err(|_| anyhow::anyhow!("Failed to convert microstructure_features to array"))?;
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: slicing may panic
|
|
--> adaptive-strategy/src/models/tlob_model.rs:233:49
|
|
|
|
|
233 | let microstructure_features: [i64; 3] = features[44..47]
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/models/tlob_model.rs:235:28
|
|
|
|
|
235 | .map(|&f| (f * 10000.0) as i64)
|
|
| ^^^^^^^ help: consider adding suffix: `10_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/tlob_model.rs:235:23
|
|
|
|
|
235 | .map(|&f| (f * 10000.0) as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/tlob_model.rs:235:23
|
|
|
|
|
235 | .map(|&f| (f * 10000.0) as i64)
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/tlob_model.rs:241:24
|
|
|
|
|
241 | timestamp: chrono::Utc::now().timestamp_micros() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/tlob_model.rs:246:26
|
|
|
|
|
246 | trade_price: (features[40] * 10000.0) as i64, // last_price
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/tlob_model.rs:246:26
|
|
|
|
|
246 | trade_price: (features[40] * 10000.0) as i64, // last_price
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/models/tlob_model.rs:246:27
|
|
|
|
|
246 | trade_price: (features[40] * 10000.0) as i64, // last_price
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/tlob_model.rs:247:25
|
|
|
|
|
247 | trade_size: features[41] as i64, // volume
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/models/tlob_model.rs:247:25
|
|
|
|
|
247 | trade_size: features[41] as i64, // volume
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/tlob_model.rs:249:17
|
|
|
|
|
249 | (features[42] * 10000.0) as i64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/tlob_model.rs:249:17
|
|
|
|
|
249 | (features[42] * 10000.0) as i64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/models/tlob_model.rs:249:18
|
|
|
|
|
249 | (features[42] * 10000.0) as i64
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/tlob_model.rs:253:24
|
|
|
|
|
253 | mid_price: (features.get(43).unwrap_or(&0.0) * 10000.0) as i64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/tlob_model.rs:253:24
|
|
|
|
|
253 | mid_price: (features.get(43).unwrap_or(&0.0) * 10000.0) as i64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: `features` is shadowed
|
|
--> adaptive-strategy/src/models/tlob_model.rs:296:16
|
|
|
|
|
296 | Ok(features) => features,
|
|
| ^^^^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> adaptive-strategy/src/models/tlob_model.rs:286:29
|
|
|
|
|
286 | async fn predict(&self, features: &[f64]) -> Result<ModelPrediction> {
|
|
| ^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_reuse
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/models/tlob_model.rs:300:21
|
|
|
|
|
300 | metrics.failed_predictions += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/tlob_model.rs:305:31
|
|
|
|
|
305 | let conversion_time = conversion_start.elapsed().as_nanos() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/models/tlob_model.rs:314:21
|
|
|
|
|
314 | metrics.failed_predictions += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/tlob_model.rs:319:30
|
|
|
|
|
319 | let inference_time = inference_start.elapsed().as_nanos() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/tlob_model.rs:325:26
|
|
|
|
|
325 | let total_time = start.elapsed().as_nanos() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/models/tlob_model.rs:327:13
|
|
|
|
|
327 | metrics.total_predictions += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/models/tlob_model.rs:328:13
|
|
|
|
|
328 | metrics.total_latency_ns += total_time;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/models/tlob_model.rs:329:38
|
|
|
|
|
329 | metrics.avg_latency_ns = metrics.total_latency_ns / metrics.total_predictions;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> adaptive-strategy/src/models/tlob_model.rs:329:38
|
|
|
|
|
329 | metrics.avg_latency_ns = metrics.total_latency_ns / metrics.total_predictions;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
= note: requested on the command line with `-W clippy::integer-division`
|
|
|
|
error: literal non-ASCII character detected
|
|
--> adaptive-strategy/src/models/tlob_model.rs:338:13
|
|
|
|
|
338 | warn!("TLOB prediction exceeded 50μs target: {}ns", total_time);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `warn!("TLOB prediction exceeded 50\u{3bc}s target: {}ns", total_time)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
|
|
= note: requested on the command line with `-D clippy::non-ascii-literal`
|
|
|
|
error: literal non-ASCII character detected
|
|
--> adaptive-strategy/src/models/tlob_model.rs:338:19
|
|
|
|
|
338 | warn!("TLOB prediction exceeded 50μs target: {}ns", total_time);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"TLOB prediction exceeded 50\u{3bc}s target: {}ns"`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/models/tlob_model.rs:355:51
|
|
|
|
|
355 | ("feature_dimension".to_string(), 51.0),
|
|
| ^^^^ help: consider adding suffix: `51.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/tlob_model.rs:355:18
|
|
|
|
|
355 | ("feature_dimension".to_string(), 51.0),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"feature_dimension".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/tlob_model.rs:357:21
|
|
|
|
|
357 | "prediction_horizon".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"prediction_horizon".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/tlob_model.rs:367:25
|
|
|
|
|
367 | model_type: "tlob".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"tlob".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/tlob_model.rs:368:22
|
|
|
|
|
368 | version: "1.0.0".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"1.0.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/tlob_model.rs:372:18
|
|
|
|
|
372 | ("feature_dim".to_string(), serde_json::Value::Number(serde_json::Number::from(self.config.feature_dim))),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"feature_dim".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/tlob_model.rs:373:18
|
|
|
|
|
373 | ("prediction_horizon".to_string(), serde_json::Value::Number(serde_json::Number::from(self.config.prediction_horizon))),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"prediction_horizon".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/tlob_model.rs:374:18
|
|
|
|
|
374 | ("batch_size".to_string(), serde_json::Value::Number(serde_json::Number::from(self.config.batch_size))),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"batch_size".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/tlob_model.rs:375:18
|
|
|
|
|
375 | ("device".to_string(), serde_json::Value::String(self.config.device.clone())),
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `"device".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/tlob_model.rs:378:31
|
|
|
|
|
378 | description: Some("TLOB (Time Limit Order Book) transformer for order book prediction with sub-50μs inference".to_string()),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"TLOB (Time Limit Order Book) transformer for order book prediction with sub-50μs inference".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: literal non-ASCII character detected
|
|
--> adaptive-strategy/src/models/tlob_model.rs:378:31
|
|
|
|
|
378 | description: Some("TLOB (Time Limit Order Book) transformer for order book prediction with sub-50μs inference".to_string()),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"TLOB (Time Limit Order Book) transformer for order book prediction with sub-50\u{3bc}s inference"`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/models/tlob_model.rs:386:13
|
|
|
|
|
386 | 1.0 - (tlob_metrics.failed_predictions as f64 / tlob_metrics.total_predictions as f64)
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/models/tlob_model.rs:388:13
|
|
|
|
|
388 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/tlob_model.rs:386:13
|
|
|
|
|
386 | 1.0 - (tlob_metrics.failed_predictions as f64 / tlob_metrics.total_predictions as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/tlob_model.rs:386:20
|
|
|
|
|
386 | 1.0 - (tlob_metrics.failed_predictions as f64 / tlob_metrics.total_predictions as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/tlob_model.rs:386:61
|
|
|
|
|
386 | 1.0 - (tlob_metrics.failed_predictions as f64 / tlob_metrics.total_predictions as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/models/tlob_model.rs:428:31
|
|
|
|
|
428 | let feature_buffers = self.config.feature_dim * self.config.batch_size * 8; // f64 size
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/models/tlob_model.rs:431:9
|
|
|
|
|
431 | base_size + feature_buffers + model_weights
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/models/traditional.rs:4:63
|
|
|
|
|
4 | //! for adaptive trading strategies, including Random Forest, XGBoost, SVM, etc.
|
|
| ^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
4 - //! for adaptive trading strategies, including Random Forest, XGBoost, SVM, etc.
|
|
4 + //! for adaptive trading strategies, including Random Forest, `XGBoost`, SVM, etc.
|
|
|
|
|
|
|
warning: usage of wildcard import
|
|
--> adaptive-strategy/src/models/traditional.rs:6:5
|
|
|
|
|
6 | use super::*;
|
|
| ^^^^^^^^ help: try: `super::{ModelConfig, ModelTrait, ModelPrediction, TrainingData, TrainingMetrics, ModelMetadata, HashMap, ModelPerformance}`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/traditional.rs:50:25
|
|
|
|
|
50 | model_type: "random_forest".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"random_forest".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/traditional.rs:51:22
|
|
|
|
|
51 | version: "1.0.0".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"1.0.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/traditional.rs:56:31
|
|
|
|
|
56 | description: Some("Random Forest ensemble model for robust predictions".to_string()),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Random Forest ensemble model for robust predictions".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/models/traditional.rs:79:5
|
|
|
|
|
79 | /// XGBoost model implementation (production)
|
|
| ^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
79 - /// XGBoost model implementation (production)
|
|
79 + /// `XGBoost` model implementation (production)
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/models/traditional.rs:92:22
|
|
|
|
|
92 | /// Create a new XGBoost model instance
|
|
| ^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
92 - /// Create a new XGBoost model instance
|
|
92 + /// Create a new `XGBoost` model instance
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/traditional.rs:119:25
|
|
|
|
|
119 | model_type: "xgboost".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"xgboost".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/traditional.rs:120:22
|
|
|
|
|
120 | version: "1.0.0".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"1.0.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/traditional.rs:126:17
|
|
|
|
|
126 | "XGBoost gradient boosting model for high-performance predictions".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"XGBoost gradient boosting model for high-performance predictions".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/traditional.rs:190:25
|
|
|
|
|
190 | model_type: "svm".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"svm".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/traditional.rs:191:22
|
|
|
|
|
191 | version: "1.0.0".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"1.0.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/traditional.rs:197:17
|
|
|
|
|
197 | "Support Vector Machine model for classification and regression".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Support Vector Machine model for classification and regression".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/traditional.rs:261:25
|
|
|
|
|
261 | model_type: "linear_regression".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"linear_regression".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/traditional.rs:262:22
|
|
|
|
|
262 | version: "1.0.0".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"1.0.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/traditional.rs:268:17
|
|
|
|
|
268 | "Linear Regression model for linear relationship modeling".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Linear Regression model for linear relationship modeling".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/models/mod.rs:28:44
|
|
|
|
|
28 | /// Get model type (lstm, transformer, random_forest, etc.)
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
28 - /// Get model type (lstm, transformer, random_forest, etc.)
|
|
28 + /// Get model type (lstm, transformer, `random_forest`, etc.)
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/models/mod.rs:199:43
|
|
|
|
|
199 | /// Boxed model instance implementing ModelTrait
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
199 - /// Boxed model instance implementing ModelTrait
|
|
199 + /// Boxed model instance implementing `ModelTrait`
|
|
|
|
|
|
|
warning: the function has a cognitive complexity of (41/30)
|
|
--> adaptive-strategy/src/models/mod.rs:200:18
|
|
|
|
|
200 | pub async fn create_model(
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cognitive_complexity
|
|
|
|
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
|
|
--> adaptive-strategy/src/models/mod.rs:229:17
|
|
|
|
|
229 | / match tlob_model::TLOBModel::new(name.clone(), config).await {
|
|
230 | | Ok(model) => {
|
|
231 | | info!("Created TLOB model with sub-50μs inference capability");
|
|
232 | | Ok(Box::new(model))
|
|
... |
|
|
237 | | },
|
|
238 | | }
|
|
| |_________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else
|
|
= note: requested on the command line with `-W clippy::single-match-else`
|
|
help: try
|
|
|
|
|
229 ~ if let Ok(model) = tlob_model::TLOBModel::new(name.clone(), config).await {
|
|
230 ~ info!("Created TLOB model with sub-50μs inference capability");
|
|
231 + Ok(Box::new(model))
|
|
232 + } else {
|
|
233 + warn!("TLOB model creation failed, using mock model for {}", name);
|
|
234 + Ok(Box::new(MockModel::new(name)))
|
|
235 + }
|
|
|
|
|
|
|
error: literal non-ASCII character detected
|
|
--> adaptive-strategy/src/models/mod.rs:231:25
|
|
|
|
|
231 | info!("Created TLOB model with sub-50μs inference capability");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `info!("Created TLOB model with sub-50\u{3bc}s inference capability")`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
|
|
|
|
error: literal non-ASCII character detected
|
|
--> adaptive-strategy/src/models/mod.rs:231:31
|
|
|
|
|
231 | info!("Created TLOB model with sub-50μs inference capability");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Created TLOB model with sub-50\u{3bc}s inference capability"`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/models/mod.rs:295:47
|
|
|
|
|
295 | let prediction_value = (feature_sum % 2.0) - 1.0; // Range [-1, 1]
|
|
| ^^^ help: consider adding suffix: `2.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/models/mod.rs:295:54
|
|
|
|
|
295 | let prediction_value = (feature_sum % 2.0) - 1.0; // Range [-1, 1]
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/models/mod.rs:296:26
|
|
|
|
|
296 | let confidence = 0.5 + (feature_sum % 0.5); // Range [0.5, 1.0]
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/models/mod.rs:296:47
|
|
|
|
|
296 | let confidence = 0.5 + (feature_sum % 0.5); // Range [0.5, 1.0]
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/mod.rs:295:32
|
|
|
|
|
295 | let prediction_value = (feature_sum % 2.0) - 1.0; // Range [-1, 1]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: you are using modulo operator on types that might have different signs
|
|
--> adaptive-strategy/src/models/mod.rs:295:32
|
|
|
|
|
295 | let prediction_value = (feature_sum % 2.0) - 1.0; // Range [-1, 1]
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: double check for expected result especially when interoperating with different languages
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#modulo_arithmetic
|
|
= note: requested on the command line with `-D clippy::modulo-arithmetic`
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/mod.rs:296:26
|
|
|
|
|
296 | let confidence = 0.5 + (feature_sum % 0.5); // Range [0.5, 1.0]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: you are using modulo operator on types that might have different signs
|
|
--> adaptive-strategy/src/models/mod.rs:296:32
|
|
|
|
|
296 | let confidence = 0.5 + (feature_sum % 0.5); // Range [0.5, 1.0]
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: double check for expected result especially when interoperating with different languages
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#modulo_arithmetic
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/mod.rs:306:21
|
|
|
|
|
306 | "model_type".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"model_type".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/mod.rs:307:47
|
|
|
|
|
307 | serde_json::Value::String("mock".to_string()),
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"mock".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/mod.rs:310:21
|
|
|
|
|
310 | "feature_sum".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"feature_sum".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: used `unwrap()` on an `Option` value
|
|
--> adaptive-strategy/src/models/mod.rs:311:47
|
|
|
|
|
311 | serde_json::Value::Number(serde_json::Number::from_f64(feature_sum).unwrap()),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: if this value is `None`, it will panic
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/mod.rs:330:28
|
|
|
|
|
330 | training_loss: 0.1 + (rand::random::<f64>() * 0.05),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/mod.rs:331:30
|
|
|
|
|
331 | validation_loss: 0.12 + (rand::random::<f64>() * 0.05),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/mod.rs:332:32
|
|
|
|
|
332 | training_accuracy: 0.85 + (rand::random::<f64>() * 0.1),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/models/mod.rs:333:34
|
|
|
|
|
333 | validation_accuracy: 0.83 + (rand::random::<f64>() * 0.1),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/mod.rs:337:17
|
|
|
|
|
337 | "samples_processed".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"samples_processed".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/models/mod.rs:338:17
|
|
|
|
|
338 | training_data.features.len() as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/mod.rs:346:25
|
|
|
|
|
346 | model_type: "mock".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"mock".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/mod.rs:347:22
|
|
|
|
|
347 | version: "1.0.0".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"1.0.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/mod.rs:352:31
|
|
|
|
|
352 | description: Some("Mock model for testing".to_string()),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock model for testing".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/models/mod.rs:396:5
|
|
|
|
|
396 | / pub fn new(name: String) -> Self {
|
|
397 | | Self {
|
|
398 | | name,
|
|
399 | | ready: false,
|
|
... |
|
|
402 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
396 | pub const fn new(name: String) -> Self {
|
|
| +++++
|
|
|
|
warning: you should consider adding a `Default` implementation for `ModelRegistry`
|
|
--> adaptive-strategy/src/models/mod.rs:412:5
|
|
|
|
|
412 | / pub fn new() -> Self {
|
|
413 | | Self {
|
|
414 | | models: HashMap::new(),
|
|
415 | | }
|
|
416 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
410 + impl Default for ModelRegistry {
|
|
411 + fn default() -> Self {
|
|
412 + Self::new()
|
|
413 + }
|
|
414 + }
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/models/mod.rs:420:20
|
|
|
|
|
420 | let name = model.name().to_string();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `model.name().to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/models/mod.rs:504:41
|
|
|
|
|
504 | if !self.features.is_empty() && self.features[0].len() != self.feature_names.len() {
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/regime/mod.rs:30:12
|
|
|
|
|
30 | pub struct RegimeDetector {
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name ends with its containing module's name
|
|
--> adaptive-strategy/src/regime/mod.rs:48:10
|
|
|
|
|
48 | pub enum MarketRegime {
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/regime/mod.rs:76:11
|
|
|
|
|
76 | pub trait RegimeDetectionModel: std::fmt::Debug {
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/regime/mod.rs:98:12
|
|
|
|
|
98 | pub struct RegimeDetection {
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/regime/mod.rs:115:12
|
|
|
|
|
115 | pub struct RegimeModelMetadata {
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/regime/mod.rs:130:12
|
|
|
|
|
130 | pub struct RegimeTrainingData {
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/regime/mod.rs:145:12
|
|
|
|
|
145 | pub struct RegimeModelMetrics {
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/regime/mod.rs:162:12
|
|
|
|
|
162 | pub struct RegimeFeatureExtractor {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/regime/mod.rs:205:12
|
|
|
|
|
205 | pub struct RegimeTransitionTracker {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/regime/mod.rs:218:12
|
|
|
|
|
218 | pub struct RegimeTransition {
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/regime/mod.rs:248:12
|
|
|
|
|
248 | pub struct RegimePerformanceTracker {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/regime/mod.rs:260:12
|
|
|
|
|
260 | pub struct RegimePerformance {
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/regime/mod.rs:373:55
|
|
|
|
|
373 | /// ML Classifier for regime detection using existing ModelTrait infrastructure
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
373 - /// ML Classifier for regime detection using existing ModelTrait infrastructure
|
|
373 + /// ML Classifier for regime detection using existing `ModelTrait` infrastructure
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/regime/mod.rs:380:26
|
|
|
|
|
380 | /// Model type (svm, random_forest, neural_network)
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
380 - /// Model type (svm, random_forest, neural_network)
|
|
380 + /// Model type (svm, `random_forest`, neural_network)
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/regime/mod.rs:380:41
|
|
|
|
|
380 | /// Model type (svm, random_forest, neural_network)
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
380 - /// Model type (svm, random_forest, neural_network)
|
|
380 + /// Model type (svm, random_forest, `neural_network`)
|
|
|
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:495:43
|
|
|
|
|
495 | self.handle_regime_transition(detection.regime.clone(), detection.confidence)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `detection.regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/regime/mod.rs:533:5
|
|
|
|
|
533 | / pub fn get_current_regime(&self) -> &MarketRegime {
|
|
534 | | &self.current_regime
|
|
535 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
533 | pub const fn get_current_regime(&self) -> &MarketRegime {
|
|
| +++++
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/regime/mod.rs:538:5
|
|
|
|
|
538 | / pub fn get_transition_history(&self) -> &VecDeque<RegimeTransition> {
|
|
539 | | &self.transition_tracker.regime_history
|
|
540 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
538 | pub const fn get_transition_history(&self) -> &VecDeque<RegimeTransition> {
|
|
| +++++
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/regime/mod.rs:548:5
|
|
|
|
|
548 | / pub fn get_all_regime_performance(&self) -> &HashMap<MarketRegime, RegimePerformance> {
|
|
549 | | &self.performance_tracker.regime_performance
|
|
550 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
548 | pub const fn get_all_regime_performance(&self) -> &HashMap<MarketRegime, RegimePerformance> {
|
|
| +++++
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:581:49
|
|
|
|
|
581 | MLClassifierRegimeDetector::new("default".to_string()).await?,
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"default".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:584:49
|
|
|
|
|
584 | MLClassifierRegimeDetector::new("default".to_string()).await?,
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"default".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:604:26
|
|
|
|
|
604 | from_regime: self.current_regime.clone(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.current_regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:605:24
|
|
|
|
|
605 | to_regime: new_regime.clone(),
|
|
| ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:662:34
|
|
|
|
|
662 | let return_val = (recent_prices[0] / recent_prices[1]).ln();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:662:35
|
|
|
|
|
662 | let return_val = (recent_prices[0] / recent_prices[1]).ln();
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:662:54
|
|
|
|
|
662 | let return_val = (recent_prices[0] / recent_prices[1]).ln();
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/regime/mod.rs:764:5
|
|
|
|
|
764 | fn calculate_volatility_features(&self) -> Result<Vec<f64>> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
764 - fn calculate_volatility_features(&self) -> Result<Vec<f64>> {
|
|
764 + fn calculate_volatility_features(&self) -> std::vec::Vec<f64> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
784 - Ok(features)
|
|
784 + features
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:780:31
|
|
|
|
|
780 | features.push(0.0);
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: slicing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:767:25
|
|
|
|
|
767 | for &window in &self.windows[..2] {
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(..n)`or `.get_mut(..n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/regime/mod.rs:788:5
|
|
|
|
|
788 | fn calculate_return_features(&self) -> Result<Vec<f64>> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
788 - fn calculate_return_features(&self) -> Result<Vec<f64>> {
|
|
788 + fn calculate_return_features(&self) -> std::vec::Vec<f64> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
810 - Ok(features)
|
|
810 + features
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:807:34
|
|
|
|
|
807 | features.extend(vec![0.0; 3]);
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:796:31
|
|
|
|
|
796 | let mean_return = recent_returns.iter().sum::<f64>() / recent_returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:796:68
|
|
|
|
|
796 | let mean_return = recent_returns.iter().sum::<f64>() / recent_returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/regime/mod.rs:814:5
|
|
|
|
|
814 | fn calculate_volume_features(&self) -> Result<Vec<f64>> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
814 - fn calculate_volume_features(&self) -> Result<Vec<f64>> {
|
|
814 + fn calculate_volume_features(&self) -> std::vec::Vec<f64> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
847 - Ok(features)
|
|
847 + features
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:837:46
|
|
|
|
|
837 | let volume_ratio = if long_avg > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:840:17
|
|
|
|
|
840 | 1.0
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:844:27
|
|
|
|
|
844 | features.push(1.0);
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:833:30
|
|
|
|
|
833 | let recent_avg = recent_volumes.iter().sum::<f64>() / recent_volumes.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:833:67
|
|
|
|
|
833 | let recent_avg = recent_volumes.iter().sum::<f64>() / recent_volumes.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:834:28
|
|
|
|
|
834 | let long_avg = long_volumes.iter().sum::<f64>() / long_volumes.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:834:63
|
|
|
|
|
834 | let long_avg = long_volumes.iter().sum::<f64>() / long_volumes.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:838:17
|
|
|
|
|
838 | recent_avg / long_avg
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/regime/mod.rs:851:5
|
|
|
|
|
851 | fn calculate_trend_features(&self) -> Result<Vec<f64>> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
851 - fn calculate_trend_features(&self) -> Result<Vec<f64>> {
|
|
851 + fn calculate_trend_features(&self) -> std::vec::Vec<f64> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
870 - Ok(features)
|
|
870 + features
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:867:27
|
|
|
|
|
867 | features.push(0.0);
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/regime/mod.rs:874:5
|
|
|
|
|
874 | fn calculate_technical_indicators(&self) -> Result<Vec<f64>> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
874 - fn calculate_technical_indicators(&self) -> Result<Vec<f64>> {
|
|
874 + fn calculate_technical_indicators(&self) -> std::vec::Vec<f64> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
905 - Ok(features)
|
|
905 + features
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:902:34
|
|
|
|
|
902 | features.extend(vec![0.5, 0.0, 0.5, 1.0, 1.0]); // Neutral values
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:902:39
|
|
|
|
|
902 | features.extend(vec![0.5, 0.0, 0.5, 1.0, 1.0]); // Neutral values
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:902:44
|
|
|
|
|
902 | features.extend(vec![0.5, 0.0, 0.5, 1.0, 1.0]); // Neutral values
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:902:49
|
|
|
|
|
902 | features.extend(vec![0.5, 0.0, 0.5, 1.0, 1.0]); // Neutral values
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:902:54
|
|
|
|
|
902 | features.extend(vec![0.5, 0.0, 0.5, 1.0, 1.0]); // Neutral values
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/regime/mod.rs:909:5
|
|
|
|
|
909 | fn calculate_microstructure_features(&self) -> Result<Vec<f64>> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
909 - fn calculate_microstructure_features(&self) -> Result<Vec<f64>> {
|
|
909 + fn calculate_microstructure_features(&self) -> std::vec::Vec<f64> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
935 - Ok(features)
|
|
935 + features
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:932:34
|
|
|
|
|
932 | features.extend(vec![0.001, 0.0, 0.0]); // Default microstructure values
|
|
| ^^^^^ help: consider adding suffix: `0.001_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:932:41
|
|
|
|
|
932 | features.extend(vec![0.001, 0.0, 0.0]); // Default microstructure values
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:932:46
|
|
|
|
|
932 | features.extend(vec![0.001, 0.0, 0.0]); // Default microstructure values
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:916:30
|
|
|
|
|
916 | let avg_spread = recent_prices
|
|
| ______________________________^
|
|
917 | | .iter()
|
|
918 | | .map(|p| (p.high - p.low) / p.price)
|
|
919 | | .sum::<f64>()
|
|
920 | | / recent_prices.len() as f64;
|
|
| |____________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:920:19
|
|
|
|
|
920 | / recent_prices.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/regime/mod.rs:939:5
|
|
|
|
|
939 | fn calculate_correlation_features(&self) -> Result<Vec<f64>> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
939 - fn calculate_correlation_features(&self) -> Result<Vec<f64>> {
|
|
939 + fn calculate_correlation_features(&self) -> std::vec::Vec<f64> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
958 - Ok(features)
|
|
958 + features
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:955:34
|
|
|
|
|
955 | features.extend(vec![0.0, 1.0]); // Neutral correlation and beta
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:955:39
|
|
|
|
|
955 | features.extend(vec![0.0, 1.0]); // Neutral correlation and beta
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/regime/mod.rs:962:5
|
|
|
|
|
962 | fn calculate_stress_indicators(&self) -> Result<Vec<f64>> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
962 - fn calculate_stress_indicators(&self) -> Result<Vec<f64>> {
|
|
962 + fn calculate_stress_indicators(&self) -> std::vec::Vec<f64> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
984 - Ok(features)
|
|
984 + features
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:981:34
|
|
|
|
|
981 | features.extend(vec![0.0, 0.0, 0.0]); // Low stress indicators
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:981:39
|
|
|
|
|
981 | features.extend(vec![0.0, 0.0, 0.0]); // Low stress indicators
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:981:44
|
|
|
|
|
981 | features.extend(vec![0.0, 0.0, 0.0]); // Low stress indicators
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/regime/mod.rs:988:5
|
|
|
|
|
988 | fn calculate_liquidity_features(&self) -> Result<Vec<f64>> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
988 - fn calculate_liquidity_features(&self) -> Result<Vec<f64>> {
|
|
988 + fn calculate_liquidity_features(&self) -> std::vec::Vec<f64> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1020- Ok(features)
|
|
1020+ features
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1017:34
|
|
|
|
|
1017 | features.extend(vec![0.0, 0.0]); // Neutral liquidity
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1017:39
|
|
|
|
|
1017 | features.extend(vec![0.0, 0.0]); // Neutral liquidity
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/regime/mod.rs:1024:5
|
|
|
|
|
1024 | fn calculate_persistence_features(&self) -> Result<Vec<f64>> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1024 - fn calculate_persistence_features(&self) -> Result<Vec<f64>> {
|
|
1024 + fn calculate_persistence_features(&self) -> std::vec::Vec<f64> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1041 - Ok(features)
|
|
1041 + features
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1038:34
|
|
|
|
|
1038 | features.extend(vec![0.0, 0.5]); // No persistence, random walk
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1038:39
|
|
|
|
|
1038 | features.extend(vec![0.0, 0.5]); // No persistence, random walk
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1048:25
|
|
|
|
|
1048 | .insert("volatility_short".to_string(), features[0]);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"volatility_short".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1048:57
|
|
|
|
|
1048 | .insert("volatility_short".to_string(), features[0]);
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1050:25
|
|
|
|
|
1050 | .insert("volatility_long".to_string(), features[1]);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"volatility_long".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1050:56
|
|
|
|
|
1050 | .insert("volatility_long".to_string(), features[1]);
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1052:25
|
|
|
|
|
1052 | .insert("return_mean".to_string(), features[2]);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"return_mean".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1052:52
|
|
|
|
|
1052 | .insert("return_mean".to_string(), features[2]);
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1054:25
|
|
|
|
|
1054 | .insert("return_skew".to_string(), features[3]);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"return_skew".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1054:52
|
|
|
|
|
1054 | .insert("return_skew".to_string(), features[3]);
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1056:25
|
|
|
|
|
1056 | .insert("return_kurtosis".to_string(), features[4]);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"return_kurtosis".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1056:56
|
|
|
|
|
1056 | .insert("return_kurtosis".to_string(), features[4]);
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1058:25
|
|
|
|
|
1058 | .insert("volume_ratio".to_string(), features[5]);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"volume_ratio".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1058:53
|
|
|
|
|
1058 | .insert("volume_ratio".to_string(), features[5]);
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1060:25
|
|
|
|
|
1060 | .insert("trend_slope".to_string(), features[6]);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"trend_slope".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1060:52
|
|
|
|
|
1060 | .insert("trend_slope".to_string(), features[6]);
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1062:25
|
|
|
|
|
1062 | .insert("momentum".to_string(), features[7]);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `"momentum".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1062:49
|
|
|
|
|
1062 | .insert("momentum".to_string(), features[7]);
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1064:43
|
|
|
|
|
1064 | self.feature_cache.insert("macd".to_string(), features[8]);
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"macd".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1064:63
|
|
|
|
|
1064 | self.feature_cache.insert("macd".to_string(), features[8]);
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1068:29
|
|
|
|
|
1068 | .insert("bollinger_position".to_string(), features[9]);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"bollinger_position".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1068:63
|
|
|
|
|
1068 | .insert("bollinger_position".to_string(), features[9]);
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1079:20
|
|
|
|
|
1079 | let mean = returns.iter().sum::<f64>() / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1079:50
|
|
|
|
|
1079 | let mean = returns.iter().sum::<f64>() / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1081:13
|
|
|
|
|
1081 | returns.iter().map(|r| (r - mean).powi(2)).sum::<f64>() / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1081:71
|
|
|
|
|
1081 | returns.iter().map(|r| (r - mean).powi(2)).sum::<f64>() / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1094:24
|
|
|
|
|
1094 | if variance == 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1092:24
|
|
|
|
|
1092 | let variance = values.iter().map(|v| (v - mean).powi(2)).sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1092:81
|
|
|
|
|
1092 | let variance = values.iter().map(|v| (v - mean).powi(2)).sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1099:24
|
|
|
|
|
1099 | let skewness = values
|
|
| ________________________^
|
|
1100 | | .iter()
|
|
1101 | | .map(|v| ((v - mean) / std_dev).powi(3))
|
|
1102 | | .sum::<f64>()
|
|
1103 | | / values.len() as f64;
|
|
| |_________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1103:15
|
|
|
|
|
1103 | / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1116:24
|
|
|
|
|
1116 | if variance == 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1114:24
|
|
|
|
|
1114 | let variance = values.iter().map(|v| (v - mean).powi(2)).sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1114:81
|
|
|
|
|
1114 | let variance = values.iter().map(|v| (v - mean).powi(2)).sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1121:24
|
|
|
|
|
1121 | let kurtosis = values
|
|
| ________________________^
|
|
1122 | | .iter()
|
|
1123 | | .map(|v| ((v - mean) / std_dev).powi(4))
|
|
1124 | | .sum::<f64>()
|
|
1125 | | / values.len() as f64;
|
|
| |_________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1125:15
|
|
|
|
|
1125 | / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1127:9
|
|
|
|
|
1127 | kurtosis - 3.0 // Excess kurtosis
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1138:27
|
|
|
|
|
1138 | let x_mean = (n - 1.0) / 2.0;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1138:34
|
|
|
|
|
1138 | let x_mean = (n - 1.0) / 2.0;
|
|
| ^^^ help: consider adding suffix: `2.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1137:17
|
|
|
|
|
1137 | let n = prices.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1138:22
|
|
|
|
|
1138 | let x_mean = (n - 1.0) / 2.0;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1139:22
|
|
|
|
|
1139 | let y_mean = prices.iter().sum::<f64>() / n;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1144:28
|
|
|
|
|
1144 | .map(|(i, &y)| (i as f64 - x_mean) * (y - y_mean))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1144:29
|
|
|
|
|
1144 | .map(|(i, &y)| (i as f64 - x_mean) * (y - y_mean))
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1147:58
|
|
|
|
|
1147 | let denominator: f64 = (0..prices.len()).map(|i| (i as f64 - x_mean).powi(2)).sum();
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1147:59
|
|
|
|
|
1147 | let denominator: f64 = (0..prices.len()).map(|i| (i as f64 - x_mean).powi(2)).sum();
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1152:13
|
|
|
|
|
1152 | numerator / denominator
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1163:63
|
|
|
|
|
1163 | let recent_avg = prices.iter().take(7).sum::<f64>() / 7.0;
|
|
| ^^^ help: consider adding suffix: `7.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1164:70
|
|
|
|
|
1164 | let older_avg = prices.iter().skip(7).take(7).sum::<f64>() / 7.0;
|
|
| ^^^ help: consider adding suffix: `7.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1166:25
|
|
|
|
|
1166 | if older_avg == 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1163:26
|
|
|
|
|
1163 | let recent_avg = prices.iter().take(7).sum::<f64>() / 7.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1164:25
|
|
|
|
|
1164 | let older_avg = prices.iter().skip(7).take(7).sum::<f64>() / 7.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1170:24
|
|
|
|
|
1170 | let momentum = recent_avg / older_avg;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1173:9
|
|
|
|
|
1173 | (momentum - 0.5).tanh() * 0.5 + 0.5
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1185:9
|
|
|
|
|
1185 | ema12 - ema26
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1194:21
|
|
|
|
|
1194 | let alpha = 2.0 / (period as f64 + 1.0);
|
|
| ^^^ help: consider adding suffix: `2.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1194:44
|
|
|
|
|
1194 | let alpha = 2.0 / (period as f64 + 1.0);
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1198:36
|
|
|
|
|
1198 | ema = alpha * price + (1.0 - alpha) * ema;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1194:21
|
|
|
|
|
1194 | let alpha = 2.0 / (period as f64 + 1.0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1194:28
|
|
|
|
|
1194 | let alpha = 2.0 / (period as f64 + 1.0);
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1195:23
|
|
|
|
|
1195 | let mut ema = prices[0];
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1198:19
|
|
|
|
|
1198 | ema = alpha * price + (1.0 - alpha) * ema;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1214:23
|
|
|
|
|
1214 | if std_dev == 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1219:32
|
|
|
|
|
1219 | let upper_band = sma + 2.0 * std_dev;
|
|
| ^^^ help: consider adding suffix: `2.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1220:32
|
|
|
|
|
1220 | let lower_band = sma - 2.0 * std_dev;
|
|
| ^^^ help: consider adding suffix: `2.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1210:19
|
|
|
|
|
1210 | let sma = prices.iter().sum::<f64>() / prices.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1210:48
|
|
|
|
|
1210 | let sma = prices.iter().sum::<f64>() / prices.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1211:24
|
|
|
|
|
1211 | let variance = prices.iter().map(|p| (p - sma).powi(2)).sum::<f64>() / prices.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1211:80
|
|
|
|
|
1211 | let variance = prices.iter().map(|p| (p - sma).powi(2)).sum::<f64>() / prices.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1218:29
|
|
|
|
|
1218 | let current_price = prices[prices.len() - 1];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:1218:36
|
|
|
|
|
1218 | let current_price = prices[prices.len() - 1];
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1219:26
|
|
|
|
|
1219 | let upper_band = sma + 2.0 * std_dev;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1220:26
|
|
|
|
|
1220 | let lower_band = sma - 2.0 * std_dev;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1226:9
|
|
|
|
|
1226 | ((current_price - lower_band) / (upper_band - lower_band)).clamp(0.0, 1.0)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1236:59
|
|
|
|
|
1236 | let returns: Vec<f64> = prices.windows(2).map(|w| (w[1] - w[0]) / w[0]).collect();
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1236:60
|
|
|
|
|
1236 | let returns: Vec<f64> = prices.windows(2).map(|w| (w[1] - w[0]) / w[0]).collect();
|
|
| ^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1236:67
|
|
|
|
|
1236 | let returns: Vec<f64> = prices.windows(2).map(|w| (w[1] - w[0]) / w[0]).collect();
|
|
| ^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1236:75
|
|
|
|
|
1236 | let returns: Vec<f64> = prices.windows(2).map(|w| (w[1] - w[0]) / w[0]).collect();
|
|
| ^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: slicing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1248:18
|
|
|
|
|
1248 | let x = &asset1_returns[..min_len];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(..n)`or `.get_mut(..n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: slicing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1249:18
|
|
|
|
|
1249 | let y = &asset2_returns[..min_len];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(..n)`or `.get_mut(..n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1251:22
|
|
|
|
|
1251 | let x_mean = x.iter().sum::<f64>() / min_len as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1251:46
|
|
|
|
|
1251 | let x_mean = x.iter().sum::<f64>() / min_len as f64;
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1252:22
|
|
|
|
|
1252 | let y_mean = y.iter().sum::<f64>() / min_len as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1252:46
|
|
|
|
|
1252 | let y_mean = y.iter().sum::<f64>() / min_len as f64;
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1257:29
|
|
|
|
|
1257 | .map(|(xi, yi)| (xi - x_mean) * (yi - y_mean))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1260:44
|
|
|
|
|
1260 | let x_var: f64 = x.iter().map(|xi| (xi - x_mean).powi(2)).sum();
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1261:44
|
|
|
|
|
1261 | let y_var: f64 = y.iter().map(|yi| (yi - y_mean).powi(2)).sum();
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1263:27
|
|
|
|
|
1263 | let denominator = (x_var * y_var).sqrt();
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1268:13
|
|
|
|
|
1268 | numerator / denominator
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: slicing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1279:22
|
|
|
|
|
1279 | let asset = &asset_returns[..min_len];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(..n)`or `.get_mut(..n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: slicing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1280:23
|
|
|
|
|
1280 | let market = &market_returns[..min_len];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(..n)`or `.get_mut(..n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1282:27
|
|
|
|
|
1282 | let market_mean = market.iter().sum::<f64>() / min_len as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1282:56
|
|
|
|
|
1282 | let market_mean = market.iter().sum::<f64>() / min_len as f64;
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1283:26
|
|
|
|
|
1283 | let asset_mean = asset.iter().sum::<f64>() / min_len as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1283:54
|
|
|
|
|
1283 | let asset_mean = asset.iter().sum::<f64>() / min_len as f64;
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1285:31
|
|
|
|
|
1285 | let covariance: f64 = asset
|
|
| _______________________________^
|
|
1286 | | .iter()
|
|
1287 | | .zip(market.iter())
|
|
1288 | | .map(|(ai, mi)| (ai - asset_mean) * (mi - market_mean))
|
|
1289 | | .sum::<f64>()
|
|
1290 | | / min_len as f64;
|
|
| |____________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1290:15
|
|
|
|
|
1290 | / min_len as f64;
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1292:36
|
|
|
|
|
1292 | let market_variance: f64 = market
|
|
| ____________________________________^
|
|
1293 | | .iter()
|
|
1294 | | .map(|mi| (mi - market_mean).powi(2))
|
|
1295 | | .sum::<f64>()
|
|
1296 | | / min_len as f64;
|
|
| |____________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1296:15
|
|
|
|
|
1296 | / min_len as f64;
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1301:13
|
|
|
|
|
1301 | covariance / market_variance
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/regime/mod.rs:1305:34
|
|
|
|
|
1305 | /// Calculate tail risk (99% VaR approximation)
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1305 - /// Calculate tail risk (99% VaR approximation)
|
|
1305 + /// Calculate tail risk (99% `VaR` approximation)
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1315:25
|
|
|
|
|
1315 | let var_index = (sorted_returns.len() as f64 * 0.01).floor() as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1315:25
|
|
|
|
|
1315 | let var_index = (sorted_returns.len() as f64 * 0.01).floor() as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1315:26
|
|
|
|
|
1315 | let var_index = (sorted_returns.len() as f64 * 0.01).floor() as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1316:9
|
|
|
|
|
1316 | -sorted_returns[var_index] // Convert to positive number for tail risk
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1316:10
|
|
|
|
|
1316 | -sorted_returns[var_index] // Convert to positive number for tail risk
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1327:20
|
|
|
|
|
1327 | let mean = squared_returns.iter().sum::<f64>() / squared_returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1327:58
|
|
|
|
|
1327 | let mean = squared_returns.iter().sum::<f64>() / squared_returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1330:49
|
|
|
|
|
1330 | squared_returns.windows(2).map(|w| (w[0], w[1])).collect();
|
|
| ^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1330:55
|
|
|
|
|
1330 | squared_returns.windows(2).map(|w| (w[0], w[1])).collect();
|
|
| ^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1338:27
|
|
|
|
|
1338 | .map(|(x, y)| (x - mean) * (y - mean))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1341:63
|
|
|
|
|
1341 | let denominator: f64 = squared_returns.iter().map(|x| (x - mean).powi(2)).sum();
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1346:13
|
|
|
|
|
1346 | numerator / denominator
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1360:23
|
|
|
|
|
1360 | if std_dev == 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1357:20
|
|
|
|
|
1357 | let mean = returns.iter().sum::<f64>() / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1357:50
|
|
|
|
|
1357 | let mean = returns.iter().sum::<f64>() / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1367:46
|
|
|
|
|
1367 | .filter(|&&r| (r - mean).abs() > 3.0 * std_dev)
|
|
| ^^^ help: consider adding suffix: `3.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1367:27
|
|
|
|
|
1367 | .filter(|&&r| (r - mean).abs() > 3.0 * std_dev)
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1367:46
|
|
|
|
|
1367 | .filter(|&&r| (r - mean).abs() > 3.0 * std_dev)
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1370:9
|
|
|
|
|
1370 | jump_count as f64 / returns.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1370:9
|
|
|
|
|
1370 | jump_count as f64 / returns.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1370:29
|
|
|
|
|
1370 | jump_count as f64 / returns.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1379:65
|
|
|
|
|
1379 | let price_returns: Vec<f64> = prices.windows(2).map(|w| (w[1] - w[0]) / w[0]).collect();
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1379:66
|
|
|
|
|
1379 | let price_returns: Vec<f64> = prices.windows(2).map(|w| (w[1] - w[0]) / w[0]).collect();
|
|
| ^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1379:73
|
|
|
|
|
1379 | let price_returns: Vec<f64> = prices.windows(2).map(|w| (w[1] - w[0]) / w[0]).collect();
|
|
| ^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1379:81
|
|
|
|
|
1379 | let price_returns: Vec<f64> = prices.windows(2).map(|w| (w[1] - w[0]) / w[0]).collect();
|
|
| ^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1381:67
|
|
|
|
|
1381 | let volume_changes: Vec<f64> = volumes.windows(2).map(|w| (w[1] - w[0]) / w[0]).collect();
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1381:68
|
|
|
|
|
1381 | let volume_changes: Vec<f64> = volumes.windows(2).map(|w| (w[1] - w[0]) / w[0]).collect();
|
|
| ^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1381:75
|
|
|
|
|
1381 | let volume_changes: Vec<f64> = volumes.windows(2).map(|w| (w[1] - w[0]) / w[0]).collect();
|
|
| ^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1381:83
|
|
|
|
|
1381 | let volume_changes: Vec<f64> = volumes.windows(2).map(|w| (w[1] - w[0]) / w[0]).collect();
|
|
| ^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1395:36
|
|
|
|
|
1395 | .map(|(r, v)| if *v == 0.0 { 0.0 } else { r.abs() / v })
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1395:42
|
|
|
|
|
1395 | .map(|(r, v)| if *v == 0.0 { 0.0 } else { r.abs() / v })
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1395:55
|
|
|
|
|
1395 | .map(|(r, v)| if *v == 0.0 { 0.0 } else { r.abs() / v })
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1398:9
|
|
|
|
|
1398 | illiquidity_sum / returns.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1398:27
|
|
|
|
|
1398 | illiquidity_sum / returns.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1407:20
|
|
|
|
|
1407 | let mean = values.iter().sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1407:49
|
|
|
|
|
1407 | let mean = values.iter().sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1409:70
|
|
|
|
|
1409 | let lag1_pairs: Vec<(f64, f64)> = values.windows(2).map(|w| (w[0], w[1])).collect();
|
|
| ^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1409:76
|
|
|
|
|
1409 | let lag1_pairs: Vec<(f64, f64)> = values.windows(2).map(|w| (w[0], w[1])).collect();
|
|
| ^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1417:27
|
|
|
|
|
1417 | .map(|(x, y)| (x - mean) * (y - mean))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1420:54
|
|
|
|
|
1420 | let denominator: f64 = values.iter().map(|x| (x - mean).powi(2)).sum();
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1425:13
|
|
|
|
|
1425 | numerator / denominator
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1439:26
|
|
|
|
|
1439 | let mut cumsum = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1459:23
|
|
|
|
|
1459 | if std_dev == 0.0 || range == 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1459:39
|
|
|
|
|
1459 | if std_dev == 0.0 || range == 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1435:20
|
|
|
|
|
1435 | let mean = values.iter().sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1435:49
|
|
|
|
|
1435 | let mean = values.iter().sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1442:13
|
|
|
|
|
1442 | cumsum += value - mean;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1453:21
|
|
|
|
|
1453 | let range = max_dev - min_dev;
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1456:24
|
|
|
|
|
1456 | let variance = values.iter().map(|v| (v - mean).powi(2)).sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1456:81
|
|
|
|
|
1456 | let variance = values.iter().map(|v| (v - mean).powi(2)).sum::<f64>() / values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1464:18
|
|
|
|
|
1464 | let rs = range / std_dev;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1465:17
|
|
|
|
|
1465 | let n = values.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1471:13
|
|
|
|
|
1471 | (rs.ln() / n.ln()).clamp(0.0, 1.0)
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1489:25
|
|
|
|
|
1489 | ratios.push(1.0);
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1497:25
|
|
|
|
|
1497 | ratios.push(1.0);
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1505:25
|
|
|
|
|
1505 | ratios.push(1.0);
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1481:29
|
|
|
|
|
1481 | let current_price = prices[prices.len() - 1];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:1481:36
|
|
|
|
|
1481 | let current_price = prices[prices.len() - 1];
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1486:29
|
|
|
|
|
1486 | let ma10: f64 = prices.iter().rev().take(10).sum::<f64>() / 10.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1487:25
|
|
|
|
|
1487 | ratios.push(current_price / ma10);
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1494:29
|
|
|
|
|
1494 | let ma20: f64 = prices.iter().rev().take(20).sum::<f64>() / 20.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1495:25
|
|
|
|
|
1495 | ratios.push(current_price / ma20);
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1502:29
|
|
|
|
|
1502 | let ma50: f64 = prices.iter().rev().take(50).sum::<f64>() / 50.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1503:25
|
|
|
|
|
1503 | ratios.push(current_price / ma50);
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1517:28
|
|
|
|
|
1517 | let mut up_moves = 0;
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1518:30
|
|
|
|
|
1518 | let mut down_moves = 0;
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1519:39
|
|
|
|
|
1519 | let mut same_direction_runs = 0;
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1520:31
|
|
|
|
|
1520 | let mut current_run = 1;
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1521:34
|
|
|
|
|
1521 | let mut last_direction = 0; // 0 = same, 1 = up, -1 = down
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1525:29
|
|
|
|
|
1525 | up_moves += 1;
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1526:17
|
|
|
|
|
1526 | 1
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1528:31
|
|
|
|
|
1528 | down_moves += 1;
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1529:18
|
|
|
|
|
1529 | -1
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1531:17
|
|
|
|
|
1531 | 0
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1534:76
|
|
|
|
|
1534 | if current_direction == last_direction && current_direction != 0 {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1535:32
|
|
|
|
|
1535 | current_run += 1;
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1537:34
|
|
|
|
|
1537 | if current_run > 1 {
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1540:31
|
|
|
|
|
1540 | current_run = 1;
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1546:26
|
|
|
|
|
1546 | if current_run > 1 {
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1524:40
|
|
|
|
|
1524 | let current_direction = if price_points[i].price > price_points[i - 1].price {
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1524:64
|
|
|
|
|
1524 | let current_direction = if price_points[i].price > price_points[i - 1].price {
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:1524:77
|
|
|
|
|
1524 | let current_direction = if price_points[i].price > price_points[i - 1].price {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:1525:17
|
|
|
|
|
1525 | up_moves += 1;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1527:23
|
|
|
|
|
1527 | } else if price_points[i].price < price_points[i - 1].price {
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:1527:47
|
|
|
|
|
1527 | } else if price_points[i].price < price_points[i - 1].price {
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:1527:60
|
|
|
|
|
1527 | } else if price_points[i].price < price_points[i - 1].price {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:1528:17
|
|
|
|
|
1528 | down_moves += 1;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:1535:17
|
|
|
|
|
1535 | current_run += 1;
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:1538:21
|
|
|
|
|
1538 | same_direction_runs += current_run;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:1547:13
|
|
|
|
|
1547 | same_direction_runs += current_run;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:1550:27
|
|
|
|
|
1550 | let total_moves = up_moves + down_moves;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1554:13
|
|
|
|
|
1554 | same_direction_runs as f64 / total_moves as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1554:13
|
|
|
|
|
1554 | same_direction_runs as f64 / total_moves as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1554:42
|
|
|
|
|
1554 | same_direction_runs as f64 / total_moves as f64
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1571:32
|
|
|
|
|
1571 | let base = r * 0.8; // Correlated component
|
|
| ^^^ help: consider adding suffix: `0.8_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1572:54
|
|
|
|
|
1572 | let noise = (i as f64 * 0.1).sin() * 0.02; // Small noise component
|
|
| ^^^^ help: consider adding suffix: `0.02_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1571:28
|
|
|
|
|
1571 | let base = r * 0.8; // Correlated component
|
|
| ^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1572:29
|
|
|
|
|
1572 | let noise = (i as f64 * 0.1).sin() * 0.02; // Small noise component
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1572:30
|
|
|
|
|
1572 | let noise = (i as f64 * 0.1).sin() * 0.02; // Small noise component
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1573:17
|
|
|
|
|
1573 | base + noise
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1592:23
|
|
|
|
|
1592 | if std_dev == 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1597:30
|
|
|
|
|
1597 | let jump_threshold = 2.5 * std_dev;
|
|
| ^^^ help: consider adding suffix: `2.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1587:20
|
|
|
|
|
1587 | let mean = returns.iter().sum::<f64>() / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1587:50
|
|
|
|
|
1587 | let mean = returns.iter().sum::<f64>() / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1589:13
|
|
|
|
|
1589 | returns.iter().map(|r| (r - mean).powi(2)).sum::<f64>() / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1589:71
|
|
|
|
|
1589 | returns.iter().map(|r| (r - mean).powi(2)).sum::<f64>() / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1597:30
|
|
|
|
|
1597 | let jump_threshold = 2.5 * std_dev;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1600:27
|
|
|
|
|
1600 | .filter(|&&r| (r - mean).abs() > jump_threshold)
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1603:9
|
|
|
|
|
1603 | jump_count as f64 / returns.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1603:9
|
|
|
|
|
1603 | jump_count as f64 / returns.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:1603:29
|
|
|
|
|
1603 | jump_count as f64 / returns.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/regime/mod.rs:1663:9
|
|
|
|
|
1663 | /// VaR multiplier for regime-specific risk
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1663 - /// VaR multiplier for regime-specific risk
|
|
1663 + /// `VaR` multiplier for regime-specific risk
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1763:59
|
|
|
|
|
1763 | bull_weights.insert("momentum_model".to_string(), 0.4);
|
|
| ^^^ help: consider adding suffix: `0.4_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1764:57
|
|
|
|
|
1764 | bull_weights.insert("growth_model".to_string(), 0.3);
|
|
| ^^^ help: consider adding suffix: `0.3_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1765:65
|
|
|
|
|
1765 | bull_weights.insert("mean_reversion_model".to_string(), 0.2);
|
|
| ^^^ help: consider adding suffix: `0.2_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1766:61
|
|
|
|
|
1766 | bull_weights.insert("volatility_model".to_string(), 0.1);
|
|
| ^^^ help: consider adding suffix: `0.1_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1771:59
|
|
|
|
|
1771 | bear_weights.insert("momentum_model".to_string(), 0.1);
|
|
| ^^^ help: consider adding suffix: `0.1_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1772:57
|
|
|
|
|
1772 | bear_weights.insert("growth_model".to_string(), 0.1);
|
|
| ^^^ help: consider adding suffix: `0.1_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1773:65
|
|
|
|
|
1773 | bear_weights.insert("mean_reversion_model".to_string(), 0.4);
|
|
| ^^^ help: consider adding suffix: `0.4_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1774:61
|
|
|
|
|
1774 | bear_weights.insert("volatility_model".to_string(), 0.4);
|
|
| ^^^ help: consider adding suffix: `0.4_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1779:63
|
|
|
|
|
1779 | high_vol_weights.insert("momentum_model".to_string(), 0.2);
|
|
| ^^^ help: consider adding suffix: `0.2_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1780:61
|
|
|
|
|
1780 | high_vol_weights.insert("growth_model".to_string(), 0.1);
|
|
| ^^^ help: consider adding suffix: `0.1_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1781:69
|
|
|
|
|
1781 | high_vol_weights.insert("mean_reversion_model".to_string(), 0.4);
|
|
| ^^^ help: consider adding suffix: `0.4_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1782:65
|
|
|
|
|
1782 | high_vol_weights.insert("volatility_model".to_string(), 0.3);
|
|
| ^^^ help: consider adding suffix: `0.3_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1763:29
|
|
|
|
|
1763 | bull_weights.insert("momentum_model".to_string(), 0.4);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"momentum_model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1764:29
|
|
|
|
|
1764 | bull_weights.insert("growth_model".to_string(), 0.3);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"growth_model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1765:29
|
|
|
|
|
1765 | bull_weights.insert("mean_reversion_model".to_string(), 0.2);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"mean_reversion_model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1766:29
|
|
|
|
|
1766 | bull_weights.insert("volatility_model".to_string(), 0.1);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"volatility_model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1771:29
|
|
|
|
|
1771 | bear_weights.insert("momentum_model".to_string(), 0.1);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"momentum_model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1772:29
|
|
|
|
|
1772 | bear_weights.insert("growth_model".to_string(), 0.1);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"growth_model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1773:29
|
|
|
|
|
1773 | bear_weights.insert("mean_reversion_model".to_string(), 0.4);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"mean_reversion_model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1774:29
|
|
|
|
|
1774 | bear_weights.insert("volatility_model".to_string(), 0.4);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"volatility_model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1779:33
|
|
|
|
|
1779 | high_vol_weights.insert("momentum_model".to_string(), 0.2);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"momentum_model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1780:33
|
|
|
|
|
1780 | high_vol_weights.insert("growth_model".to_string(), 0.1);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"growth_model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1781:33
|
|
|
|
|
1781 | high_vol_weights.insert("mean_reversion_model".to_string(), 0.4);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"mean_reversion_model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:1782:33
|
|
|
|
|
1782 | high_vol_weights.insert("volatility_model".to_string(), 0.3);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"volatility_model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:1794:17
|
|
|
|
|
1794 | regime.clone(),
|
|
| ^^^^^^^^^^^^^^ help: try removing the `clone` call: `regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: the function has a cognitive complexity of (32/30)
|
|
--> adaptive-strategy/src/regime/mod.rs:1889:18
|
|
|
|
|
1889 | pub async fn process_regime_change(
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cognitive_complexity
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:1916:46
|
|
|
|
|
1916 | *self.current_regime.write().await = detection.regime.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `detection.regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:1936:24
|
|
|
|
|
1936 | to_regime: detection.regime.clone(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `detection.regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1969:81
|
|
|
|
|
1969 | let old_weight = current_weights.get(model_name).copied().unwrap_or(0.0);
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:1971:50
|
|
|
|
|
1971 | if (old_weight - new_weight).abs() > 0.01 {
|
|
| ^^^^ help: consider adding suffix: `0.01_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:1971:16
|
|
|
|
|
1971 | if (old_weight - new_weight).abs() > 0.01 {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2010:29
|
|
|
|
|
2010 | model_name: "ensemble".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `"ensemble".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2019:33
|
|
|
|
|
2019 | model_name: "ensemble".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `"ensemble".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:2101:9
|
|
|
|
|
2101 | performance.period_count += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/regime/mod.rs:2127:12
|
|
|
|
|
2127 | pub struct RegimeAwareModel {
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/regime/mod.rs:2146:12
|
|
|
|
|
2146 | pub struct RegimeAwarePrediction {
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/regime/mod.rs:2165:12
|
|
|
|
|
2165 | pub struct RegimeAwareTrainingConfig {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:2228:46
|
|
|
|
|
2228 | *self.current_regime.write().await = regime_detection.regime.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `regime_detection.regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2299:28
|
|
|
|
|
2299 | .unwrap_or(0.0);
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
|
|
--> adaptive-strategy/src/regime/mod.rs:2307:46
|
|
|
|
|
2307 | fn encode_regime_features(&self, regime: &MarketRegime) -> Vec<f64> {
|
|
| ^^^^^^^^^^^^^ help: consider passing by value instead: `MarketRegime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref
|
|
= note: requested on the command line with `-W clippy::trivially-copy-pass-by-ref`
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2308:33
|
|
|
|
|
2308 | let mut features = vec![0.0; 12]; // 12 possible regimes
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2325:27
|
|
|
|
|
2325 | features[index] = 1.0;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2325:9
|
|
|
|
|
2325 | features[index] = 1.0;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2347:50
|
|
|
|
|
2347 | adjusted_prediction.value *= 1.1;
|
|
| ^^^ help: consider adding suffix: `1.1_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2348:55
|
|
|
|
|
2348 | adjusted_prediction.confidence *= 1.02;
|
|
| ^^^^ help: consider adding suffix: `1.02_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2352:52
|
|
|
|
|
2352 | if adjusted_prediction.value > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2353:54
|
|
|
|
|
2353 | adjusted_prediction.value *= 1.1;
|
|
| ^^^ help: consider adding suffix: `1.1_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2355:55
|
|
|
|
|
2355 | adjusted_prediction.confidence *= 1.05;
|
|
| ^^^^ help: consider adding suffix: `1.05_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2359:52
|
|
|
|
|
2359 | if adjusted_prediction.value > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2360:54
|
|
|
|
|
2360 | adjusted_prediction.value *= 0.8;
|
|
| ^^^ help: consider adding suffix: `0.8_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2362:55
|
|
|
|
|
2362 | adjusted_prediction.confidence *= 0.9;
|
|
| ^^^ help: consider adding suffix: `0.9_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2366:50
|
|
|
|
|
2366 | adjusted_prediction.value *= 1.2; // Expect larger moves
|
|
| ^^^ help: consider adding suffix: `1.2_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2367:55
|
|
|
|
|
2367 | adjusted_prediction.confidence *= 0.8; // But less confident
|
|
| ^^^ help: consider adding suffix: `0.8_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2371:50
|
|
|
|
|
2371 | adjusted_prediction.value *= 0.7;
|
|
| ^^^ help: consider adding suffix: `0.7_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2372:55
|
|
|
|
|
2372 | adjusted_prediction.confidence *= 1.1;
|
|
| ^^^ help: consider adding suffix: `1.1_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2376:50
|
|
|
|
|
2376 | adjusted_prediction.value *= 0.5;
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2377:55
|
|
|
|
|
2377 | adjusted_prediction.confidence *= 0.95;
|
|
| ^^^^ help: consider adding suffix: `0.95_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2381:50
|
|
|
|
|
2381 | adjusted_prediction.value *= 0.4;
|
|
| ^^^ help: consider adding suffix: `0.4_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2382:55
|
|
|
|
|
2382 | adjusted_prediction.confidence *= 0.5;
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2386:50
|
|
|
|
|
2386 | adjusted_prediction.value *= 0.9;
|
|
| ^^^ help: consider adding suffix: `0.9_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2387:55
|
|
|
|
|
2387 | adjusted_prediction.confidence *= 0.8;
|
|
| ^^^ help: consider adding suffix: `0.8_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2391:52
|
|
|
|
|
2391 | if adjusted_prediction.value > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2392:54
|
|
|
|
|
2392 | adjusted_prediction.value *= 0.7; // Reduce bullish bets
|
|
| ^^^ help: consider adding suffix: `0.7_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2394:55
|
|
|
|
|
2394 | adjusted_prediction.confidence *= 0.6;
|
|
| ^^^ help: consider adding suffix: `0.6_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2398:50
|
|
|
|
|
2398 | adjusted_prediction.value *= 0.8;
|
|
| ^^^ help: consider adding suffix: `0.8_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2399:55
|
|
|
|
|
2399 | adjusted_prediction.confidence *= 0.85;
|
|
| ^^^^ help: consider adding suffix: `0.85_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2403:50
|
|
|
|
|
2403 | adjusted_prediction.value *= 0.6;
|
|
| ^^^ help: consider adding suffix: `0.6_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2404:55
|
|
|
|
|
2404 | adjusted_prediction.confidence *= 0.7;
|
|
| ^^^ help: consider adding suffix: `0.7_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2347:21
|
|
|
|
|
2347 | adjusted_prediction.value *= 1.1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2348:21
|
|
|
|
|
2348 | adjusted_prediction.confidence *= 1.02;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2353:25
|
|
|
|
|
2353 | adjusted_prediction.value *= 1.1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2355:21
|
|
|
|
|
2355 | adjusted_prediction.confidence *= 1.05;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2360:25
|
|
|
|
|
2360 | adjusted_prediction.value *= 0.8;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2362:21
|
|
|
|
|
2362 | adjusted_prediction.confidence *= 0.9;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2366:21
|
|
|
|
|
2366 | adjusted_prediction.value *= 1.2; // Expect larger moves
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2367:21
|
|
|
|
|
2367 | adjusted_prediction.confidence *= 0.8; // But less confident
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2371:21
|
|
|
|
|
2371 | adjusted_prediction.value *= 0.7;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2372:21
|
|
|
|
|
2372 | adjusted_prediction.confidence *= 1.1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2376:21
|
|
|
|
|
2376 | adjusted_prediction.value *= 0.5;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2377:21
|
|
|
|
|
2377 | adjusted_prediction.confidence *= 0.95;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2381:21
|
|
|
|
|
2381 | adjusted_prediction.value *= 0.4;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2382:21
|
|
|
|
|
2382 | adjusted_prediction.confidence *= 0.5;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2386:21
|
|
|
|
|
2386 | adjusted_prediction.value *= 0.9;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2387:21
|
|
|
|
|
2387 | adjusted_prediction.confidence *= 0.8;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2392:25
|
|
|
|
|
2392 | adjusted_prediction.value *= 0.7; // Reduce bullish bets
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2394:21
|
|
|
|
|
2394 | adjusted_prediction.confidence *= 0.6;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2398:21
|
|
|
|
|
2398 | adjusted_prediction.value *= 0.8;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2399:21
|
|
|
|
|
2399 | adjusted_prediction.confidence *= 0.85;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2403:21
|
|
|
|
|
2403 | adjusted_prediction.value *= 0.6;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2404:21
|
|
|
|
|
2404 | adjusted_prediction.confidence *= 0.7;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2410:9
|
|
|
|
|
2410 | adjusted_prediction.confidence *= regime_detection.confidence;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:2448:43
|
|
|
|
|
2448 | regime_metrics.insert(regime.clone(), metrics.clone());
|
|
| ^^^^^^^^^^^^^^ help: try removing the `clone` call: `regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
error: this could be simplified with `bool::then`
|
|
--> adaptive-strategy/src/regime/mod.rs:2509:30
|
|
|
|
|
2509 | weights: if training_data.weights.is_some() {
|
|
| ______________________________^
|
|
2510 | | Some(Vec::new())
|
|
2511 | | } else {
|
|
2512 | | None
|
|
2513 | | },
|
|
| |_____________________^ help: try: `training_data.weights.is_some().then(|| Vec::new())`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_some_else_none
|
|
= note: requested on the command line with `-D clippy::if-then-some-else-none`
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2518:41
|
|
|
|
|
2518 | entry.features.push(training_data.features[i].clone());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2519:40
|
|
|
|
|
2519 | entry.targets.push(training_data.targets[i]);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2526:49
|
|
|
|
|
2526 | ... regime_weights.push(weights[i]);
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2554:17
|
|
|
|
|
2554 | "regime_bull".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"regime_bull".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2555:17
|
|
|
|
|
2555 | "regime_bear".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"regime_bear".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2556:17
|
|
|
|
|
2556 | "regime_sideways".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"regime_sideways".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2557:17
|
|
|
|
|
2557 | "regime_high_vol".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"regime_high_vol".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2558:17
|
|
|
|
|
2558 | "regime_low_vol".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"regime_low_vol".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2559:17
|
|
|
|
|
2559 | "regime_unknown".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"regime_unknown".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2607:39
|
|
|
|
|
2607 | features.push(0.0); // No confidence
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2578:37
|
|
|
|
|
2578 | let timestamp = training_data.timestamps[i];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2614:17
|
|
|
|
|
2614 | "regime_bull".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"regime_bull".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2615:17
|
|
|
|
|
2615 | "regime_bear".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"regime_bear".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2616:17
|
|
|
|
|
2616 | "regime_sideways".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"regime_sideways".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2617:17
|
|
|
|
|
2617 | "regime_high_vol".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"regime_high_vol".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2618:17
|
|
|
|
|
2618 | "regime_low_vol".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"regime_low_vol".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2619:17
|
|
|
|
|
2619 | "regime_unknown".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"regime_unknown".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2620:17
|
|
|
|
|
2620 | "regime_confidence".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"regime_confidence".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2668:27
|
|
|
|
|
2668 | enhanced.push(0.5); // Default confidence
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2695:19
|
|
|
|
|
2695 | name: "RegimeAware_Model".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"RegimeAware_Model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2696:25
|
|
|
|
|
2696 | model_type: "regime_aware_wrapper".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"regime_aware_wrapper".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2697:22
|
|
|
|
|
2697 | version: "1.0.0".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"1.0.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2702:31
|
|
|
|
|
2702 | description: Some("Regime-aware wrapper model".to_string()),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Regime-aware wrapper model".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: you should consider adding a `Default` implementation for `RegimeTransitionTracker`
|
|
--> adaptive-strategy/src/regime/mod.rs:2752:5
|
|
|
|
|
2752 | / pub fn new() -> Self {
|
|
2753 | | Self {
|
|
2754 | | regime_history: VecDeque::new(),
|
|
2755 | | transition_matrix: HashMap::new(),
|
|
... |
|
|
2759 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
2750 + impl Default for RegimeTransitionTracker {
|
|
2751 + fn default() -> Self {
|
|
2752 + Self::new()
|
|
2753 + }
|
|
2754 + }
|
|
|
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:2764:20
|
|
|
|
|
2764 | let key = (transition.from_regime.clone(), transition.to_regime.clone());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `transition.from_regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:2764:52
|
|
|
|
|
2764 | let key = (transition.from_regime.clone(), transition.to_regime.clone());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `transition.to_regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:2775:9
|
|
|
|
|
2775 | stats.count += 1;
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:2780:13
|
|
|
|
|
2780 | stats.average_duration * (stats.count - 1) as i32 + transition.duration_in_previous;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:2780:38
|
|
|
|
|
2780 | stats.average_duration * (stats.count - 1) as i32 + transition.duration_in_previous;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:2781:34
|
|
|
|
|
2781 | stats.average_duration = total_duration / stats.count as i32;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:2781:51
|
|
|
|
|
2781 | stats.average_duration = total_duration / stats.count as i32;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:2801:20
|
|
|
|
|
2801 | .get(&(from.clone(), to.clone()))
|
|
| ^^^^^^^^^^^^ help: try dereferencing it: `*from`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:2801:34
|
|
|
|
|
2801 | .get(&(from.clone(), to.clone()))
|
|
| ^^^^^^^^^^ help: try dereferencing it: `*to`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: you should consider adding a `Default` implementation for `RegimePerformanceTracker`
|
|
--> adaptive-strategy/src/regime/mod.rs:2809:5
|
|
|
|
|
2809 | / pub fn new() -> Self {
|
|
2810 | | Self {
|
|
2811 | | regime_performance: HashMap::new(),
|
|
2812 | | detection_accuracy: VecDeque::new(),
|
|
... |
|
|
2815 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
2807 + impl Default for RegimePerformanceTracker {
|
|
2808 + fn default() -> Self {
|
|
2809 + Self::new()
|
|
2810 + }
|
|
2811 + }
|
|
|
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:2821:24
|
|
|
|
|
2821 | predicted: detection.regime.clone(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `detection.regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2841:43
|
|
|
|
|
2841 | let transition_matrix = vec![vec![1.0 / num_states as f64; num_states]; num_states];
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2842:40
|
|
|
|
|
2842 | let emission_probs = vec![vec![1.0; 4]; num_states]; // 4 features
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2843:34
|
|
|
|
|
2843 | let initial_probs = vec![1.0 / num_states as f64; num_states];
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2841:43
|
|
|
|
|
2841 | let transition_matrix = vec![vec![1.0 / num_states as f64; num_states]; num_states];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:2841:49
|
|
|
|
|
2841 | let transition_matrix = vec![vec![1.0 / num_states as f64; num_states]; num_states];
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2843:34
|
|
|
|
|
2843 | let initial_probs = vec![1.0 / num_states as f64; num_states];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:2843:40
|
|
|
|
|
2843 | let initial_probs = vec![1.0 / num_states as f64; num_states];
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:2863:19
|
|
|
|
|
2863 | name: "HMM".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"HMM".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2900:63
|
|
|
|
|
2900 | if (log_likelihood - prev_log_likelihood).abs() < 1e-6 {
|
|
| ^^^^ help: consider adding suffix: `1e-6_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2900:16
|
|
|
|
|
2900 | if (log_likelihood - prev_log_likelihood).abs() < 1e-6 {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:2903:21
|
|
|
|
|
2903 | iteration + 1,
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/regime/mod.rs:2916:5
|
|
|
|
|
2916 | fn forward_algorithm(&self, observations: &[Vec<f64>]) -> Result<(Vec<Vec<f64>>, f64)> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
2916 - fn forward_algorithm(&self, observations: &[Vec<f64>]) -> Result<(Vec<Vec<f64>>, f64)> {
|
|
2916 + fn forward_algorithm(&self, observations: &[Vec<f64>]) -> (std::vec::Vec<std::vec::Vec<f64>>, f64) {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
2960 - Ok((alpha, log_likelihood))
|
|
2960 + (alpha, log_likelihood)
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2918:35
|
|
|
|
|
2918 | let mut alpha = vec![vec![0.0; self.num_states]; num_obs];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2919:40
|
|
|
|
|
2919 | let mut scaling_factors = vec![0.0; num_obs];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2928:33
|
|
|
|
|
2928 | if scaling_factors[0] > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2937:31
|
|
|
|
|
2937 | alpha[t][j] = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2946:37
|
|
|
|
|
2946 | if scaling_factors[t] > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2923:27
|
|
|
|
|
2923 | alpha[0][i] = self.initial_probs[i] * self.emission_probability(i, &observations[0]);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2923:27
|
|
|
|
|
2923 | alpha[0][i] = self.initial_probs[i] * self.emission_probability(i, &observations[0]);
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2923:81
|
|
|
|
|
2923 | alpha[0][i] = self.initial_probs[i] * self.emission_probability(i, &observations[0]);
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2923:13
|
|
|
|
|
2923 | alpha[0][i] = self.initial_probs[i] * self.emission_probability(i, &observations[0]);
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2923:13
|
|
|
|
|
2923 | alpha[0][i] = self.initial_probs[i] * self.emission_probability(i, &observations[0]);
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2924:13
|
|
|
|
|
2924 | scaling_factors[0] += alpha[0][i];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2924:35
|
|
|
|
|
2924 | scaling_factors[0] += alpha[0][i];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2924:35
|
|
|
|
|
2924 | scaling_factors[0] += alpha[0][i];
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2924:13
|
|
|
|
|
2924 | scaling_factors[0] += alpha[0][i];
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2928:12
|
|
|
|
|
2928 | if scaling_factors[0] > 0.0 {
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2930:17
|
|
|
|
|
2930 | alpha[0][i] /= scaling_factors[0];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2930:32
|
|
|
|
|
2930 | alpha[0][i] /= scaling_factors[0];
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2930:17
|
|
|
|
|
2930 | alpha[0][i] /= scaling_factors[0];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2930:17
|
|
|
|
|
2930 | alpha[0][i] /= scaling_factors[0];
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2937:17
|
|
|
|
|
2937 | alpha[t][j] = 0.0;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2937:17
|
|
|
|
|
2937 | alpha[t][j] = 0.0;
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2939:21
|
|
|
|
|
2939 | alpha[t][j] += alpha[t - 1][i] * self.transition_matrix[i][j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2939:36
|
|
|
|
|
2939 | alpha[t][j] += alpha[t - 1][i] * self.transition_matrix[i][j];
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2939:36
|
|
|
|
|
2939 | alpha[t][j] += alpha[t - 1][i] * self.transition_matrix[i][j];
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:2939:42
|
|
|
|
|
2939 | alpha[t][j] += alpha[t - 1][i] * self.transition_matrix[i][j];
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2939:54
|
|
|
|
|
2939 | alpha[t][j] += alpha[t - 1][i] * self.transition_matrix[i][j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2939:54
|
|
|
|
|
2939 | alpha[t][j] += alpha[t - 1][i] * self.transition_matrix[i][j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2939:21
|
|
|
|
|
2939 | alpha[t][j] += alpha[t - 1][i] * self.transition_matrix[i][j];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2939:21
|
|
|
|
|
2939 | alpha[t][j] += alpha[t - 1][i] * self.transition_matrix[i][j];
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2941:17
|
|
|
|
|
2941 | alpha[t][j] *= self.emission_probability(j, &observations[t]);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2941:62
|
|
|
|
|
2941 | alpha[t][j] *= self.emission_probability(j, &observations[t]);
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2941:17
|
|
|
|
|
2941 | alpha[t][j] *= self.emission_probability(j, &observations[t]);
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2941:17
|
|
|
|
|
2941 | alpha[t][j] *= self.emission_probability(j, &observations[t]);
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2942:17
|
|
|
|
|
2942 | scaling_factors[t] += alpha[t][j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2942:39
|
|
|
|
|
2942 | scaling_factors[t] += alpha[t][j];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2942:39
|
|
|
|
|
2942 | scaling_factors[t] += alpha[t][j];
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2942:17
|
|
|
|
|
2942 | scaling_factors[t] += alpha[t][j];
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2946:16
|
|
|
|
|
2946 | if scaling_factors[t] > 0.0 {
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2948:21
|
|
|
|
|
2948 | alpha[t][j] /= scaling_factors[t];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2948:36
|
|
|
|
|
2948 | alpha[t][j] /= scaling_factors[t];
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2948:21
|
|
|
|
|
2948 | alpha[t][j] /= scaling_factors[t];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2948:21
|
|
|
|
|
2948 | alpha[t][j] /= scaling_factors[t];
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2956:33
|
|
|
|
|
2956 | .filter(|&&sf| sf > 0.0)
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/regime/mod.rs:2964:5
|
|
|
|
|
2964 | fn backward_algorithm(&self, observations: &[Vec<f64>]) -> Result<Vec<Vec<f64>>> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
2964 - fn backward_algorithm(&self, observations: &[Vec<f64>]) -> Result<Vec<Vec<f64>>> {
|
|
2964 + fn backward_algorithm(&self, observations: &[Vec<f64>]) -> std::vec::Vec<std::vec::Vec<f64>> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
2985 - Ok(beta)
|
|
2985 + beta
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2966:34
|
|
|
|
|
2966 | let mut beta = vec![vec![0.0; self.num_states]; num_obs];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2970:36
|
|
|
|
|
2970 | beta[num_obs - 1][i] = 1.0;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2976:30
|
|
|
|
|
2976 | beta[t][i] = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2970:13
|
|
|
|
|
2970 | beta[num_obs - 1][i] = 1.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2970:13
|
|
|
|
|
2970 | beta[num_obs - 1][i] = 1.0;
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:2970:18
|
|
|
|
|
2970 | beta[num_obs - 1][i] = 1.0;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:2974:22
|
|
|
|
|
2974 | for t in (0..num_obs - 1).rev() {
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2976:17
|
|
|
|
|
2976 | beta[t][i] = 0.0;
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2976:17
|
|
|
|
|
2976 | beta[t][i] = 0.0;
|
|
| ^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:2978:21
|
|
|
|
|
2978 | / beta[t][i] += self.transition_matrix[i][j]
|
|
2979 | | * self.emission_probability(j, &observations[t + 1])
|
|
2980 | | * beta[t + 1][j];
|
|
| |________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2978:35
|
|
|
|
|
2978 | beta[t][i] += self.transition_matrix[i][j]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2978:35
|
|
|
|
|
2978 | beta[t][i] += self.transition_matrix[i][j]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2979:57
|
|
|
|
|
2979 | * self.emission_probability(j, &observations[t + 1])
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:2979:70
|
|
|
|
|
2979 | * self.emission_probability(j, &observations[t + 1])
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2980:27
|
|
|
|
|
2980 | * beta[t + 1][j];
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2980:27
|
|
|
|
|
2980 | * beta[t + 1][j];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:2980:32
|
|
|
|
|
2980 | * beta[t + 1][j];
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2978:21
|
|
|
|
|
2978 | beta[t][i] += self.transition_matrix[i][j]
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:2978:21
|
|
|
|
|
2978 | beta[t][i] += self.transition_matrix[i][j]
|
|
| ^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/regime/mod.rs:2989:5
|
|
|
|
|
2989 | / fn calculate_gamma(
|
|
2990 | | &self,
|
|
2991 | | alpha: &[Vec<f64>],
|
|
2992 | | beta: &[Vec<f64>],
|
|
2993 | | _log_likelihood: f64,
|
|
2994 | | ) -> Result<Vec<Vec<f64>>> {
|
|
| |______________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
2994 - ) -> Result<Vec<Vec<f64>>> {
|
|
2994 + ) -> std::vec::Vec<std::vec::Vec<f64>> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
3013 - Ok(gamma)
|
|
3013 + gamma
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2996:35
|
|
|
|
|
2996 | let mut gamma = vec![vec![0.0; self.num_states]; num_obs];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:2999:27
|
|
|
|
|
2999 | let mut sum = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3006:22
|
|
|
|
|
3006 | if sum > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3001:31
|
|
|
|
|
3001 | gamma[t][i] = alpha[t][i] * beta[t][i];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3001:31
|
|
|
|
|
3001 | gamma[t][i] = alpha[t][i] * beta[t][i];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3001:31
|
|
|
|
|
3001 | gamma[t][i] = alpha[t][i] * beta[t][i];
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3001:45
|
|
|
|
|
3001 | gamma[t][i] = alpha[t][i] * beta[t][i];
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3001:45
|
|
|
|
|
3001 | gamma[t][i] = alpha[t][i] * beta[t][i];
|
|
| ^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3001:17
|
|
|
|
|
3001 | gamma[t][i] = alpha[t][i] * beta[t][i];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3001:17
|
|
|
|
|
3001 | gamma[t][i] = alpha[t][i] * beta[t][i];
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3002:17
|
|
|
|
|
3002 | sum += gamma[t][i];
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3002:24
|
|
|
|
|
3002 | sum += gamma[t][i];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3002:24
|
|
|
|
|
3002 | sum += gamma[t][i];
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3008:21
|
|
|
|
|
3008 | gamma[t][i] /= sum;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3008:21
|
|
|
|
|
3008 | gamma[t][i] /= sum;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3008:21
|
|
|
|
|
3008 | gamma[t][i] /= sum;
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/regime/mod.rs:3017:5
|
|
|
|
|
3017 | / fn calculate_xi(
|
|
3018 | | &self,
|
|
3019 | | alpha: &[Vec<f64>],
|
|
3020 | | beta: &[Vec<f64>],
|
|
3021 | | observations: &[Vec<f64>],
|
|
3022 | | _log_likelihood: f64,
|
|
3023 | | ) -> Result<Vec<Vec<Vec<f64>>>> {
|
|
| |___________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
3023 - ) -> Result<Vec<Vec<Vec<f64>>>> {
|
|
3023 + ) -> std::vec::Vec<std::vec::Vec<std::vec::Vec<f64>>> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
3049 - Ok(xi)
|
|
3049 + xi
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3025:37
|
|
|
|
|
3025 | let mut xi = vec![vec![vec![0.0; self.num_states]; self.num_states]; num_obs - 1];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3028:27
|
|
|
|
|
3028 | let mut sum = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3040:22
|
|
|
|
|
3040 | if sum > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3025:78
|
|
|
|
|
3025 | let mut xi = vec![vec![vec![0.0; self.num_states]; self.num_states]; num_obs - 1];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3027:21
|
|
|
|
|
3027 | for t in 0..num_obs - 1 {
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3031:35
|
|
|
|
|
3031 | xi[t][i][j] = alpha[t][i]
|
|
| ___________________________________^
|
|
3032 | | * self.transition_matrix[i][j]
|
|
3033 | | * self.emission_probability(j, &observations[t + 1])
|
|
3034 | | * beta[t + 1][j];
|
|
| |________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3031:35
|
|
|
|
|
3031 | xi[t][i][j] = alpha[t][i]
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3031:35
|
|
|
|
|
3031 | xi[t][i][j] = alpha[t][i]
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3032:27
|
|
|
|
|
3032 | * self.transition_matrix[i][j]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3032:27
|
|
|
|
|
3032 | * self.transition_matrix[i][j]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3033:57
|
|
|
|
|
3033 | * self.emission_probability(j, &observations[t + 1])
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3033:70
|
|
|
|
|
3033 | * self.emission_probability(j, &observations[t + 1])
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3034:27
|
|
|
|
|
3034 | * beta[t + 1][j];
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3034:27
|
|
|
|
|
3034 | * beta[t + 1][j];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3034:32
|
|
|
|
|
3034 | * beta[t + 1][j];
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3031:21
|
|
|
|
|
3031 | xi[t][i][j] = alpha[t][i]
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3031:21
|
|
|
|
|
3031 | xi[t][i][j] = alpha[t][i]
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3031:21
|
|
|
|
|
3031 | xi[t][i][j] = alpha[t][i]
|
|
| ^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3035:21
|
|
|
|
|
3035 | sum += xi[t][i][j];
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3035:28
|
|
|
|
|
3035 | sum += xi[t][i][j];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3035:28
|
|
|
|
|
3035 | sum += xi[t][i][j];
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3035:28
|
|
|
|
|
3035 | sum += xi[t][i][j];
|
|
| ^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3043:25
|
|
|
|
|
3043 | xi[t][i][j] /= sum;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3043:25
|
|
|
|
|
3043 | xi[t][i][j] /= sum;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3043:25
|
|
|
|
|
3043 | xi[t][i][j] /= sum;
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3043:25
|
|
|
|
|
3043 | xi[t][i][j] /= sum;
|
|
| ^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> adaptive-strategy/src/regime/mod.rs:3053:5
|
|
|
|
|
3053 | / fn update_parameters(
|
|
3054 | | &mut self,
|
|
3055 | | gamma: &[Vec<f64>],
|
|
3056 | | xi: &[Vec<Vec<f64>>],
|
|
3057 | | observations: &[Vec<f64>],
|
|
3058 | | ) -> Result<()> {
|
|
| |___________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
3058 - ) -> Result<()> {
|
|
3058 + ) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
3106 - Ok(())
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3068:33
|
|
|
|
|
3068 | let mut sum_gamma = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3073:28
|
|
|
|
|
3073 | if sum_gamma > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3075:38
|
|
|
|
|
3075 | let mut sum_xi = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3086:41
|
|
|
|
|
3086 | let mut weighted_sum = vec![0.0; observations[0].len()];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3087:34
|
|
|
|
|
3087 | let mut weight_sum = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3096:29
|
|
|
|
|
3096 | if weight_sum > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3063:37
|
|
|
|
|
3063 | self.initial_probs[i] = gamma[0][i];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3063:37
|
|
|
|
|
3063 | self.initial_probs[i] = gamma[0][i];
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3063:13
|
|
|
|
|
3063 | self.initial_probs[i] = gamma[0][i];
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: the loop variable `t` is only used to index `gamma`
|
|
--> adaptive-strategy/src/regime/mod.rs:3069:22
|
|
|
|
|
3069 | for t in 0..num_obs - 1 {
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
|
|
= note: `-W clippy::needless-range-loop` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::needless_range_loop)]`
|
|
help: consider using an iterator
|
|
|
|
|
3069 - for t in 0..num_obs - 1 {
|
|
3069 + for <item> in gamma.iter().take(num_obs - 1) {
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3069:25
|
|
|
|
|
3069 | for t in 0..num_obs - 1 {
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3070:17
|
|
|
|
|
3070 | sum_gamma += gamma[t][i];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3070:30
|
|
|
|
|
3070 | sum_gamma += gamma[t][i];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3070:30
|
|
|
|
|
3070 | sum_gamma += gamma[t][i];
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: the loop variable `t` is only used to index `xi`
|
|
--> adaptive-strategy/src/regime/mod.rs:3076:30
|
|
|
|
|
3076 | for t in 0..num_obs - 1 {
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
|
|
help: consider using an iterator
|
|
|
|
|
3076 - for t in 0..num_obs - 1 {
|
|
3076 + for <item> in xi.iter().take(num_obs - 1) {
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3076:33
|
|
|
|
|
3076 | for t in 0..num_obs - 1 {
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3077:25
|
|
|
|
|
3077 | sum_xi += xi[t][i][j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3077:35
|
|
|
|
|
3077 | sum_xi += xi[t][i][j];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3077:35
|
|
|
|
|
3077 | sum_xi += xi[t][i][j];
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3077:35
|
|
|
|
|
3077 | sum_xi += xi[t][i][j];
|
|
| ^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3079:52
|
|
|
|
|
3079 | self.transition_matrix[i][j] = sum_xi / sum_gamma;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3079:21
|
|
|
|
|
3079 | self.transition_matrix[i][j] = sum_xi / sum_gamma;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3079:21
|
|
|
|
|
3079 | self.transition_matrix[i][j] = sum_xi / sum_gamma;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3086:46
|
|
|
|
|
3086 | let mut weighted_sum = vec![0.0; observations[0].len()];
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3090:36
|
|
|
|
|
3090 | for (k, &obs_k) in observations[t].iter().enumerate() {
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3091:21
|
|
|
|
|
3091 | weighted_sum[k] += gamma[t][j] * obs_k;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3091:40
|
|
|
|
|
3091 | weighted_sum[k] += gamma[t][j] * obs_k;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3091:40
|
|
|
|
|
3091 | weighted_sum[k] += gamma[t][j] * obs_k;
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3091:21
|
|
|
|
|
3091 | weighted_sum[k] += gamma[t][j] * obs_k;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3093:17
|
|
|
|
|
3093 | weight_sum += gamma[t][j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3093:31
|
|
|
|
|
3093 | weight_sum += gamma[t][j];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3093:31
|
|
|
|
|
3093 | weight_sum += gamma[t][j];
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: the loop variable `k` is used to index `weighted_sum`
|
|
--> adaptive-strategy/src/regime/mod.rs:3097:26
|
|
|
|
|
3097 | for k in 0..observations[0].len() {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
|
|
help: consider using an iterator and enumerate()
|
|
|
|
|
3097 - for k in 0..observations[0].len() {
|
|
3097 + for (k, <item>) in weighted_sum.iter().enumerate().take(observations[0].len()) {
|
|
|
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3097:29
|
|
|
|
|
3097 | for k in 0..observations[0].len() {
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3099:61
|
|
|
|
|
3099 | if j < self.emission_probs.len() && k < self.emission_probs[j].len() {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3100:53
|
|
|
|
|
3100 | self.emission_probs[j][k] = weighted_sum[k] / weight_sum;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3100:53
|
|
|
|
|
3100 | self.emission_probs[j][k] = weighted_sum[k] / weight_sum;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3100:25
|
|
|
|
|
3100 | self.emission_probs[j][k] = weighted_sum[k] / weight_sum;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3100:25
|
|
|
|
|
3100 | self.emission_probs[j][k] = weighted_sum[k] / weight_sum;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3116:24
|
|
|
|
|
3116 | let mut prob = 1.0;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3118:20
|
|
|
|
|
3118 | if i < self.emission_probs[state].len() {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3119:28
|
|
|
|
|
3119 | let mean = self.emission_probs[state][i];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3119:28
|
|
|
|
|
3119 | let mean = self.emission_probs[state][i];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3120:28
|
|
|
|
|
3120 | let diff = obs - mean;
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3121:17
|
|
|
|
|
3121 | prob *= (-0.5 * diff * diff).exp() / (2.0 * std::f64::consts::PI).sqrt();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3135:35
|
|
|
|
|
3135 | let mut delta = vec![vec![0.0; self.num_states]; num_obs];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3141:17
|
|
|
|
|
3141 | self.initial_probs[i].ln() + self.emission_probability(i, &observations[0]).ln();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3141:17
|
|
|
|
|
3141 | self.initial_probs[i].ln() + self.emission_probability(i, &observations[0]).ln();
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3141:76
|
|
|
|
|
3141 | self.initial_probs[i].ln() + self.emission_probability(i, &observations[0]).ln();
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3140:13
|
|
|
|
|
3140 | delta[0][i] =
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3140:13
|
|
|
|
|
3140 | delta[0][i] =
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3151:31
|
|
|
|
|
3151 | let val = delta[t - 1][i] + self.transition_matrix[i][j].ln();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3151:31
|
|
|
|
|
3151 | let val = delta[t - 1][i] + self.transition_matrix[i][j].ln();
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3151:31
|
|
|
|
|
3151 | let val = delta[t - 1][i] + self.transition_matrix[i][j].ln();
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3151:37
|
|
|
|
|
3151 | let val = delta[t - 1][i] + self.transition_matrix[i][j].ln();
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3151:49
|
|
|
|
|
3151 | let val = delta[t - 1][i] + self.transition_matrix[i][j].ln();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3151:49
|
|
|
|
|
3151 | let val = delta[t - 1][i] + self.transition_matrix[i][j].ln();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3158:31
|
|
|
|
|
3158 | delta[t][j] = max_val + self.emission_probability(j, &observations[t]).ln();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3158:71
|
|
|
|
|
3158 | delta[t][j] = max_val + self.emission_probability(j, &observations[t]).ln();
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3158:17
|
|
|
|
|
3158 | delta[t][j] = max_val + self.emission_probability(j, &observations[t]).ln();
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3158:17
|
|
|
|
|
3158 | delta[t][j] = max_val + self.emission_probability(j, &observations[t]).ln();
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3159:17
|
|
|
|
|
3159 | psi[t][j] = max_state;
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3159:17
|
|
|
|
|
3159 | psi[t][j] = max_state;
|
|
| ^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3169:16
|
|
|
|
|
3169 | if delta[num_obs - 1][i] > max_val {
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3169:16
|
|
|
|
|
3169 | if delta[num_obs - 1][i] > max_val {
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3169:22
|
|
|
|
|
3169 | if delta[num_obs - 1][i] > max_val {
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3170:27
|
|
|
|
|
3170 | max_val = delta[num_obs - 1][i];
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3170:27
|
|
|
|
|
3170 | max_val = delta[num_obs - 1][i];
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3170:33
|
|
|
|
|
3170 | max_val = delta[num_obs - 1][i];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3171:17
|
|
|
|
|
3171 | path[num_obs - 1] = i;
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3171:22
|
|
|
|
|
3171 | path[num_obs - 1] = i;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3176:22
|
|
|
|
|
3176 | for t in (0..num_obs - 1).rev() {
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3177:23
|
|
|
|
|
3177 | path[t] = psi[t + 1][path[t + 1]];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3177:23
|
|
|
|
|
3177 | path[t] = psi[t + 1][path[t + 1]];
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3177:27
|
|
|
|
|
3177 | path[t] = psi[t + 1][path[t + 1]];
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3177:34
|
|
|
|
|
3177 | path[t] = psi[t + 1][path[t + 1]];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3177:39
|
|
|
|
|
3177 | path[t] = psi[t + 1][path[t + 1]];
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3177:13
|
|
|
|
|
3177 | path[t] = psi[t + 1][path[t + 1]];
|
|
| ^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3191:40
|
|
|
|
|
3191 | let mut new_state_probs = vec![0.0; self.num_states];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3209:20
|
|
|
|
|
3209 | if total > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: the loop variable `i` is used to index `new_state_probs`
|
|
--> adaptive-strategy/src/regime/mod.rs:3193:18
|
|
|
|
|
3193 | for i in 0..self.num_states {
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
|
|
help: consider using an iterator and enumerate()
|
|
|
|
|
3193 - for i in 0..self.num_states {
|
|
3193 + for (i, <item>) in new_state_probs.iter_mut().enumerate().take(self.num_states) {
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3198:35
|
|
|
|
|
3198 | .map(|(j, &prob)| prob * self.transition_matrix[j][i])
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3198:42
|
|
|
|
|
3198 | .map(|(j, &prob)| prob * self.transition_matrix[j][i])
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3198:42
|
|
|
|
|
3198 | .map(|(j, &prob)| prob * self.transition_matrix[j][i])
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3204:34
|
|
|
|
|
3204 | new_state_probs[i] = transition_prob * emission_prob;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3204:13
|
|
|
|
|
3204 | new_state_probs[i] = transition_prob * emission_prob;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3211:17
|
|
|
|
|
3211 | *prob /= total;
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3232:27
|
|
|
|
|
3232 | self.confidence = self.state_probs[most_likely_state];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:3236:41
|
|
|
|
|
3236 | regime_probabilities.insert(regime_type.clone(), self.state_probs[*state]);
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*regime_type`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3236:62
|
|
|
|
|
3236 | regime_probabilities.insert(regime_type.clone(), self.state_probs[*state]);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3245:17
|
|
|
|
|
3245 | "volatility".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"volatility".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3246:17
|
|
|
|
|
3246 | "returns".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"returns".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3247:17
|
|
|
|
|
3247 | "volume".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `"volume".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3248:17
|
|
|
|
|
3248 | "trend".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"trend".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3252:32
|
|
|
|
|
3252 | model_version: "2.0.0".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"2.0.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3272:39
|
|
|
|
|
3272 | let mut correct_predictions = 0;
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3273:37
|
|
|
|
|
3273 | let mut total_predictions = 0;
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3295:48
|
|
|
|
|
3295 | correct_predictions += 1;
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3297:42
|
|
|
|
|
3297 | total_predictions += 1;
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3302:47
|
|
|
|
|
3302 | let accuracy = if total_predictions > 0 {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3305:13
|
|
|
|
|
3305 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3324:37
|
|
|
|
|
3324 | let prec = if tp + fp > 0.0 { tp / (tp + fp) } else { 0.0 };
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3324:67
|
|
|
|
|
3324 | let prec = if tp + fp > 0.0 { tp / (tp + fp) } else { 0.0 };
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3325:40
|
|
|
|
|
3325 | let rec = if tp + fn_val > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3328:17
|
|
|
|
|
3328 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3330:38
|
|
|
|
|
3330 | let f1 = if prec + rec > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3331:17
|
|
|
|
|
3331 | 2.0 * prec * rec / (prec + rec)
|
|
| ^^^ help: consider adding suffix: `2.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3333:17
|
|
|
|
|
3333 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3281:38
|
|
|
|
|
3281 | let actual_regime = &training_data.regimes[i];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3292:21
|
|
|
|
|
3292 | confusion_matrix[actual_state][predicted_state] += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3292:21
|
|
|
|
|
3292 | confusion_matrix[actual_state][predicted_state] += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3292:21
|
|
|
|
|
3292 | confusion_matrix[actual_state][predicted_state] += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3295:25
|
|
|
|
|
3295 | correct_predictions += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3297:21
|
|
|
|
|
3297 | total_predictions += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3303:13
|
|
|
|
|
3303 | correct_predictions as f64 / total_predictions as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:3303:13
|
|
|
|
|
3303 | correct_predictions as f64 / total_predictions as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:3303:42
|
|
|
|
|
3303 | correct_predictions as f64 / total_predictions as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:3314:22
|
|
|
|
|
3314 | let tp = confusion_matrix[*state][*state] as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3314:22
|
|
|
|
|
3314 | let tp = confusion_matrix[*state][*state] as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3314:22
|
|
|
|
|
3314 | let tp = confusion_matrix[*state][*state] as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3315:27
|
|
|
|
|
3315 | let fp: f64 = (0..self.num_states)
|
|
| ___________________________^
|
|
3316 | | .map(|i| confusion_matrix[i][*state] as f64)
|
|
3317 | | .sum::<f64>()
|
|
3318 | | - tp;
|
|
| |____________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:3316:26
|
|
|
|
|
3316 | .map(|i| confusion_matrix[i][*state] as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3316:26
|
|
|
|
|
3316 | .map(|i| confusion_matrix[i][*state] as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3316:26
|
|
|
|
|
3316 | .map(|i| confusion_matrix[i][*state] as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3319:31
|
|
|
|
|
3319 | let fn_val: f64 = (0..self.num_states)
|
|
| _______________________________^
|
|
3320 | | .map(|j| confusion_matrix[*state][j] as f64)
|
|
3321 | | .sum::<f64>()
|
|
3322 | | - tp;
|
|
| |____________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:3320:26
|
|
|
|
|
3320 | .map(|j| confusion_matrix[*state][j] as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3320:26
|
|
|
|
|
3320 | .map(|j| confusion_matrix[*state][j] as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3320:26
|
|
|
|
|
3320 | .map(|j| confusion_matrix[*state][j] as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3324:27
|
|
|
|
|
3324 | let prec = if tp + fp > 0.0 { tp / (tp + fp) } else { 0.0 };
|
|
| ^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3324:43
|
|
|
|
|
3324 | let prec = if tp + fp > 0.0 { tp / (tp + fp) } else { 0.0 };
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3325:26
|
|
|
|
|
3325 | let rec = if tp + fn_val > 0.0 {
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3326:17
|
|
|
|
|
3326 | tp / (tp + fn_val)
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3330:25
|
|
|
|
|
3330 | let f1 = if prec + rec > 0.0 {
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3331:17
|
|
|
|
|
3331 | 2.0 * prec * rec / (prec + rec)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:3336:30
|
|
|
|
|
3336 | precision.insert(regime.clone(), prec);
|
|
| ^^^^^^^^^^^^^^ help: try dereferencing it: `*regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:3337:27
|
|
|
|
|
3337 | recall.insert(regime.clone(), rec);
|
|
| ^^^^^^^^^^^^^^ help: try dereferencing it: `*regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:3338:29
|
|
|
|
|
3338 | f1_score.insert(regime.clone(), f1);
|
|
| ^^^^^^^^^^^^^^ help: try dereferencing it: `*regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:3364:34
|
|
|
|
|
3364 | probabilities.insert(regime.clone(), self.state_probs[*state]);
|
|
| ^^^^^^^^^^^^^^ help: try dereferencing it: `*regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3364:50
|
|
|
|
|
3364 | probabilities.insert(regime.clone(), self.state_probs[*state]);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3385:37
|
|
|
|
|
3385 | let mut cov = vec![vec![0.0; feature_dim]; feature_dim];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3387:29
|
|
|
|
|
3387 | cov[j][j] = 1.0;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3381:61
|
|
|
|
|
3381 | let mean = (0..feature_dim).map(|_| (i as f64 + 1.0) * 0.1).collect();
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3381:68
|
|
|
|
|
3381 | let mean = (0..feature_dim).map(|_| (i as f64 + 1.0) * 0.1).collect();
|
|
| ^^^ help: consider adding suffix: `0.1_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3381:49
|
|
|
|
|
3381 | let mean = (0..feature_dim).map(|_| (i as f64 + 1.0) * 0.1).collect();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:3381:50
|
|
|
|
|
3381 | let mean = (0..feature_dim).map(|_| (i as f64 + 1.0) * 0.1).collect();
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: the loop variable `j` is used to index `cov`
|
|
--> adaptive-strategy/src/regime/mod.rs:3386:22
|
|
|
|
|
3386 | for j in 0..feature_dim {
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
|
|
help: consider using an iterator and enumerate()
|
|
|
|
|
3386 - for j in 0..feature_dim {
|
|
3386 + for (j, <item>) in cov.iter_mut().enumerate().take(feature_dim) {
|
|
|
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3387:17
|
|
|
|
|
3387 | cov[j][j] = 1.0;
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3387:17
|
|
|
|
|
3387 | cov[j][j] = 1.0;
|
|
| ^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3409:19
|
|
|
|
|
3409 | name: "GMM".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"GMM".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3411:27
|
|
|
|
|
3411 | weights: vec![1.0 / num_components as f64; num_components],
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:3411:33
|
|
|
|
|
3411 | weights: vec![1.0 / num_components as f64; num_components],
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3435:46
|
|
|
|
|
3435 | let mut responsibilities = vec![vec![0.0; self.num_components]; num_samples];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3431:28
|
|
|
|
|
3431 | let _feature_dim = data[0].len();
|
|
| ^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3445:16
|
|
|
|
|
3445 | if (log_likelihood - prev_log_likelihood).abs() < tolerance {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3448:21
|
|
|
|
|
3448 | iteration + 1,
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3462:34
|
|
|
|
|
3462 | let mut log_likelihood = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3465:34
|
|
|
|
|
3465 | let mut total_prob = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3475:29
|
|
|
|
|
3475 | if total_prob > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3483:46
|
|
|
|
|
3483 | responsibilities[n][k] = 1.0 / self.num_components as f64;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3470:42
|
|
|
|
|
3470 | responsibilities[n][k] = self.weights[k] * prob;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3470:42
|
|
|
|
|
3470 | responsibilities[n][k] = self.weights[k] * prob;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3470:17
|
|
|
|
|
3470 | responsibilities[n][k] = self.weights[k] * prob;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3470:17
|
|
|
|
|
3470 | responsibilities[n][k] = self.weights[k] * prob;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3471:17
|
|
|
|
|
3471 | total_prob += responsibilities[n][k];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3471:31
|
|
|
|
|
3471 | total_prob += responsibilities[n][k];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3471:31
|
|
|
|
|
3471 | total_prob += responsibilities[n][k];
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3476:17
|
|
|
|
|
3476 | log_likelihood += total_prob.ln();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3478:21
|
|
|
|
|
3478 | responsibilities[n][k] /= total_prob;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3478:21
|
|
|
|
|
3478 | responsibilities[n][k] /= total_prob;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3478:21
|
|
|
|
|
3478 | responsibilities[n][k] /= total_prob;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3483:46
|
|
|
|
|
3483 | responsibilities[n][k] = 1.0 / self.num_components as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:3483:52
|
|
|
|
|
3483 | responsibilities[n][k] = 1.0 / self.num_components as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3483:21
|
|
|
|
|
3483 | responsibilities[n][k] = 1.0 / self.num_components as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3483:21
|
|
|
|
|
3483 | responsibilities[n][k] = 1.0 / self.num_components as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> adaptive-strategy/src/regime/mod.rs:3492:5
|
|
|
|
|
3492 | fn m_step(&mut self, data: &[Vec<f64>], responsibilities: &[Vec<f64>]) -> Result<()> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
3492 - fn m_step(&mut self, data: &[Vec<f64>], responsibilities: &[Vec<f64>]) -> Result<()> {
|
|
3492 + fn m_step(&mut self, data: &[Vec<f64>], responsibilities: &[Vec<f64>]) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
3543 - Ok(())
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3500:22
|
|
|
|
|
3500 | if n_k > 1e-10 {
|
|
| ^^^^^ help: consider adding suffix: `1e-10_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3506:41
|
|
|
|
|
3506 | let mut new_mean = vec![0.0; feature_dim];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3518:45
|
|
|
|
|
3518 | let mut new_cov = vec![vec![0.0; feature_dim]; feature_dim];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3534:46
|
|
|
|
|
3534 | ... new_cov[i][j] += 1e-6;
|
|
| ^^^^ help: consider adding suffix: `1e-6_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3494:27
|
|
|
|
|
3494 | let feature_dim = data[0].len();
|
|
| ^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3498:60
|
|
|
|
|
3498 | let n_k: f64 = responsibilities.iter().map(|r| r[k]).sum();
|
|
| ^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3503:35
|
|
|
|
|
3503 | self.weights[k] = n_k / num_samples as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:3503:41
|
|
|
|
|
3503 | self.weights[k] = n_k / num_samples as f64;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3503:17
|
|
|
|
|
3503 | self.weights[k] = n_k / num_samples as f64;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3509:25
|
|
|
|
|
3509 | new_mean[j] += responsibilities[n][k] * sample[j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3509:40
|
|
|
|
|
3509 | new_mean[j] += responsibilities[n][k] * sample[j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3509:40
|
|
|
|
|
3509 | new_mean[j] += responsibilities[n][k] * sample[j];
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3509:65
|
|
|
|
|
3509 | new_mean[j] += responsibilities[n][k] * sample[j];
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3509:25
|
|
|
|
|
3509 | new_mean[j] += responsibilities[n][k] * sample[j];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: the loop variable `j` is only used to index `new_mean`
|
|
--> adaptive-strategy/src/regime/mod.rs:3512:26
|
|
|
|
|
3512 | for j in 0..feature_dim {
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
|
|
help: consider using an iterator
|
|
|
|
|
3512 - for j in 0..feature_dim {
|
|
3512 + for <item> in new_mean.iter_mut().take(feature_dim) {
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3513:21
|
|
|
|
|
3513 | new_mean[j] /= n_k;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3513:21
|
|
|
|
|
3513 | new_mean[j] /= n_k;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3515:17
|
|
|
|
|
3515 | self.means[k] = new_mean;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3522:42
|
|
|
|
|
3522 | ... let diff_i = sample[i] - self.means[k][i];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3522:42
|
|
|
|
|
3522 | ... let diff_i = sample[i] - self.means[k][i];
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3522:54
|
|
|
|
|
3522 | ... let diff_i = sample[i] - self.means[k][i];
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3522:54
|
|
|
|
|
3522 | ... let diff_i = sample[i] - self.means[k][i];
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3523:42
|
|
|
|
|
3523 | ... let diff_j = sample[j] - self.means[k][j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3523:42
|
|
|
|
|
3523 | ... let diff_j = sample[j] - self.means[k][j];
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3523:54
|
|
|
|
|
3523 | ... let diff_j = sample[j] - self.means[k][j];
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3523:54
|
|
|
|
|
3523 | ... let diff_j = sample[j] - self.means[k][j];
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3524:29
|
|
|
|
|
3524 | ... new_cov[i][j] += responsibilities[n][k] * diff_i * diff_j;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3524:46
|
|
|
|
|
3524 | ... new_cov[i][j] += responsibilities[n][k] * diff_i * diff_j;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3524:46
|
|
|
|
|
3524 | ... new_cov[i][j] += responsibilities[n][k] * diff_i * diff_j;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3524:29
|
|
|
|
|
3524 | ... new_cov[i][j] += responsibilities[n][k] * diff_i * diff_j;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3524:29
|
|
|
|
|
3524 | ... new_cov[i][j] += responsibilities[n][k] * diff_i * diff_j;
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: the loop variable `i` is used to index `new_cov`
|
|
--> adaptive-strategy/src/regime/mod.rs:3529:26
|
|
|
|
|
3529 | for i in 0..feature_dim {
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
|
|
help: consider using an iterator and enumerate()
|
|
|
|
|
3529 - for i in 0..feature_dim {
|
|
3529 + for (i, <item>) in new_cov.iter_mut().enumerate().take(feature_dim) {
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3531:25
|
|
|
|
|
3531 | new_cov[i][j] /= n_k;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3531:25
|
|
|
|
|
3531 | new_cov[i][j] /= n_k;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3531:25
|
|
|
|
|
3531 | new_cov[i][j] /= n_k;
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3534:29
|
|
|
|
|
3534 | ... new_cov[i][j] += 1e-6;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3534:29
|
|
|
|
|
3534 | ... new_cov[i][j] += 1e-6;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3534:29
|
|
|
|
|
3534 | ... new_cov[i][j] += 1e-6;
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3539:17
|
|
|
|
|
3539 | self.covariances[k] = new_cov;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3566:19
|
|
|
|
|
3566 | if det <= 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3571:29
|
|
|
|
|
3571 | let mut quad_form = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3580:13
|
|
|
|
|
3580 | 1.0 / ((2.0 * std::f64::consts::PI).powf(feature_dim as f64 / 2.0) * det.sqrt());
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3548:64
|
|
|
|
|
3548 | if component >= self.num_components || sample.len() != self.means[component].len() {
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3553:21
|
|
|
|
|
3553 | let mean = &self.means[component];
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3554:20
|
|
|
|
|
3554 | let cov = &self.covariances[component];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3560:28
|
|
|
|
|
3560 | .map(|(x, mu)| x - mu)
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3574:17
|
|
|
|
|
3574 | quad_form += diff[i] * inv_cov[i][j] * diff[j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3574:30
|
|
|
|
|
3574 | quad_form += diff[i] * inv_cov[i][j] * diff[j];
|
|
| ^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3574:40
|
|
|
|
|
3574 | quad_form += diff[i] * inv_cov[i][j] * diff[j];
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3574:40
|
|
|
|
|
3574 | quad_form += diff[i] * inv_cov[i][j] * diff[j];
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3574:56
|
|
|
|
|
3574 | quad_form += diff[i] * inv_cov[i][j] * diff[j];
|
|
| ^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3580:13
|
|
|
|
|
3580 | 1.0 / ((2.0 * std::f64::consts::PI).powf(feature_dim as f64 / 2.0) * det.sqrt());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:3580:54
|
|
|
|
|
3580 | 1.0 / ((2.0 * std::f64::consts::PI).powf(feature_dim as f64 / 2.0) * det.sqrt());
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3581:19
|
|
|
|
|
3581 | let pdf = normalization * (-0.5 * quad_form).exp();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/regime/mod.rs:3587:5
|
|
|
|
|
3587 | fn matrix_det_inv(&self, matrix: &[Vec<f64>]) -> Result<(f64, Vec<Vec<f64>>)> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
3587 - fn matrix_det_inv(&self, matrix: &[Vec<f64>]) -> Result<(f64, Vec<Vec<f64>>)> {
|
|
3587 + fn matrix_det_inv(&self, matrix: &[Vec<f64>]) -> (f64, std::vec::Vec<std::vec::Vec<f64>>) {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
3590 ~ return (1.0, vec![vec![1.0; n]; n]);
|
|
3591 | }
|
|
...
|
|
3600 | };
|
|
3601 ~ (det, inv)
|
|
3602 | },
|
|
...
|
|
3612 | };
|
|
3613 ~ (det, inv)
|
|
3614 | },
|
|
...
|
|
3621 | }
|
|
3622 ~ (det, inv)
|
|
|
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3589:22
|
|
|
|
|
3589 | if n == 0 || matrix[0].len() != n {
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3595:27
|
|
|
|
|
3595 | let det = matrix[0][0];
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3595:27
|
|
|
|
|
3595 | let det = matrix[0][0];
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3597:31
|
|
|
|
|
3597 | vec![vec![1.0 / det]]
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3604:27
|
|
|
|
|
3604 | let det = matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3604:27
|
|
|
|
|
3604 | let det = matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3604:27
|
|
|
|
|
3604 | let det = matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3604:42
|
|
|
|
|
3604 | let det = matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3604:42
|
|
|
|
|
3604 | let det = matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3604:57
|
|
|
|
|
3604 | let det = matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3604:57
|
|
|
|
|
3604 | let det = matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3604:72
|
|
|
|
|
3604 | let det = matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3604:72
|
|
|
|
|
3604 | let det = matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3607:30
|
|
|
|
|
3607 | vec![matrix[1][1] / det, -matrix[0][1] / det],
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3607:30
|
|
|
|
|
3607 | vec![matrix[1][1] / det, -matrix[0][1] / det],
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3607:30
|
|
|
|
|
3607 | vec![matrix[1][1] / det, -matrix[0][1] / det],
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3607:50
|
|
|
|
|
3607 | vec![matrix[1][1] / det, -matrix[0][1] / det],
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3607:51
|
|
|
|
|
3607 | vec![matrix[1][1] / det, -matrix[0][1] / det],
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3607:51
|
|
|
|
|
3607 | vec![matrix[1][1] / det, -matrix[0][1] / det],
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3608:30
|
|
|
|
|
3608 | vec![-matrix[1][0] / det, matrix[0][0] / det],
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3608:31
|
|
|
|
|
3608 | vec![-matrix[1][0] / det, matrix[0][0] / det],
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3608:31
|
|
|
|
|
3608 | vec![-matrix[1][0] / det, matrix[0][0] / det],
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3608:51
|
|
|
|
|
3608 | vec![-matrix[1][0] / det, matrix[0][0] / det],
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3608:51
|
|
|
|
|
3608 | vec![-matrix[1][0] / det, matrix[0][0] / det],
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3608:51
|
|
|
|
|
3608 | vec![-matrix[1][0] / det, matrix[0][0] / det],
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: the loop variable `i` is used to index `inv`
|
|
--> adaptive-strategy/src/regime/mod.rs:3619:26
|
|
|
|
|
3619 | for i in 0..n {
|
|
| ^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
|
|
help: consider using an iterator and enumerate()
|
|
|
|
|
3619 - for i in 0..n {
|
|
3619 + for (i, <item>) in inv.iter_mut().enumerate().take(n) {
|
|
|
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3620:21
|
|
|
|
|
3620 | inv[i][i] = 1.0;
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3620:21
|
|
|
|
|
3620 | inv[i][i] = 1.0;
|
|
| ^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3629:30
|
|
|
|
|
3629 | let mut probs = vec![0.0; self.num_components];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3630:25
|
|
|
|
|
3630 | let mut total = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3638:20
|
|
|
|
|
3638 | if total > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3644:25
|
|
|
|
|
3644 | *prob = 1.0 / self.num_components as f64;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: the loop variable `k` is used to index `probs`
|
|
--> adaptive-strategy/src/regime/mod.rs:3632:18
|
|
|
|
|
3632 | for k in 0..self.num_components {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
|
|
help: consider using an iterator and enumerate()
|
|
|
|
|
3632 - for k in 0..self.num_components {
|
|
3632 + for (k, <item>) in probs.iter_mut().enumerate().take(self.num_components) {
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3633:24
|
|
|
|
|
3633 | probs[k] = self.weights[k] * self.gaussian_pdf(sample, k)?;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3633:24
|
|
|
|
|
3633 | probs[k] = self.weights[k] * self.gaussian_pdf(sample, k)?;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3633:13
|
|
|
|
|
3633 | probs[k] = self.weights[k] * self.gaussian_pdf(sample, k)?;
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3634:13
|
|
|
|
|
3634 | total += probs[k];
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3634:22
|
|
|
|
|
3634 | total += probs[k];
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3640:17
|
|
|
|
|
3640 | *prob /= total;
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3644:25
|
|
|
|
|
3644 | *prob = 1.0 / self.num_components as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:3644:31
|
|
|
|
|
3644 | *prob = 1.0 / self.num_components as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3694:28
|
|
|
|
|
3694 | let mut max_prob = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3700:80
|
|
|
|
|
3700 | let current_prob = regime_probabilities.get(regime).unwrap_or(&0.0);
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3681:36
|
|
|
|
|
3681 | model_version: "2.0.0".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"2.0.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3701:32
|
|
|
|
|
3701 | let new_prob = current_prob + prob;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:3702:45
|
|
|
|
|
3702 | regime_probabilities.insert(regime.clone(), new_prob);
|
|
| ^^^^^^^^^^^^^^ help: try dereferencing it: `*regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:3706:42
|
|
|
|
|
3706 | most_likely_regime = regime.clone();
|
|
| ^^^^^^^^^^^^^^ help: try dereferencing it: `*regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3719:17
|
|
|
|
|
3719 | "volatility".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"volatility".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3720:17
|
|
|
|
|
3720 | "returns".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"returns".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3721:17
|
|
|
|
|
3721 | "volume".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `"volume".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3722:17
|
|
|
|
|
3722 | "trend".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"trend".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3726:32
|
|
|
|
|
3726 | model_version: "2.0.0".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"2.0.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `regime` is shadowed
|
|
--> adaptive-strategy/src/regime/mod.rs:3737:21
|
|
|
|
|
3737 | if let Some(regime) = regime {
|
|
| ^^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> adaptive-strategy/src/regime/mod.rs:3734:44
|
|
|
|
|
3734 | fn update(&mut self, features: &[f64], regime: Option<MarketRegime>) -> Result<()> {
|
|
| ^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_reuse
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3750:39
|
|
|
|
|
3750 | let mut correct_predictions = 0;
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3751:37
|
|
|
|
|
3751 | let mut total_predictions = 0;
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3773:48
|
|
|
|
|
3773 | correct_predictions += 1;
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3775:42
|
|
|
|
|
3775 | total_predictions += 1;
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3780:47
|
|
|
|
|
3780 | let accuracy = if total_predictions > 0 {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3783:13
|
|
|
|
|
3783 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3802:37
|
|
|
|
|
3802 | let prec = if tp + fp > 0.0 { tp / (tp + fp) } else { 0.0 };
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3802:67
|
|
|
|
|
3802 | let prec = if tp + fp > 0.0 { tp / (tp + fp) } else { 0.0 };
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3803:40
|
|
|
|
|
3803 | let rec = if tp + fn_val > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3806:17
|
|
|
|
|
3806 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3808:38
|
|
|
|
|
3808 | let f1 = if prec + rec > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3809:17
|
|
|
|
|
3809 | 2.0 * prec * rec / (prec + rec)
|
|
| ^^^ help: consider adding suffix: `2.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:3811:17
|
|
|
|
|
3811 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3757:38
|
|
|
|
|
3757 | let actual_regime = &training_data.regimes[i];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3770:21
|
|
|
|
|
3770 | confusion_matrix[actual_component][predicted_component] += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3770:21
|
|
|
|
|
3770 | confusion_matrix[actual_component][predicted_component] += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3770:21
|
|
|
|
|
3770 | confusion_matrix[actual_component][predicted_component] += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3773:25
|
|
|
|
|
3773 | correct_predictions += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:3775:21
|
|
|
|
|
3775 | total_predictions += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3781:13
|
|
|
|
|
3781 | correct_predictions as f64 / total_predictions as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:3781:13
|
|
|
|
|
3781 | correct_predictions as f64 / total_predictions as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:3781:42
|
|
|
|
|
3781 | correct_predictions as f64 / total_predictions as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:3792:22
|
|
|
|
|
3792 | let tp = confusion_matrix[*component][*component] as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3792:22
|
|
|
|
|
3792 | let tp = confusion_matrix[*component][*component] as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3792:22
|
|
|
|
|
3792 | let tp = confusion_matrix[*component][*component] as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3793:27
|
|
|
|
|
3793 | let fp: f64 = (0..self.num_components)
|
|
| ___________________________^
|
|
3794 | | .map(|i| confusion_matrix[i][*component] as f64)
|
|
3795 | | .sum::<f64>()
|
|
3796 | | - tp;
|
|
| |____________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:3794:26
|
|
|
|
|
3794 | .map(|i| confusion_matrix[i][*component] as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3794:26
|
|
|
|
|
3794 | .map(|i| confusion_matrix[i][*component] as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3794:26
|
|
|
|
|
3794 | .map(|i| confusion_matrix[i][*component] as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3797:31
|
|
|
|
|
3797 | let fn_val: f64 = (0..self.num_components)
|
|
| _______________________________^
|
|
3798 | | .map(|j| confusion_matrix[*component][j] as f64)
|
|
3799 | | .sum::<f64>()
|
|
3800 | | - tp;
|
|
| |____________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:3798:26
|
|
|
|
|
3798 | .map(|j| confusion_matrix[*component][j] as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3798:26
|
|
|
|
|
3798 | .map(|j| confusion_matrix[*component][j] as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:3798:26
|
|
|
|
|
3798 | .map(|j| confusion_matrix[*component][j] as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3802:27
|
|
|
|
|
3802 | let prec = if tp + fp > 0.0 { tp / (tp + fp) } else { 0.0 };
|
|
| ^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3802:43
|
|
|
|
|
3802 | let prec = if tp + fp > 0.0 { tp / (tp + fp) } else { 0.0 };
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3803:26
|
|
|
|
|
3803 | let rec = if tp + fn_val > 0.0 {
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3804:17
|
|
|
|
|
3804 | tp / (tp + fn_val)
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3808:25
|
|
|
|
|
3808 | let f1 = if prec + rec > 0.0 {
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3809:17
|
|
|
|
|
3809 | 2.0 * prec * rec / (prec + rec)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:3814:30
|
|
|
|
|
3814 | precision.insert(regime.clone(), prec);
|
|
| ^^^^^^^^^^^^^^ help: try dereferencing it: `*regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:3815:27
|
|
|
|
|
3815 | recall.insert(regime.clone(), rec);
|
|
| ^^^^^^^^^^^^^^ help: try dereferencing it: `*regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:3816:29
|
|
|
|
|
3816 | f1_score.insert(regime.clone(), f1);
|
|
| ^^^^^^^^^^^^^^ help: try dereferencing it: `*regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3853:31
|
|
|
|
|
3853 | regime_mapping.insert("0".to_string(), MarketRegime::Bull);
|
|
| ^^^^^^^^^^^^^^^ help: try: `"0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3854:31
|
|
|
|
|
3854 | regime_mapping.insert("1".to_string(), MarketRegime::Bear);
|
|
| ^^^^^^^^^^^^^^^ help: try: `"1".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3855:31
|
|
|
|
|
3855 | regime_mapping.insert("2".to_string(), MarketRegime::Sideways);
|
|
| ^^^^^^^^^^^^^^^ help: try: `"2".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3856:31
|
|
|
|
|
3856 | regime_mapping.insert("3".to_string(), MarketRegime::HighVolatility);
|
|
| ^^^^^^^^^^^^^^^ help: try: `"3".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3857:31
|
|
|
|
|
3857 | regime_mapping.insert("4".to_string(), MarketRegime::LowVolatility);
|
|
| ^^^^^^^^^^^^^^^ help: try: `"4".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/regime/mod.rs:3889:5
|
|
|
|
|
3889 | / fn regime_to_label(&self, regime: &MarketRegime) -> f64 {
|
|
3890 | | match regime {
|
|
3891 | | MarketRegime::Bull => 0.0,
|
|
3892 | | MarketRegime::Bear => 1.0,
|
|
... |
|
|
3904 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
3889 | const fn regime_to_label(&self, regime: &MarketRegime) -> f64 {
|
|
| +++++
|
|
|
|
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
|
|
--> adaptive-strategy/src/regime/mod.rs:3889:39
|
|
|
|
|
3889 | fn regime_to_label(&self, regime: &MarketRegime) -> f64 {
|
|
| ^^^^^^^^^^^^^ help: consider passing by value instead: `MarketRegime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:3908:23
|
|
|
|
|
3908 | let rounded = label.round() as i32;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:3935:41
|
|
|
|
|
3935 | regime_probabilities.insert(regime.clone(), prediction.confidence);
|
|
| ^^^^^^^^^^^^^^ help: try removing the `clone` call: `regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:3938:30
|
|
|
|
|
3938 | let other_prob = (1.0 - prediction.confidence) / 4.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:3949:49
|
|
|
|
|
3949 | regime_probabilities.insert(r.clone(), other_prob);
|
|
| ^^^^^^^^^ help: try dereferencing it: `*r`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3961:36
|
|
|
|
|
3961 | model_version: "2.0.0".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"2.0.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3975:37
|
|
|
|
|
3975 | features_used: vec!["fallback".to_string()],
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `"fallback".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:3978:36
|
|
|
|
|
3978 | model_version: "2.0.0".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"2.0.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `regime` is shadowed
|
|
--> adaptive-strategy/src/regime/mod.rs:3989:21
|
|
|
|
|
3989 | if let Some(regime) = regime {
|
|
| ^^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> adaptive-strategy/src/regime/mod.rs:3987:44
|
|
|
|
|
3987 | fn update(&mut self, features: &[f64], regime: Option<MarketRegime>) -> Result<()> {
|
|
| ^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_reuse
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:4027:39
|
|
|
|
|
4027 | let mut correct_predictions = 0;
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:4028:37
|
|
|
|
|
4028 | let mut total_predictions = 0;
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:4045:52
|
|
|
|
|
4045 | ... correct_predictions += 1;
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:4047:46
|
|
|
|
|
4047 | total_predictions += 1;
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:4053:47
|
|
|
|
|
4053 | let accuracy = if total_predictions > 0 {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:4085:37
|
|
|
|
|
4085 | let prec = if tp + fp > 0.0 { tp / (tp + fp) } else { 0.0 };
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:4085:67
|
|
|
|
|
4085 | let prec = if tp + fp > 0.0 { tp / (tp + fp) } else { 0.0 };
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:4086:40
|
|
|
|
|
4086 | let rec = if tp + fn_val > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:4089:17
|
|
|
|
|
4089 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:4091:38
|
|
|
|
|
4091 | let f1 = if prec + rec > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:4092:17
|
|
|
|
|
4092 | 2.0 * prec * rec / (prec + rec)
|
|
| ^^^ help: consider adding suffix: `2.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:4094:17
|
|
|
|
|
4094 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:4036:42
|
|
|
|
|
4036 | let actual_regime = &training_data.regimes[i];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:4038:41
|
|
|
|
|
4038 | let predicted_idx = self.regime_to_label(&predicted_regime) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:4039:38
|
|
|
|
|
4039 | let actual_idx = self.regime_to_label(actual_regime) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:4042:25
|
|
|
|
|
4042 | confusion_matrix[actual_idx][predicted_idx] += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:4042:25
|
|
|
|
|
4042 | confusion_matrix[actual_idx][predicted_idx] += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:4042:25
|
|
|
|
|
4042 | confusion_matrix[actual_idx][predicted_idx] += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:4045:29
|
|
|
|
|
4045 | ... correct_predictions += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/regime/mod.rs:4047:25
|
|
|
|
|
4047 | total_predictions += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:4054:13
|
|
|
|
|
4054 | correct_predictions as f64 / total_predictions as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:4054:13
|
|
|
|
|
4054 | correct_predictions as f64 / total_predictions as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:4054:42
|
|
|
|
|
4054 | correct_predictions as f64 / total_predictions as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:4075:22
|
|
|
|
|
4075 | let tp = confusion_matrix[regime_idx][regime_idx] as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:4075:22
|
|
|
|
|
4075 | let tp = confusion_matrix[regime_idx][regime_idx] as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:4075:22
|
|
|
|
|
4075 | let tp = confusion_matrix[regime_idx][regime_idx] as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:4076:27
|
|
|
|
|
4076 | let fp: f64 = (0..6)
|
|
| ___________________________^
|
|
4077 | | .map(|i| confusion_matrix[i][regime_idx] as f64)
|
|
4078 | | .sum::<f64>()
|
|
4079 | | - tp;
|
|
| |____________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:4077:26
|
|
|
|
|
4077 | .map(|i| confusion_matrix[i][regime_idx] as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:4077:26
|
|
|
|
|
4077 | .map(|i| confusion_matrix[i][regime_idx] as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:4077:26
|
|
|
|
|
4077 | .map(|i| confusion_matrix[i][regime_idx] as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:4080:31
|
|
|
|
|
4080 | let fn_val: f64 = (0..6)
|
|
| _______________________________^
|
|
4081 | | .map(|j| confusion_matrix[regime_idx][j] as f64)
|
|
4082 | | .sum::<f64>()
|
|
4083 | | - tp;
|
|
| |____________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/regime/mod.rs:4081:26
|
|
|
|
|
4081 | .map(|j| confusion_matrix[regime_idx][j] as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:4081:26
|
|
|
|
|
4081 | .map(|j| confusion_matrix[regime_idx][j] as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:4081:26
|
|
|
|
|
4081 | .map(|j| confusion_matrix[regime_idx][j] as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:4085:27
|
|
|
|
|
4085 | let prec = if tp + fp > 0.0 { tp / (tp + fp) } else { 0.0 };
|
|
| ^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:4085:43
|
|
|
|
|
4085 | let prec = if tp + fp > 0.0 { tp / (tp + fp) } else { 0.0 };
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:4086:26
|
|
|
|
|
4086 | let rec = if tp + fn_val > 0.0 {
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:4087:17
|
|
|
|
|
4087 | tp / (tp + fn_val)
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:4091:25
|
|
|
|
|
4091 | let f1 = if prec + rec > 0.0 {
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/regime/mod.rs:4092:17
|
|
|
|
|
4092 | 2.0 * prec * rec / (prec + rec)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:4097:30
|
|
|
|
|
4097 | precision.insert(regime.clone(), prec);
|
|
| ^^^^^^^^^^^^^^ help: try dereferencing it: `*regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:4098:27
|
|
|
|
|
4098 | recall.insert(regime.clone(), rec);
|
|
| ^^^^^^^^^^^^^^ help: try dereferencing it: `*regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/regime/mod.rs:4099:29
|
|
|
|
|
4099 | f1_score.insert(regime.clone(), f1);
|
|
| ^^^^^^^^^^^^^^ help: try dereferencing it: `*regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:4136:13
|
|
|
|
|
4136 | "high_vol".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `"high_vol".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:4138:26
|
|
|
|
|
4138 | feature: "volatility".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"volatility".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:4147:13
|
|
|
|
|
4147 | "low_vol".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"low_vol".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:4149:26
|
|
|
|
|
4149 | feature: "volatility".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"volatility".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:4158:19
|
|
|
|
|
4158 | name: "Threshold".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Threshold".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:4174:29
|
|
|
|
|
4174 | if volatility > 0.05 {
|
|
| ^^^^ help: consider adding suffix: `0.05_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:4176:36
|
|
|
|
|
4176 | } else if volatility < 0.01 {
|
|
| ^^^^ help: consider adding suffix: `0.01_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:4178:59
|
|
|
|
|
4178 | } else if features.len() > 2 && features[2] > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/regime/mod.rs:4180:60
|
|
|
|
|
4180 | } else if features.len() > 2 && features[2] < -0.01 {
|
|
| ^^^^ help: consider adding suffix: `0.01_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:4172:30
|
|
|
|
|
4172 | let volatility = features[0];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:4178:45
|
|
|
|
|
4178 | } else if features.len() > 2 && features[2] > 0.0 {
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/regime/mod.rs:4180:45
|
|
|
|
|
4180 | } else if features.len() > 2 && features[2] < -0.01 {
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:4194:33
|
|
|
|
|
4194 | features_used: vec!["volatility".to_string(), "returns".to_string()],
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"volatility".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:4194:59
|
|
|
|
|
4194 | features_used: vec!["volatility".to_string(), "returns".to_string()],
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"returns".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/regime/mod.rs:4197:32
|
|
|
|
|
4197 | model_version: "1.0.0".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"1.0.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/risk/mod.rs:7:31
|
|
|
|
|
7 | //! - Portfolio risk metrics (VaR, CVaR, maximum drawdown)
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
7 - //! - Portfolio risk metrics (VaR, CVaR, maximum drawdown)
|
|
7 + //! - Portfolio risk metrics (`VaR`, CVaR, maximum drawdown)
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/risk/mod.rs:7:36
|
|
|
|
|
7 | //! - Portfolio risk metrics (VaR, CVaR, maximum drawdown)
|
|
| ^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
7 - //! - Portfolio risk metrics (VaR, CVaR, maximum drawdown)
|
|
7 + //! - Portfolio risk metrics (VaR, `CVaR`, maximum drawdown)
|
|
|
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:29:5
|
|
|
|
|
29 | / pub fn new(config: KellyOptimizerConfig) -> Result<Self> {
|
|
30 | | Ok(Self { config })
|
|
31 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
29 | pub const fn new(config: KellyOptimizerConfig) -> Result<Self> {
|
|
| +++++
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:591:24
|
|
|
|
|
591 | .unwrap_or(0.20); // Default 20% volatility
|
|
| ^^^^ help: consider adding suffix: `0.20_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:593:44
|
|
|
|
|
593 | let sharpe_ratio = if volatility > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:596:13
|
|
|
|
|
596 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:600:36
|
|
|
|
|
600 | let concentration_impact = 1.0 - concentration_adjustment;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:601:34
|
|
|
|
|
601 | let correlation_impact = 1.0 - correlation_adjustment;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:602:49
|
|
|
|
|
602 | let regime_impact = regime_adjustment - 1.0;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:545:33
|
|
|
|
|
545 | .recommend_position(symbol.to_string(), historical_returns.to_vec())
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `symbol.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:577:32
|
|
|
|
|
577 | let total_adjustment = regime_adjustment
|
|
| ________________________________^
|
|
578 | | * concentration_adjustment
|
|
579 | | * volatility_adjustment
|
|
580 | | * correlation_adjustment
|
|
581 | | * drawdown_adjustment;
|
|
| |_________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:583:36
|
|
|
|
|
583 | let recommended_fraction = (base_kelly * total_adjustment)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:594:13
|
|
|
|
|
594 | expected_return / volatility
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:600:36
|
|
|
|
|
600 | let concentration_impact = 1.0 - concentration_adjustment;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:601:34
|
|
|
|
|
601 | let correlation_impact = 1.0 - correlation_adjustment;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:602:29
|
|
|
|
|
602 | let regime_impact = regime_adjustment - 1.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:606:21
|
|
|
|
|
606 | symbol: symbol.to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `symbol.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:644:5
|
|
|
|
|
644 | / fn calculate_base_kelly(
|
|
645 | | &self,
|
|
646 | | _symbol: &str,
|
|
647 | | expected_return: f64,
|
|
648 | | historical_returns: &[f64],
|
|
649 | | ) -> Result<f64> {
|
|
| |____________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
649 - ) -> Result<f64> {
|
|
649 + ) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
651 ~ return 0.0;
|
|
652 | }
|
|
...
|
|
676 |
|
|
677 ~ combined_kelly.clamp(0.0, self.config.max_fraction)
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:656:43
|
|
|
|
|
656 | let classic_kelly = if variance > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:659:13
|
|
|
|
|
659 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:664:45
|
|
|
|
|
664 | let empirical_kelly = if avg_loss > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:666:33
|
|
|
|
|
666 | (win_rate * odds - (1.0 - win_rate)) / odds
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:668:13
|
|
|
|
|
668 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:672:48
|
|
|
|
|
672 | let fractional_kelly = classic_kelly * 0.5; // Half Kelly for safety
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:675:30
|
|
|
|
|
675 | let combined_kelly = 0.4 * classic_kelly + 0.4 * empirical_kelly + 0.2 * fractional_kelly;
|
|
| ^^^ help: consider adding suffix: `0.4_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:675:52
|
|
|
|
|
675 | let combined_kelly = 0.4 * classic_kelly + 0.4 * empirical_kelly + 0.2 * fractional_kelly;
|
|
| ^^^ help: consider adding suffix: `0.4_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:675:76
|
|
|
|
|
675 | let combined_kelly = 0.4 * classic_kelly + 0.4 * empirical_kelly + 0.2 * fractional_kelly;
|
|
| ^^^ help: consider adding suffix: `0.2_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:657:13
|
|
|
|
|
657 | expected_return / variance
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:665:24
|
|
|
|
|
665 | let odds = avg_win / avg_loss;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:666:13
|
|
|
|
|
666 | (win_rate * odds - (1.0 - win_rate)) / odds
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:672:32
|
|
|
|
|
672 | let fractional_kelly = classic_kelly * 0.5; // Half Kelly for safety
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:675:30
|
|
|
|
|
675 | let combined_kelly = 0.4 * classic_kelly + 0.4 * empirical_kelly + 0.2 * fractional_kelly;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:687:20
|
|
|
|
|
687 | let mean = returns.iter().sum::<f64>() / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:687:50
|
|
|
|
|
687 | let mean = returns.iter().sum::<f64>() / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:689:13
|
|
|
|
|
689 | returns.iter().map(|r| (r - mean).powi(2)).sum::<f64>() / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:689:71
|
|
|
|
|
689 | returns.iter().map(|r| (r - mean).powi(2)).sum::<f64>() / returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:703:13
|
|
|
|
|
703 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:709:13
|
|
|
|
|
709 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:715:13
|
|
|
|
|
715 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:697:62
|
|
|
|
|
697 | let wins: Vec<f64> = returns.iter().filter(|&&r| r > 0.0).copied().collect();
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:698:64
|
|
|
|
|
698 | let losses: Vec<f64> = returns.iter().filter(|&&r| r < 0.0).map(|r| -r).collect();
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:701:13
|
|
|
|
|
701 | wins.len() as f64 / returns.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:701:13
|
|
|
|
|
701 | wins.len() as f64 / returns.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:701:33
|
|
|
|
|
701 | wins.len() as f64 / returns.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:707:13
|
|
|
|
|
707 | wins.iter().sum::<f64>() / wins.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:707:40
|
|
|
|
|
707 | wins.iter().sum::<f64>() / wins.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:713:13
|
|
|
|
|
713 | losses.iter().sum::<f64>() / losses.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:713:42
|
|
|
|
|
713 | losses.iter().sum::<f64>() / losses.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:722:5
|
|
|
|
|
722 | fn calculate_win_probability(&self, returns: &[f64]) -> Result<f64> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
722 - fn calculate_win_probability(&self, returns: &[f64]) -> Result<f64> {
|
|
722 + fn calculate_win_probability(&self, returns: &[f64]) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
724 ~ return 0.5; // Default 50% if no data
|
|
725 | }
|
|
726 |
|
|
727 | let wins = returns.iter().filter(|&&r| r > 0.0).count();
|
|
728 ~ wins as f64 / returns.len() as f64
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:727:52
|
|
|
|
|
727 | let wins = returns.iter().filter(|&&r| r > 0.0).count();
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:728:12
|
|
|
|
|
728 | Ok(wins as f64 / returns.len() as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:728:12
|
|
|
|
|
728 | Ok(wins as f64 / returns.len() as f64)
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:728:26
|
|
|
|
|
728 | Ok(wins as f64 / returns.len() as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:805:51
|
|
|
|
|
805 | regime_scalers.insert(MarketRegime::Bull, 1.2);
|
|
| ^^^ help: consider adding suffix: `1.2_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:806:61
|
|
|
|
|
806 | regime_scalers.insert(MarketRegime::HighVolatility, 0.9);
|
|
| ^^^ help: consider adding suffix: `0.9_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:807:51
|
|
|
|
|
807 | regime_scalers.insert(MarketRegime::Bear, 0.7);
|
|
| ^^^ help: consider adding suffix: `0.7_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:808:60
|
|
|
|
|
808 | regime_scalers.insert(MarketRegime::LowVolatility, 0.8);
|
|
| ^^^ help: consider adding suffix: `0.8_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:809:55
|
|
|
|
|
809 | regime_scalers.insert(MarketRegime::Sideways, 0.8);
|
|
| ^^^ help: consider adding suffix: `0.8_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:810:53
|
|
|
|
|
810 | regime_scalers.insert(MarketRegime::Crisis, 0.3);
|
|
| ^^^ help: consider adding suffix: `0.3_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:811:54
|
|
|
|
|
811 | regime_scalers.insert(MarketRegime::Unknown, 0.6);
|
|
| ^^^ help: consider adding suffix: `0.6_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:838:24
|
|
|
|
|
838 | .unwrap_or(0.6))
|
|
| ^^^ help: consider adding suffix: `0.6_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:897:24
|
|
|
|
|
897 | .unwrap_or(0.6);
|
|
| ^^^ help: consider adding suffix: `0.6_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:898:12
|
|
|
|
|
898 | Ok(base_size * regime_adjustment)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:903:5
|
|
|
|
|
903 | pub(super) fn new(_config: &KellyConfig) -> Result<Self> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
903 - pub(super) fn new(_config: &KellyConfig) -> Result<Self> {
|
|
903 + pub(super) fn new(_config: &KellyConfig) -> risk::kelly_position_sizer::ConcentrationMonitor {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
904 ~ Self {
|
|
905 + concentrations: HashMap::new(),
|
|
906 + sector_concentrations: HashMap::new(),
|
|
907 + geographic_concentrations: HashMap::new(),
|
|
908 + asset_class_concentrations: HashMap::new(),
|
|
909 + correlation_matrix: CorrelationMatrix::new(),
|
|
910 + }
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:918:88
|
|
|
|
|
918 | let current_concentration = self.concentrations.get(symbol).copied().unwrap_or(0.0);
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:921:32
|
|
|
|
|
921 | if new_concentration > 0.20 {
|
|
| ^^^^ help: consider adding suffix: `0.20_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:923:16
|
|
|
|
|
923 | Ok(0.20 / new_concentration) // Scale down proportionally
|
|
| ^^^^ help: consider adding suffix: `0.20_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:925:16
|
|
|
|
|
925 | Ok(1.0) // No adjustment needed
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:919:33
|
|
|
|
|
919 | let new_concentration = current_concentration + proposed_fraction;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:923:16
|
|
|
|
|
923 | Ok(0.20 / new_concentration) // Scale down proportionally
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:935:12
|
|
|
|
|
935 | Ok(0.9) // 10% reduction for correlation
|
|
| ^^^ help: consider adding suffix: `0.9_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:946:69
|
|
|
|
|
946 | let max_concentration = concentrations.iter().copied().fold(0.0, f64::max);
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:953:49
|
|
|
|
|
953 | effective_positions: if hhi > 0.0 { 1.0 / hhi } else { 0.0 },
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:994:24
|
|
|
|
|
994 | .unwrap_or(0.20); // Default 20% volatility
|
|
| ^^^^ help: consider adding suffix: `0.20_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:997:37
|
|
|
|
|
997 | let volatility_adjustment = self.target_volatility / volatility;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:1015:5
|
|
|
|
|
1015 | pub(super) fn new() -> Result<Self> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1015 - pub(super) fn new() -> Result<Self> {
|
|
1015 + pub(super) fn new() -> risk::kelly_position_sizer::VolatilityModel {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1016 ~ Self {
|
|
1017 + parameters: HashMap::new(),
|
|
1018 + model_type: VolatilityModelType::Ewma,
|
|
1019 + calibration_history: Vec::new(),
|
|
1020 + }
|
|
|
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:1037:5
|
|
|
|
|
1037 | / pub fn new(_config: &KellyConfig) -> Self {
|
|
1038 | | Self {
|
|
1039 | | high_water_mark: 100000.0, // Initial portfolio value
|
|
1040 | | current_drawdown: 0.0,
|
|
... |
|
|
1045 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
1037 | pub const fn new(_config: &KellyConfig) -> Self {
|
|
| +++++
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/kelly_position_sizer.rs:1049:5
|
|
|
|
|
1049 | pub(super) fn new() -> Result<Self> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1049 - pub(super) fn new() -> Result<Self> {
|
|
1049 + pub(super) fn new() -> risk::kelly_position_sizer::PerformanceTracker {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1050 ~ Self {
|
|
1051 + returns_history: Vec::new(),
|
|
1052 + kelly_performance: KellyPerformanceMetrics::default(),
|
|
1053 + accuracy_tracker: AccuracyTracker::new(),
|
|
1054 + }
|
|
|
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:149:5
|
|
|
|
|
149 | / pub(super) fn new(config: ContinuousPPOConfig) -> Result<Self, MLError> {
|
|
150 | | Ok(Self { config })
|
|
151 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
149 | pub(super) const fn new(config: ContinuousPPOConfig) -> Result<Self, MLError> {
|
|
| +++++
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:149:5
|
|
|
|
|
149 | pub(super) fn new(config: ContinuousPPOConfig) -> Result<Self, MLError> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
149 - pub(super) fn new(config: ContinuousPPOConfig) -> Result<Self, MLError> {
|
|
149 + pub(super) fn new(config: ContinuousPPOConfig) -> risk::ppo_position_sizer::ContinuousPPO {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
150 - Ok(Self { config })
|
|
150 + Self { config }
|
|
|
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:153:5
|
|
|
|
|
153 | / pub(super) fn act_with_log_prob(
|
|
154 | | &self,
|
|
155 | | _state: &[f32],
|
|
156 | | ) -> Result<(ContinuousAction, f32, f32), MLError> {
|
|
157 | | Ok((ContinuousAction { value: 0.5 }, 0.0, 0.0))
|
|
158 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
153 | pub(super) const fn act_with_log_prob(
|
|
| +++++
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:153:5
|
|
|
|
|
153 | / pub(super) fn act_with_log_prob(
|
|
154 | | &self,
|
|
155 | | _state: &[f32],
|
|
156 | | ) -> Result<(ContinuousAction, f32, f32), MLError> {
|
|
| |______________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
156 - ) -> Result<(ContinuousAction, f32, f32), MLError> {
|
|
156 + ) -> (risk::ppo_position_sizer::ContinuousAction, f32, f32) {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
157 - Ok((ContinuousAction { value: 0.5 }, 0.0, 0.0))
|
|
157 + (ContinuousAction { value: 0.5 }, 0.0, 0.0)
|
|
|
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:160:5
|
|
|
|
|
160 | / pub(super) fn get_exploration_param(&self, _state: &[f32]) -> Result<f32, MLError> {
|
|
161 | | Ok(-1.0) // log std
|
|
162 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
160 | pub(super) const fn get_exploration_param(&self, _state: &[f32]) -> Result<f32, MLError> {
|
|
| +++++
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:160:5
|
|
|
|
|
160 | pub(super) fn get_exploration_param(&self, _state: &[f32]) -> Result<f32, MLError> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
160 - pub(super) fn get_exploration_param(&self, _state: &[f32]) -> Result<f32, MLError> {
|
|
160 + pub(super) fn get_exploration_param(&self, _state: &[f32]) -> f32 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
161 - Ok(-1.0) // log std
|
|
161 + -1.0 // log std
|
|
|
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:164:5
|
|
|
|
|
164 | pub(super) fn set_exploration_param(&mut self, _log_std: f32) -> Result<(), MLError> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
164 - pub(super) fn set_exploration_param(&mut self, _log_std: f32) -> Result<(), MLError> {
|
|
164 + pub(super) fn set_exploration_param(&mut self, _log_std: f32) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
165 - Ok(())
|
|
|
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:168:5
|
|
|
|
|
168 | / pub(super) fn update(
|
|
169 | | &mut self,
|
|
170 | | _batch: &mut ContinuousTrajectoryBatch,
|
|
171 | | ) -> Result<(f32, f32), MLError> {
|
|
| |____________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
171 - ) -> Result<(f32, f32), MLError> {
|
|
171 + ) -> (f32, f32) {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
172 - Ok((0.1, 0.05)) // policy_loss, value_loss
|
|
172 + (0.1, 0.05) // policy_loss, value_loss
|
|
|
|
|
|
|
warning: you should consider adding a `Default` implementation for `ContinuousTrajectory`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:198:5
|
|
|
|
|
198 | / pub fn new() -> Self {
|
|
199 | | Self {
|
|
200 | | states: Vec::new(),
|
|
201 | | actions: Vec::new(),
|
|
... |
|
|
207 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
196 + impl Default for ContinuousTrajectory {
|
|
197 + fn default() -> Self {
|
|
198 + Self::new()
|
|
199 + }
|
|
200 + }
|
|
|
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:198:5
|
|
|
|
|
198 | / pub fn new() -> Self {
|
|
199 | | Self {
|
|
200 | | states: Vec::new(),
|
|
201 | | actions: Vec::new(),
|
|
... |
|
|
207 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
198 | pub const fn new() -> Self {
|
|
| +++++
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:240:24
|
|
|
|
|
240 | state: self.states[i].clone(),
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:242:28
|
|
|
|
|
242 | value: self.actions[i],
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:244:25
|
|
|
|
|
244 | reward: self.rewards[i],
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:245:24
|
|
|
|
|
245 | value: self.values[i],
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:246:27
|
|
|
|
|
246 | log_prob: self.log_probs[i],
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:247:23
|
|
|
|
|
247 | done: self.dones[i],
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:254:1
|
|
|
|
|
254 | / pub(super) fn from_trajectories(
|
|
255 | | trajectories: Vec<ContinuousTrajectory>,
|
|
256 | | ) -> ContinuousTrajectoryBatch {
|
|
257 | | ContinuousTrajectoryBatch { trajectories }
|
|
258 | | }
|
|
| |_^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
254 | pub(super) const fn from_trajectories(
|
|
| +++++
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:303:5
|
|
|
|
|
303 | / pub fn new(
|
|
304 | | state: Vec<f64>,
|
|
305 | | action: ContinuousAction,
|
|
306 | | reward: f64,
|
|
... |
|
|
319 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
303 | pub const fn new(
|
|
| +++++
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:397:20
|
|
|
|
|
397 | /// Weight for VaR constraint penalty
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
397 - /// Weight for VaR constraint penalty
|
|
397 + /// Weight for `VaR` constraint penalty
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:428:9
|
|
|
|
|
428 | /// VaR limit as fraction of portfolio
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
428 - /// VaR limit as fraction of portfolio
|
|
428 + /// `VaR` limit as fraction of portfolio
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:513:58
|
|
|
|
|
513 | regime_learning_rates.insert("Bull".to_string(), 1.0);
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:514:58
|
|
|
|
|
514 | regime_learning_rates.insert("Bear".to_string(), 0.8);
|
|
| ^^^ help: consider adding suffix: `0.8_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:515:62
|
|
|
|
|
515 | regime_learning_rates.insert("Sideways".to_string(), 1.2);
|
|
| ^^^ help: consider adding suffix: `1.2_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:518:61
|
|
|
|
|
518 | regime_exploration_rates.insert("Bull".to_string(), 0.1);
|
|
| ^^^ help: consider adding suffix: `0.1_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:519:61
|
|
|
|
|
519 | regime_exploration_rates.insert("Bear".to_string(), 0.2);
|
|
| ^^^ help: consider adding suffix: `0.2_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:520:65
|
|
|
|
|
520 | regime_exploration_rates.insert("Sideways".to_string(), 0.15);
|
|
| ^^^^ help: consider adding suffix: `0.15_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:523:56
|
|
|
|
|
523 | regime_risk_scaling.insert("Bull".to_string(), 1.0);
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:524:56
|
|
|
|
|
524 | regime_risk_scaling.insert("Bear".to_string(), 0.5);
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:525:60
|
|
|
|
|
525 | regime_risk_scaling.insert("Sideways".to_string(), 0.8);
|
|
| ^^^ help: consider adding suffix: `0.8_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:513:38
|
|
|
|
|
513 | regime_learning_rates.insert("Bull".to_string(), 1.0);
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"Bull".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:514:38
|
|
|
|
|
514 | regime_learning_rates.insert("Bear".to_string(), 0.8);
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"Bear".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:515:38
|
|
|
|
|
515 | regime_learning_rates.insert("Sideways".to_string(), 1.2);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Sideways".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:518:41
|
|
|
|
|
518 | regime_exploration_rates.insert("Bull".to_string(), 0.1);
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"Bull".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:519:41
|
|
|
|
|
519 | regime_exploration_rates.insert("Bear".to_string(), 0.2);
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"Bear".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:520:41
|
|
|
|
|
520 | regime_exploration_rates.insert("Sideways".to_string(), 0.15);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Sideways".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:523:36
|
|
|
|
|
523 | regime_risk_scaling.insert("Bull".to_string(), 1.0);
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"Bull".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:524:36
|
|
|
|
|
524 | regime_risk_scaling.insert("Bear".to_string(), 0.5);
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"Bear".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:525:36
|
|
|
|
|
525 | regime_risk_scaling.insert("Sideways".to_string(), 0.8);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Sideways".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:722:9
|
|
|
|
|
722 | /// VaR penalty
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
722 - /// VaR penalty
|
|
722 + /// `VaR` penalty
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:793:89
|
|
|
|
|
793 | let final_position_size = if self.config.kelly_integration.kelly_blend_factor > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: casting to the same type is unnecessary (`f64` -> `f64`)
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:788:41
|
|
|
|
|
788 | blended_recommendation: action.position_size() as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `action.position_size()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
|
= note: `-W clippy::unnecessary-cast` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::unnecessary_cast)]`
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:788:41
|
|
|
|
|
788 | blended_recommendation: action.position_size() as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: casting to the same type is unnecessary (`f64` -> `f64`)
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:796:13
|
|
|
|
|
796 | action.position_size() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `action.position_size()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:796:13
|
|
|
|
|
796 | action.position_size() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:814:21
|
|
|
|
|
814 | method: "PPO".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"PPO".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using `clone` on type `MarketRegime` which implements the `Copy` trait
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:864:35
|
|
|
|
|
864 | self.current_regime = new_regime.clone();
|
|
| ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_regime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:877:5
|
|
|
|
|
877 | / pub fn get_performance_metrics(&self) -> &PPOPerformanceTracker {
|
|
878 | | &self.performance_tracker
|
|
879 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
877 | pub const fn get_performance_metrics(&self) -> &PPOPerformanceTracker {
|
|
| +++++
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:882:5
|
|
|
|
|
882 | / pub fn get_config(&self) -> &PPOPositionSizerConfig {
|
|
883 | | &self.config
|
|
884 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
882 | pub const fn get_config(&self) -> &PPOPositionSizerConfig {
|
|
| +++++
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:898:5
|
|
|
|
|
898 | / fn calculate_kelly_comparison(
|
|
899 | | &self,
|
|
900 | | ppo_action: &ContinuousAction,
|
|
901 | | kelly_rec: &KellyPositionRecommendation,
|
|
902 | | ) -> Result<KellyComparisonMetrics, MLError> {
|
|
| |________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
902 - ) -> Result<KellyComparisonMetrics, MLError> {
|
|
902 + ) -> risk::ppo_position_sizer::KellyComparisonMetrics {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
911 ~ KellyComparisonMetrics {
|
|
912 + kelly_optimal_size: kelly_size,
|
|
913 + deviation_from_kelly: deviation,
|
|
914 + kelly_confidence: kelly_rec.confidence,
|
|
915 + blended_recommendation: blended,
|
|
916 + }
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:909:24
|
|
|
|
|
909 | let blended = (1.0 - blend_factor) * ppo_size + blend_factor * kelly_size;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:905:25
|
|
|
|
|
905 | let deviation = (ppo_size - kelly_size).abs();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:909:23
|
|
|
|
|
909 | let blended = (1.0 - blend_factor) * ppo_size + blend_factor * kelly_size;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:932:13
|
|
|
|
|
932 | 0.5 * (2.0 * std::f32::consts::PI * std::f32::consts::E * policy_std.powi(2)).ln();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: casting to the same type is unnecessary (`f64` -> `f64`)
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:935:26
|
|
|
|
|
935 | policy_mean: action.position_size() as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `action.position_size()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:935:26
|
|
|
|
|
935 | policy_mean: action.position_size() as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:936:25
|
|
|
|
|
936 | policy_std: policy_std as f64,
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:937:30
|
|
|
|
|
937 | action_log_prob: log_prob as f64,
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:938:29
|
|
|
|
|
938 | value_estimate: value_estimate as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:939:29
|
|
|
|
|
939 | policy_entropy: policy_entropy as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:944:5
|
|
|
|
|
944 | / fn calculate_action_confidence(
|
|
945 | | &self,
|
|
946 | | ppo_metrics: &PPORecommendationMetrics,
|
|
947 | | ) -> Result<f64, MLError> {
|
|
| |_____________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
947 - ) -> Result<f64, MLError> {
|
|
947 + ) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
954 - Ok(confidence)
|
|
954 + confidence
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:950:27
|
|
|
|
|
950 | let max_entropy = 2.0; // Approximate maximum for our action space
|
|
| ^^^ help: consider adding suffix: `2.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:952:26
|
|
|
|
|
952 | let confidence = 1.0 - normalized_entropy as f64;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: clamp-like pattern without using clamp function
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:951:34
|
|
|
|
|
951 | let normalized_entropy = (ppo_metrics.policy_entropy / max_entropy).min(1.0).max(0.0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(ppo_metrics.policy_entropy / max_entropy).clamp(0.0, 1.0)`
|
|
|
|
|
= note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
|
|
= note: clamp returns NaN if the input is NaN
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:951:34
|
|
|
|
|
951 | let normalized_entropy = (ppo_metrics.policy_entropy / max_entropy).min(1.0).max(0.0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:952:26
|
|
|
|
|
952 | let confidence = 1.0 - normalized_entropy as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: casting to the same type is unnecessary (`f64` -> `f64`)
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:952:32
|
|
|
|
|
952 | let confidence = 1.0 - normalized_entropy as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `normalized_entropy`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:952:32
|
|
|
|
|
952 | let confidence = 1.0 - normalized_entropy as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:958:5
|
|
|
|
|
958 | / fn should_train(&self) -> bool {
|
|
959 | | self.experience_buffer.current_size
|
|
960 | | >= self.config.training_config.min_episodes_before_training
|
|
961 | | && self.episode_counter % self.config.training_config.training_frequency == 0
|
|
962 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
958 | const fn should_train(&self) -> bool {
|
|
| +++++
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:961:16
|
|
|
|
|
961 | && self.episode_counter % self.config.training_config.training_frequency == 0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:980:71
|
|
|
|
|
980 | let advantages_f64: Vec<f64> = advantages.into_iter().map(|x| x as f64).collect();
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:981:65
|
|
|
|
|
981 | let returns_f64: Vec<f64> = returns.into_iter().map(|x| x as f64).collect();
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:998:5
|
|
|
|
|
998 | / fn calculate_gae_advantages(
|
|
999 | | &self,
|
|
1000 | | trajectories: &[ContinuousTrajectory],
|
|
1001 | | ) -> Result<(Vec<f32>, Vec<f32>), MLError> {
|
|
| |______________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1001 - ) -> Result<(Vec<f32>, Vec<f32>), MLError> {
|
|
1001 + ) -> (std::vec::Vec<f32>, std::vec::Vec<f32>) {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1032 - Ok((all_advantages, all_returns))
|
|
1032 + (all_advantages, all_returns)
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1012:41
|
|
|
|
|
1012 | let mut discounted_return = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1013:25
|
|
|
|
|
1013 | let gamma = 0.99; // Discount factor
|
|
| ^^^^ help: consider adding suffix: `0.99_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1016:37
|
|
|
|
|
1016 | discounted_return = step.reward + gamma * discounted_return;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1020:33
|
|
|
|
|
1020 | let advantage = discounted_return - step.value;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1028:66
|
|
|
|
|
1028 | all_advantages.extend(advantages.into_iter().map(|x| x as f32));
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1029:60
|
|
|
|
|
1029 | all_returns.extend(returns.into_iter().map(|x| x as f32));
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1073:36
|
|
|
|
|
1073 | let adjusted_log_std = base_log_std + scaling.ln() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: casting to the same type is unnecessary (`f64` -> `f64`)
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1073:51
|
|
|
|
|
1073 | let adjusted_log_std = base_log_std + scaling.ln() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `scaling.ln()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1073:51
|
|
|
|
|
1073 | let adjusted_log_std = base_log_std + scaling.ln() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1083:70
|
|
|
|
|
1083 | if let Err(e) = self.ppo_agent.set_exploration_param(clamped_log_std as f32) {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1107:13
|
|
|
|
|
1107 | self.current_size += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: manual arithmetic check found
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1114:25
|
|
|
|
|
1114 | let start_idx = if self.current_size > batch_size {
|
|
| _________________________^
|
|
1115 | | self.current_size - batch_size
|
|
1116 | | } else {
|
|
1117 | | 0
|
|
1118 | | };
|
|
| |_________^ help: replace it with: `self.current_size.saturating_sub(batch_size)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub
|
|
= note: `-W clippy::implicit-saturating-sub` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::implicit_saturating_sub)]`
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1115:13
|
|
|
|
|
1115 | self.current_size - batch_size
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: slicing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1120:9
|
|
|
|
|
1120 | self.trajectories[start_idx..start_idx + take_size].to_vec()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1120:38
|
|
|
|
|
1120 | self.trajectories[start_idx..start_idx + take_size].to_vec()
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1125:5
|
|
|
|
|
1125 | pub(super) fn new(state_dim: usize) -> Result<Self, MLError> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1125 - pub(super) fn new(state_dim: usize) -> Result<Self, MLError> {
|
|
1125 + pub(super) fn new(state_dim: usize) -> risk::ppo_position_sizer::MarketStateTracker {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1126 ~ Self {
|
|
1127 + market_features: vec![0.0; state_dim / 3],
|
|
1128 + portfolio_features: vec![0.0; state_dim / 3],
|
|
1129 + risk_features: vec![0.0; state_dim / 3],
|
|
1130 + normalization_params: FeatureNormalizationParams {
|
|
1131 + feature_means: vec![0.0; state_dim],
|
|
1132 + feature_stds: vec![1.0; state_dim],
|
|
1133 + feature_bounds: vec![(-5.0, 5.0); state_dim],
|
|
1134 + },
|
|
1135 + }
|
|
|
|
|
|
|
warning: integer division
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1127:40
|
|
|
|
|
1127 | market_features: vec![0.0; state_dim / 3],
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: integer division
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1128:43
|
|
|
|
|
1128 | portfolio_features: vec![0.0; state_dim / 3],
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: integer division
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1129:38
|
|
|
|
|
1129 | risk_features: vec![0.0; state_dim / 3],
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1159:59
|
|
|
|
|
1159 | state.extend(self.market_features.iter().map(|&x| x as f32));
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1160:62
|
|
|
|
|
1160 | state.extend(self.portfolio_features.iter().map(|&x| x as f32));
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1161:57
|
|
|
|
|
1161 | state.extend(self.risk_features.iter().map(|&x| x as f32));
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1167:5
|
|
|
|
|
1167 | fn update_market_features(&mut self, market_data: &MarketData) -> Result<(), MLError> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
1167 - fn update_market_features(&mut self, market_data: &MarketData) -> Result<(), MLError> {
|
|
1167 + fn update_market_features(&mut self, market_data: &MarketData) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
1182 - Ok(())
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1179:39
|
|
|
|
|
1179 | self.market_features[i] = 0.1 * (i as f64).sin(); // Production
|
|
| ^^^ help: consider adding suffix: `0.1_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: length comparison to zero
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1171:16
|
|
|
|
|
1171 | if self.market_features.len() > 0 {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.market_features.is_empty()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
|
|
= note: `-W clippy::len-zero` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::len_zero)]`
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1172:17
|
|
|
|
|
1172 | self.market_features[0] = volatility_index;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1179:39
|
|
|
|
|
1179 | self.market_features[i] = 0.1 * (i as f64).sin(); // Production
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1179:45
|
|
|
|
|
1179 | self.market_features[i] = 0.1 * (i as f64).sin(); // Production
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1179:13
|
|
|
|
|
1179 | self.market_features[i] = 0.1 * (i as f64).sin(); // Production
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1185:5
|
|
|
|
|
1185 | / fn update_portfolio_features(
|
|
1186 | | &mut self,
|
|
1187 | | portfolio_metrics: &PortfolioRiskMetrics,
|
|
1188 | | ) -> Result<(), MLError> {
|
|
| |____________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
1188 - ) -> Result<(), MLError> {
|
|
1188 + ) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
1202 - Ok(())
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1199:42
|
|
|
|
|
1199 | self.portfolio_features[i] = 0.0; // Production
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1190:13
|
|
|
|
|
1190 | self.portfolio_features[0] = portfolio_metrics.leverage;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1191:13
|
|
|
|
|
1191 | self.portfolio_features[1] = portfolio_metrics.current_drawdown;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1192:13
|
|
|
|
|
1192 | self.portfolio_features[2] = portfolio_metrics.sharpe_ratio;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1193:13
|
|
|
|
|
1193 | self.portfolio_features[3] = portfolio_metrics.sortino_ratio;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1194:13
|
|
|
|
|
1194 | self.portfolio_features[4] = portfolio_metrics.concentration_risk;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1199:13
|
|
|
|
|
1199 | self.portfolio_features[i] = 0.0; // Production
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1205:5
|
|
|
|
|
1205 | / fn update_risk_features(
|
|
1206 | | &mut self,
|
|
1207 | | portfolio_metrics: &PortfolioRiskMetrics,
|
|
1208 | | ) -> Result<(), MLError> {
|
|
| |____________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
1208 - ) -> Result<(), MLError> {
|
|
1208 + ) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
1221 - Ok(())
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1218:37
|
|
|
|
|
1218 | self.risk_features[i] = 0.0; // Production
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1210:13
|
|
|
|
|
1210 | self.risk_features[0] = portfolio_metrics.portfolio_var;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1211:13
|
|
|
|
|
1211 | self.risk_features[1] = portfolio_metrics.portfolio_cvar;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1212:13
|
|
|
|
|
1212 | self.risk_features[2] = portfolio_metrics.max_drawdown;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1213:13
|
|
|
|
|
1213 | self.risk_features[3] = portfolio_metrics.leverage;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1218:13
|
|
|
|
|
1218 | self.risk_features[i] = 0.0; // Production
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1224:5
|
|
|
|
|
1224 | fn normalize_features(&self, mut features: Vec<f32>) -> Result<Vec<f32>, MLError> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1224 - fn normalize_features(&self, mut features: Vec<f32>) -> Result<Vec<f32>, MLError> {
|
|
1224 + fn normalize_features(&self, mut features: Vec<f32>) -> std::vec::Vec<f32> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1239 - Ok(features)
|
|
1239 + features
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1227:28
|
|
|
|
|
1227 | let mean = self.normalization_params.feature_means[i] as f32;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1227:28
|
|
|
|
|
1227 | let mean = self.normalization_params.feature_means[i] as f32;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1228:27
|
|
|
|
|
1228 | let std = self.normalization_params.feature_stds[i] as f32;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1228:27
|
|
|
|
|
1228 | let std = self.normalization_params.feature_stds[i] as f32;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: indexing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1229:46
|
|
|
|
|
1229 | let (min_bound, max_bound) = self.normalization_params.feature_bounds[i];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1232:28
|
|
|
|
|
1232 | *feature = (*feature - mean) / std.max(1e-8);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1235:40
|
|
|
|
|
1235 | *feature = feature.max(min_bound as f32).min(max_bound as f32);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1235:62
|
|
|
|
|
1235 | *feature = feature.max(min_bound as f32).min(max_bound as f32);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1262:43
|
|
|
|
|
1262 | let base_return = position_size * 0.001; // Production return
|
|
| ^^^^^ help: consider adding suffix: `0.001_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: casting to the same type is unnecessary (`f64` -> `f64`)
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1259:29
|
|
|
|
|
1259 | let position_size = action.position_size() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `action.position_size()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1259:29
|
|
|
|
|
1259 | let position_size = action.position_size() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1262:27
|
|
|
|
|
1262 | let base_return = position_size * 0.001; // Production return
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1282:28
|
|
|
|
|
1282 | let total_reward = self.config.return_scaling * base_return
|
|
| ____________________________^
|
|
1283 | | + self.config.sharpe_weight * sharpe_component
|
|
1284 | | - self.config.drawdown_penalty_weight * drawdown_penalty
|
|
1285 | | + self.config.kelly_alignment_weight * kelly_alignment
|
|
1286 | | - self.config.concentration_penalty_weight * concentration_penalty
|
|
1287 | | - self.config.var_penalty_weight * var_penalty;
|
|
| |__________________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1300:5
|
|
|
|
|
1300 | / fn calculate_sharpe_component(
|
|
1301 | | &self,
|
|
1302 | | portfolio_metrics: &PortfolioRiskMetrics,
|
|
1303 | | ) -> Result<f64, MLError> {
|
|
| |_____________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1303 - ) -> Result<f64, MLError> {
|
|
1303 + ) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1304 - Ok(portfolio_metrics.sharpe_ratio.max(0.0))
|
|
1304 + portfolio_metrics.sharpe_ratio.max(0.0)
|
|
|
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1307:5
|
|
|
|
|
1307 | / fn calculate_drawdown_penalty(
|
|
1308 | | &self,
|
|
1309 | | portfolio_metrics: &PortfolioRiskMetrics,
|
|
1310 | | ) -> Result<f64, MLError> {
|
|
| |_____________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1310 - ) -> Result<f64, MLError> {
|
|
1310 + ) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1313 ~ (portfolio_metrics.current_drawdown - threshold).powi(2)
|
|
1314 | } else {
|
|
1315 ~ 0.0
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1313:16
|
|
|
|
|
1313 | Ok((portfolio_metrics.current_drawdown - threshold).powi(2))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1319:5
|
|
|
|
|
1319 | / fn calculate_kelly_alignment(
|
|
1320 | | &self,
|
|
1321 | | position_size: f64,
|
|
1322 | | kelly_recommendation: Option<&KellyPositionRecommendation>,
|
|
1323 | | ) -> Result<f64, MLError> {
|
|
| |_____________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1323 - ) -> Result<f64, MLError> {
|
|
1323 + ) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1329 ~ 1.0 - deviation / max_deviation
|
|
1330 | } else {
|
|
1331 ~ -(deviation - max_deviation).powi(2)
|
|
1332 | }
|
|
1333 | } else {
|
|
1334 ~ 0.0
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1325:29
|
|
|
|
|
1325 | let deviation = (position_size - kelly_rec.recommended_fraction).abs();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1329:20
|
|
|
|
|
1329 | Ok(1.0 - deviation / max_deviation)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1331:20
|
|
|
|
|
1331 | Ok(-(deviation - max_deviation).powi(2))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1338:5
|
|
|
|
|
1338 | / fn calculate_concentration_penalty(
|
|
1339 | | &self,
|
|
1340 | | position_size: f64,
|
|
1341 | | portfolio_metrics: &PortfolioRiskMetrics,
|
|
1342 | | ) -> Result<f64, MLError> {
|
|
| |_____________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1342 - ) -> Result<f64, MLError> {
|
|
1342 + ) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1350 ~ (effective_concentration - threshold).powi(2)
|
|
1351 | } else {
|
|
1352 ~ 0.0
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1350:16
|
|
|
|
|
1350 | Ok((effective_concentration - threshold).powi(2))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1356:5
|
|
|
|
|
1356 | / fn calculate_var_penalty(
|
|
1357 | | &self,
|
|
1358 | | portfolio_metrics: &PortfolioRiskMetrics,
|
|
1359 | | ) -> Result<f64, MLError> {
|
|
| |_____________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1359 - ) -> Result<f64, MLError> {
|
|
1359 + ) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1362 ~ (portfolio_metrics.portfolio_var - threshold).powi(2)
|
|
1363 | } else {
|
|
1364 ~ 0.0
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1362:16
|
|
|
|
|
1362 | Ok((portfolio_metrics.portfolio_var - threshold).powi(2))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: you should consider adding a `Default` implementation for `PPOPerformanceTracker`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1370:5
|
|
|
|
|
1370 | / pub fn new() -> Self {
|
|
1371 | | Self {
|
|
1372 | | episode_returns: Vec::new(),
|
|
1373 | | episode_sharpe_ratios: Vec::new(),
|
|
... |
|
|
1379 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
1369 + impl Default for PPOPerformanceTracker {
|
|
1370 + fn default() -> Self {
|
|
1371 + Self::new()
|
|
1372 + }
|
|
1373 + }
|
|
|
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1370:5
|
|
|
|
|
1370 | / pub fn new() -> Self {
|
|
1371 | | Self {
|
|
1372 | | episode_returns: Vec::new(),
|
|
1373 | | episode_sharpe_ratios: Vec::new(),
|
|
... |
|
|
1379 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
1370 | pub const fn new() -> Self {
|
|
| +++++
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1382:33
|
|
|
|
|
1382 | self.policy_losses.push(policy_loss as f64);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1383:32
|
|
|
|
|
1383 | self.value_losses.push(value_loss as f64);
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1414:25
|
|
|
|
|
1414 | let start_idx = self.episode_returns.len() - window;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: slicing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1415:31
|
|
|
|
|
1415 | let recent_returns = &self.episode_returns[start_idx..];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n..)` or .get_mut(n..)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: slicing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1416:30
|
|
|
|
|
1416 | let recent_sharpe = &self.episode_sharpe_ratios[start_idx..];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n..)` or .get_mut(n..)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: slicing may panic
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1417:33
|
|
|
|
|
1417 | let recent_drawdowns = &self.episode_max_drawdowns[start_idx..];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n..)` or .get_mut(n..)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1419:26
|
|
|
|
|
1419 | let avg_return = recent_returns.iter().sum::<f64>() / recent_returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1419:63
|
|
|
|
|
1419 | let avg_return = recent_returns.iter().sum::<f64>() / recent_returns.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1420:26
|
|
|
|
|
1420 | let avg_sharpe = recent_sharpe.iter().sum::<f64>() / recent_sharpe.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/ppo_position_sizer.rs:1420:62
|
|
|
|
|
1420 | let avg_sharpe = recent_sharpe.iter().sum::<f64>() / recent_sharpe.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/risk/mod.rs:58:12
|
|
|
|
|
58 | pub struct RiskManager {
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/risk/mod.rs:104:12
|
|
|
|
|
104 | pub struct RiskLimits {
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/risk/mod.rs:105:27
|
|
|
|
|
105 | /// Maximum portfolio VaR
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
105 - /// Maximum portfolio VaR
|
|
105 + /// Maximum portfolio `VaR`
|
|
|
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/risk/mod.rs:171:12
|
|
|
|
|
171 | pub struct RiskMetricsCalculator {
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/risk/mod.rs:177:31
|
|
|
|
|
177 | /// Confidence levels for VaR calculation
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
177 - /// Confidence levels for VaR calculation
|
|
177 + /// Confidence levels for `VaR` calculation
|
|
|
|
|
|
|
warning: item name starts with its containing module's name
|
|
--> adaptive-strategy/src/risk/mod.rs:209:12
|
|
|
|
|
209 | pub struct RiskAdjustment {
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/risk/mod.rs:248:24
|
|
|
|
|
248 | /// Value at Risk (VaR)
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
248 - /// Value at Risk (VaR)
|
|
248 + /// Value at Risk (`VaR`)
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/risk/mod.rs:250:36
|
|
|
|
|
250 | /// Conditional Value at Risk (CVaR)
|
|
| ^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
250 - /// Conditional Value at Risk (CVaR)
|
|
250 + /// Conditional Value at Risk (`CVaR`)
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/risk/mod.rs:259:25
|
|
|
|
|
259 | /// Total portfolio VaR
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
259 - /// Total portfolio VaR
|
|
259 + /// Total portfolio `VaR`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/risk/mod.rs:261:19
|
|
|
|
|
261 | /// Portfolio CVaR
|
|
| ^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
261 - /// Portfolio CVaR
|
|
261 + /// Portfolio `CVaR`
|
|
|
|
|
|
|
error: this could be simplified with `bool::then`
|
|
--> adaptive-strategy/src/risk/mod.rs:303:27
|
|
|
|
|
303 | let kelly_sizer = if matches!(config.position_sizing_method, PositionSizingMethod::Kelly) {
|
|
| ___________________________^
|
|
304 | | let kelly_config = KellyConfig {
|
|
305 | | max_fraction: config.kelly_fraction,
|
|
306 | | min_fraction: 0.01,
|
|
... |
|
|
318 | | None
|
|
319 | | };
|
|
| |_________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_some_else_none
|
|
help: try
|
|
|
|
|
303 ~ let kelly_sizer = matches!(config.position_sizing_method, PositionSizingMethod::Kelly).then(|| { let kelly_config = KellyConfig {
|
|
304 + max_fraction: config.kelly_fraction,
|
|
305 + min_fraction: 0.01,
|
|
306 + lookback_period: 252,
|
|
307 + confidence_threshold: 0.6,
|
|
308 + volatility_adjustment: true,
|
|
309 + drawdown_protection: true,
|
|
310 + dynamic_risk_scaling: true,
|
|
311 + max_concentration: 0.20,
|
|
312 + correlation_adjustment: 0.85,
|
|
313 + base_kelly: config.kelly_fraction,
|
|
314 + };
|
|
315 ~ Some(; KellyPositionSizer::new(kelly_config)? });
|
|
|
|
|
|
|
error: this could be simplified with `bool::then`
|
|
--> adaptive-strategy/src/risk/mod.rs:322:25
|
|
|
|
|
322 | let ppo_sizer = if matches!(config.position_sizing_method, PositionSizingMethod::PPO) {
|
|
| _________________________^
|
|
323 | | let ppo_config = PPOPositionSizerConfig {
|
|
324 | | state_dim: 128,
|
|
325 | | ppo_config: ContinuousPPOConfig {
|
|
... |
|
|
370 | | None
|
|
371 | | };
|
|
| |_________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_some_else_none
|
|
help: try
|
|
|
|
|
322 ~ let ppo_sizer = matches!(config.position_sizing_method, PositionSizingMethod::PPO).then(|| { let ppo_config = PPOPositionSizerConfig {
|
|
323 + state_dim: 128,
|
|
324 + ppo_config: ContinuousPPOConfig {
|
|
325 + state_dim: 128,
|
|
326 + action_dim: 1,
|
|
327 + learning_rate: 3e-4,
|
|
328 + policy_config: ContinuousPolicyConfig {
|
|
329 + state_dim: 128,
|
|
330 + hidden_dims: vec![256, 128, 64],
|
|
331 + action_bounds: (0.0, 1.0),
|
|
332 + min_log_std: -3.0,
|
|
333 + max_log_std: 1.0,
|
|
334 + init_log_std: -1.5,
|
|
335 + learnable_std: true,
|
|
336 + },
|
|
337 + value_hidden_dims: vec![256, 128, 64],
|
|
338 + policy_learning_rate: 3e-4,
|
|
339 + value_learning_rate: 3e-4,
|
|
340 + clip_epsilon: 0.2,
|
|
341 + value_loss_coeff: 0.5,
|
|
342 + entropy_coeff: 0.01,
|
|
343 + batch_size: 2048,
|
|
344 + mini_batch_size: 64,
|
|
345 + num_epochs: 10,
|
|
346 + max_grad_norm: 0.5,
|
|
347 + },
|
|
348 + reward_config: RewardFunctionConfig {
|
|
349 + sharpe_weight: 2.0,
|
|
350 + drawdown_penalty_weight: 5.0,
|
|
351 + kelly_alignment_weight: 1.5,
|
|
352 + concentration_penalty_weight: 3.0,
|
|
353 + var_penalty_weight: 4.0,
|
|
354 + return_scaling: 1.0,
|
|
355 + risk_penalty_thresholds: ppo_position_sizer::RiskPenaltyThresholds {
|
|
356 + max_sharpe_deviation: 0.5,
|
|
357 + max_drawdown_threshold: config.max_drawdown_threshold,
|
|
358 + max_concentration_threshold: 0.25,
|
|
359 + var_limit_fraction: config.max_portfolio_var,
|
|
360 + },
|
|
361 + },
|
|
362 + ..Default::default()
|
|
363 + };
|
|
364 + Some(
|
|
365 + ; PPOPositionSizer::new(ppo_config)
|
|
366 ~ .map_err(|e| anyhow::anyhow!("Failed to create PPO position sizer: {}", e))? });
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:508:66
|
|
|
|
|
508 | margin_requirement: Decimal::try_from(size * price * 0.1).unwrap_or(Decimal::ZERO),
|
|
| ^^^ help: consider adding suffix: `0.1_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:498:38
|
|
|
|
|
498 | basis: Decimal::try_from(size * price).unwrap_or(Decimal::ZERO),
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:500:45
|
|
|
|
|
500 | market_value: Decimal::try_from(size * price).unwrap_or(Decimal::ZERO),
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:507:47
|
|
|
|
|
507 | notional_value: Decimal::try_from(size * price).unwrap_or(Decimal::ZERO),
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:508:51
|
|
|
|
|
508 | margin_requirement: Decimal::try_from(size * price * 0.1).unwrap_or(Decimal::ZERO),
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: used `unwrap()` on an `Option` value
|
|
--> adaptive-strategy/src/risk/mod.rs:542:36
|
|
|
|
|
542 | let kelly_recommendation = self
|
|
| ____________________________________^
|
|
543 | | .kelly_sizer
|
|
544 | | .as_mut()
|
|
545 | | .unwrap()
|
|
| |_____________________^
|
|
|
|
|
= note: if this value is `None`, it will panic
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:558:13
|
|
|
|
|
558 | kelly_recommendation.recommended_fraction * portfolio_value / current_price;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:565:21
|
|
|
|
|
565 | var_95: position_size * current_price * kelly_recommendation.volatility * 1.645,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:566:22
|
|
|
|
|
566 | cvar_95: position_size * current_price * kelly_recommendation.volatility * 1.645 * 1.28,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:567:23
|
|
|
|
|
567 | max_loss: position_size * current_price,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:573:31
|
|
|
|
|
573 | max_allowed_size: kelly_recommendation.max_allowed_fraction * portfolio_value
|
|
| _______________________________^
|
|
574 | | / current_price,
|
|
| |_______________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/mod.rs:575:21
|
|
|
|
|
575 | method: "Enhanced Kelly Criterion".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Enhanced Kelly Criterion".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:586:13
|
|
|
|
|
586 | 0.05, -0.02, 0.08, -0.03, 0.06, -0.01, 0.04, -0.02, 0.07, -0.01, 0.03, -0.04, 0.09,
|
|
| ^^^^ help: consider adding suffix: `0.05_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:586:20
|
|
|
|
|
586 | 0.05, -0.02, 0.08, -0.03, 0.06, -0.01, 0.04, -0.02, 0.07, -0.01, 0.03, -0.04, 0.09,
|
|
| ^^^^ help: consider adding suffix: `0.02_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:586:26
|
|
|
|
|
586 | 0.05, -0.02, 0.08, -0.03, 0.06, -0.01, 0.04, -0.02, 0.07, -0.01, 0.03, -0.04, 0.09,
|
|
| ^^^^ help: consider adding suffix: `0.08_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:586:33
|
|
|
|
|
586 | 0.05, -0.02, 0.08, -0.03, 0.06, -0.01, 0.04, -0.02, 0.07, -0.01, 0.03, -0.04, 0.09,
|
|
| ^^^^ help: consider adding suffix: `0.03_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:586:39
|
|
|
|
|
586 | 0.05, -0.02, 0.08, -0.03, 0.06, -0.01, 0.04, -0.02, 0.07, -0.01, 0.03, -0.04, 0.09,
|
|
| ^^^^ help: consider adding suffix: `0.06_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:586:46
|
|
|
|
|
586 | 0.05, -0.02, 0.08, -0.03, 0.06, -0.01, 0.04, -0.02, 0.07, -0.01, 0.03, -0.04, 0.09,
|
|
| ^^^^ help: consider adding suffix: `0.01_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:586:52
|
|
|
|
|
586 | 0.05, -0.02, 0.08, -0.03, 0.06, -0.01, 0.04, -0.02, 0.07, -0.01, 0.03, -0.04, 0.09,
|
|
| ^^^^ help: consider adding suffix: `0.04_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:586:59
|
|
|
|
|
586 | 0.05, -0.02, 0.08, -0.03, 0.06, -0.01, 0.04, -0.02, 0.07, -0.01, 0.03, -0.04, 0.09,
|
|
| ^^^^ help: consider adding suffix: `0.02_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:586:65
|
|
|
|
|
586 | 0.05, -0.02, 0.08, -0.03, 0.06, -0.01, 0.04, -0.02, 0.07, -0.01, 0.03, -0.04, 0.09,
|
|
| ^^^^ help: consider adding suffix: `0.07_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:586:72
|
|
|
|
|
586 | 0.05, -0.02, 0.08, -0.03, 0.06, -0.01, 0.04, -0.02, 0.07, -0.01, 0.03, -0.04, 0.09,
|
|
| ^^^^ help: consider adding suffix: `0.01_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:586:78
|
|
|
|
|
586 | 0.05, -0.02, 0.08, -0.03, 0.06, -0.01, 0.04, -0.02, 0.07, -0.01, 0.03, -0.04, 0.09,
|
|
| ^^^^ help: consider adding suffix: `0.03_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:586:85
|
|
|
|
|
586 | 0.05, -0.02, 0.08, -0.03, 0.06, -0.01, 0.04, -0.02, 0.07, -0.01, 0.03, -0.04, 0.09,
|
|
| ^^^^ help: consider adding suffix: `0.04_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:586:91
|
|
|
|
|
586 | 0.05, -0.02, 0.08, -0.03, 0.06, -0.01, 0.04, -0.02, 0.07, -0.01, 0.03, -0.04, 0.09,
|
|
| ^^^^ help: consider adding suffix: `0.09_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:587:14
|
|
|
|
|
587 | -0.02, 0.05, -0.03, 0.06, -0.01, 0.08, -0.02,
|
|
| ^^^^ help: consider adding suffix: `0.02_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:587:20
|
|
|
|
|
587 | -0.02, 0.05, -0.03, 0.06, -0.01, 0.08, -0.02,
|
|
| ^^^^ help: consider adding suffix: `0.05_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:587:27
|
|
|
|
|
587 | -0.02, 0.05, -0.03, 0.06, -0.01, 0.08, -0.02,
|
|
| ^^^^ help: consider adding suffix: `0.03_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:587:33
|
|
|
|
|
587 | -0.02, 0.05, -0.03, 0.06, -0.01, 0.08, -0.02,
|
|
| ^^^^ help: consider adding suffix: `0.06_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:587:40
|
|
|
|
|
587 | -0.02, 0.05, -0.03, 0.06, -0.01, 0.08, -0.02,
|
|
| ^^^^ help: consider adding suffix: `0.01_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:587:46
|
|
|
|
|
587 | -0.02, 0.05, -0.03, 0.06, -0.01, 0.08, -0.02,
|
|
| ^^^^ help: consider adding suffix: `0.08_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:587:53
|
|
|
|
|
587 | -0.02, 0.05, -0.03, 0.06, -0.01, 0.08, -0.02,
|
|
| ^^^^ help: consider adding suffix: `0.02_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:597:49
|
|
|
|
|
597 | volatilities.insert(symbol.to_string(), 0.20); // 20% default volatility
|
|
| ^^^^ help: consider adding suffix: `0.20_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:604:36
|
|
|
|
|
604 | volatility_index: Some(20.0),
|
|
| ^^^^ help: consider adding suffix: `20.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/mod.rs:594:23
|
|
|
|
|
594 | prices.insert(symbol.to_string(), current_price);
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `symbol.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/mod.rs:597:29
|
|
|
|
|
597 | volatilities.insert(symbol.to_string(), 0.20); // 20% default volatility
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `symbol.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: used `unwrap()` on an `Option` value
|
|
--> adaptive-strategy/src/risk/mod.rs:631:17
|
|
|
|
|
631 | / self.kelly_sizer
|
|
632 | | .as_mut()
|
|
633 | | .unwrap()
|
|
| |_____________________________^
|
|
|
|
|
= note: if this value is `None`, it will panic
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
|
|
|
error: used `unwrap()` on an `Option` value
|
|
--> adaptive-strategy/src/risk/mod.rs:647:34
|
|
|
|
|
647 | let ppo_recommendation = self
|
|
| __________________________________^
|
|
648 | | .ppo_sizer
|
|
649 | | .as_mut()
|
|
650 | | .unwrap()
|
|
| |_____________________^
|
|
|
|
|
= note: if this value is `None`, it will panic
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:697:49
|
|
|
|
|
697 | volatilities.insert(symbol.to_string(), 0.20); // 20% default volatility
|
|
| ^^^^ help: consider adding suffix: `0.20_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:700:69
|
|
|
|
|
700 | sentiment_indicators.insert("market_sentiment".to_string(), 0.5); // Neutral sentiment
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:701:61
|
|
|
|
|
701 | sentiment_indicators.insert("momentum".to_string(), 0.0); // No momentum bias
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:708:36
|
|
|
|
|
708 | volatility_index: Some(20.0), // VIX-like indicator
|
|
| ^^^^ help: consider adding suffix: `20.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/mod.rs:694:23
|
|
|
|
|
694 | prices.insert(symbol.to_string(), current_price);
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `symbol.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/mod.rs:697:29
|
|
|
|
|
697 | volatilities.insert(symbol.to_string(), 0.20); // 20% default volatility
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `symbol.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/mod.rs:700:37
|
|
|
|
|
700 | sentiment_indicators.insert("market_sentiment".to_string(), 0.5); // Neutral sentiment
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"market_sentiment".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/mod.rs:701:37
|
|
|
|
|
701 | sentiment_indicators.insert("momentum".to_string(), 0.0); // No momentum bias
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `"momentum".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/mod.rs:715:5
|
|
|
|
|
715 | / fn convert_regime(regime: &crate::regime::MarketRegime) -> u32 {
|
|
716 | | match regime {
|
|
717 | | crate::regime::MarketRegime::Normal => 0,
|
|
718 | | crate::regime::MarketRegime::Trending => 1,
|
|
... |
|
|
730 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
715 | const fn convert_regime(regime: &crate::regime::MarketRegime) -> u32 {
|
|
| +++++
|
|
|
|
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
|
|
--> adaptive-strategy/src/risk/mod.rs:715:31
|
|
|
|
|
715 | fn convert_regime(regime: &crate::regime::MarketRegime) -> u32 {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider passing by value instead: `crate::regime::MarketRegime`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/mod.rs:817:5
|
|
|
|
|
817 | / pub fn is_ppo_enabled(&self) -> bool {
|
|
818 | | matches!(
|
|
819 | | self.config.position_sizing_method,
|
|
820 | | PositionSizingMethod::PPO
|
|
821 | | ) && self.ppo_sizer.is_some()
|
|
822 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
817 | pub const fn is_ppo_enabled(&self) -> bool {
|
|
| +++++
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/mod.rs:825:5
|
|
|
|
|
825 | / fn calculate_max_allowed_size(
|
|
826 | | &self,
|
|
827 | | _symbol: &str,
|
|
828 | | price: f64,
|
|
829 | | portfolio_metrics: &PortfolioRiskMetrics,
|
|
830 | | ) -> Result<f64> {
|
|
| |____________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
830 - ) -> Result<f64> {
|
|
830 + ) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
849 ~ [max_by_position_limit, max_by_var, max_by_concentration]
|
|
850 + .iter()
|
|
851 + .cloned()
|
|
852 + .fold(f64::INFINITY, f64::min)
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:840:54
|
|
|
|
|
840 | let max_by_var = if remaining_var_capacity > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:843:13
|
|
|
|
|
843 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:835:13
|
|
|
|
|
835 | (portfolio_value * self.config.max_leverage * self.config.kelly_fraction) / price;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:839:13
|
|
|
|
|
839 | self.config.max_portfolio_var - portfolio_metrics.portfolio_var;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:841:13
|
|
|
|
|
841 | remaining_var_capacity * portfolio_value / price
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:847:36
|
|
|
|
|
847 | let max_by_concentration = (portfolio_value * self.config.kelly_fraction) / price;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:866:24
|
|
|
|
|
866 | .unwrap_or(0.02);
|
|
| ^^^^ help: consider adding suffix: `0.02_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:869:50
|
|
|
|
|
869 | let var_95 = size * price * volatility * 1.645; // 95% VaR assuming normal distribution
|
|
| ^^^^^ help: consider adding suffix: `1.645_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:870:32
|
|
|
|
|
870 | let cvar_95 = var_95 * 1.28; // Approximate CVaR
|
|
| ^^^^ help: consider adding suffix: `1.28_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:872:44
|
|
|
|
|
872 | let sharpe_ratio = if volatility > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:875:13
|
|
|
|
|
875 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:869:22
|
|
|
|
|
869 | let var_95 = size * price * volatility * 1.645; // 95% VaR assuming normal distribution
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:870:23
|
|
|
|
|
870 | let cvar_95 = var_95 * 1.28; // Approximate CVaR
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:873:13
|
|
|
|
|
873 | expected_return / volatility
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:884:23
|
|
|
|
|
884 | max_loss: size * price, // Worst case: total loss
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/mod.rs:967:5
|
|
|
|
|
967 | / fn calculate_fixed_fraction_size(&self, _symbol: &str, _price: f64) -> Result<f64> {
|
|
968 | | // Production implementation
|
|
969 | | Ok(1000.0) // Fixed size
|
|
970 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
967 | const fn calculate_fixed_fraction_size(&self, _symbol: &str, _price: f64) -> Result<f64> {
|
|
| +++++
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/mod.rs:967:5
|
|
|
|
|
967 | fn calculate_fixed_fraction_size(&self, _symbol: &str, _price: f64) -> Result<f64> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
967 - fn calculate_fixed_fraction_size(&self, _symbol: &str, _price: f64) -> Result<f64> {
|
|
967 + fn calculate_fixed_fraction_size(&self, _symbol: &str, _price: f64) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
969 - Ok(1000.0) // Fixed size
|
|
969 + 1000.0 // Fixed size
|
|
|
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/mod.rs:973:5
|
|
|
|
|
973 | / fn calculate_fixed_fractional_size(
|
|
974 | | &self,
|
|
975 | | fraction: f64,
|
|
976 | | _symbol: &str,
|
|
977 | | _price: f64,
|
|
978 | | ) -> Result<f64> {
|
|
| |____________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
978 - ) -> Result<f64> {
|
|
978 + ) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
980 - Ok(portfolio_value * fraction.clamp(0.0, 1.0))
|
|
980 + portfolio_value * fraction.clamp(0.0, 1.0)
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:980:12
|
|
|
|
|
980 | Ok(portfolio_value * fraction.clamp(0.0, 1.0))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/mod.rs:984:5
|
|
|
|
|
984 | fn calculate_equal_weight_size(&self, _symbol: &str, _price: f64) -> Result<f64> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
984 - fn calculate_equal_weight_size(&self, _symbol: &str, _price: f64) -> Result<f64> {
|
|
984 + fn calculate_equal_weight_size(&self, _symbol: &str, _price: f64) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
987 - Ok(portfolio_value / position_count as f64)
|
|
987 + portfolio_value / position_count as f64
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:987:12
|
|
|
|
|
987 | Ok(portfolio_value / position_count as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/mod.rs:987:30
|
|
|
|
|
987 | Ok(portfolio_value / position_count as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/risk/mod.rs:990:73
|
|
|
|
|
990 | /// Kelly criterion position sizing (enhanced version available via KellyPositionSizer)
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
990 - /// Kelly criterion position sizing (enhanced version available via KellyPositionSizer)
|
|
990 + /// Kelly criterion position sizing (enhanced version available via `KellyPositionSizer`)
|
|
|
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/mod.rs:991:5
|
|
|
|
|
991 | fn calculate_kelly_size(&self, expected_return: f64, confidence: f64) -> Result<f64> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
991 - fn calculate_kelly_size(&self, expected_return: f64, confidence: f64) -> Result<f64> {
|
|
991 + fn calculate_kelly_size(&self, expected_return: f64, confidence: f64) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
993 ~ return 0.0;
|
|
994 | }
|
|
...
|
|
1006| if avg_loss == 0.0 {
|
|
1007~ return 0.0;
|
|
1008| }
|
|
...
|
|
1014|
|
|
1015~ conservative_kelly.max(0.0).min(1.0) * 10000.0 // Scale to position size
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1006:24
|
|
|
|
|
1006 | if avg_loss == 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1010:53
|
|
|
|
|
1010 | let kelly_fraction = (win_rate * avg_win - (1.0 - win_rate) * avg_loss.abs()) / avg_win;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1013:51
|
|
|
|
|
1013 | let conservative_kelly = kelly_fraction * 0.25; // Use quarter Kelly for safety
|
|
| ^^^^ help: consider adding suffix: `0.25_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:999:24
|
|
|
|
|
999 | let avg_loss = self
|
|
| ________________________^
|
|
1000 | | .historical_returns
|
|
1001 | | .iter()
|
|
1002 | | .filter(|&&r| r < 0.0)
|
|
1003 | | .sum::<f64>()
|
|
1004 | | / self.historical_returns.iter().filter(|&&r| r < 0.0).count() as f64;
|
|
| |_________________________________________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1002:31
|
|
|
|
|
1002 | .filter(|&&r| r < 0.0)
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> adaptive-strategy/src/risk/mod.rs:1004:15
|
|
|
|
|
1004 | / self.historical_returns.iter().filter(|&&r| r < 0.0).count() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1004:63
|
|
|
|
|
1004 | / self.historical_returns.iter().filter(|&&r| r < 0.0).count() as f64;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:1010:30
|
|
|
|
|
1010 | let kelly_fraction = (win_rate * avg_win - (1.0 - win_rate) * avg_loss.abs()) / avg_win;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:1013:34
|
|
|
|
|
1013 | let conservative_kelly = kelly_fraction * 0.25; // Use quarter Kelly for safety
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:1015:12
|
|
|
|
|
1015 | Ok(conservative_kelly.max(0.0).min(1.0) * 10000.0) // Scale to position size
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: clamp-like pattern without using clamp function
|
|
--> adaptive-strategy/src/risk/mod.rs:1015:12
|
|
|
|
|
1015 | Ok(conservative_kelly.max(0.0).min(1.0) * 10000.0) // Scale to position size
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `conservative_kelly.clamp(0.0, 1.0)`
|
|
|
|
|
= note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
|
|
= note: clamp returns NaN if the input is NaN
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/mod.rs:1020:5
|
|
|
|
|
1020 | / fn calculate_risk_parity_size(&self, _symbol: &str) -> Result<f64> {
|
|
1021 | | // Production implementation
|
|
1022 | | Ok(1000.0)
|
|
1023 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
1020 | const fn calculate_risk_parity_size(&self, _symbol: &str) -> Result<f64> {
|
|
| +++++
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/mod.rs:1020:5
|
|
|
|
|
1020 | fn calculate_risk_parity_size(&self, _symbol: &str) -> Result<f64> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1020 - fn calculate_risk_parity_size(&self, _symbol: &str) -> Result<f64> {
|
|
1020 + fn calculate_risk_parity_size(&self, _symbol: &str) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1022 - Ok(1000.0)
|
|
1022 + 1000.0
|
|
|
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/mod.rs:1027:5
|
|
|
|
|
1027 | fn calculate_volatility_target_size(&self, symbol: &str, price: f64) -> Result<f64> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1027 - fn calculate_volatility_target_size(&self, symbol: &str, price: f64) -> Result<f64> {
|
|
1027 + fn calculate_volatility_target_size(&self, symbol: &str, price: f64) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1032 ~ return 0.0;
|
|
1033 | }
|
|
1034 |
|
|
1035 | let size = (target_volatility / estimated_volatility) * 1000.0 / price;
|
|
1036 ~ size
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1028:33
|
|
|
|
|
1028 | let target_volatility = 0.15; // 15% annual volatility target
|
|
| ^^^^ help: consider adding suffix: `0.15_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1029:83
|
|
|
|
|
1029 | let estimated_volatility = self.get_volatility_estimate(symbol).unwrap_or(0.02);
|
|
| ^^^^ help: consider adding suffix: `0.02_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1031:36
|
|
|
|
|
1031 | if estimated_volatility == 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1035:65
|
|
|
|
|
1035 | let size = (target_volatility / estimated_volatility) * 1000.0 / price;
|
|
| ^^^^^^ help: consider adding suffix: `1_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:1035:20
|
|
|
|
|
1035 | let size = (target_volatility / estimated_volatility) * 1000.0 / price;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/mod.rs:1041:5
|
|
|
|
|
1041 | / fn calculate_custom_size(
|
|
1042 | | &self,
|
|
1043 | | _method: &str,
|
|
1044 | | _symbol: &str,
|
|
... |
|
|
1050 | | Ok(1000.0)
|
|
1051 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
1041 | const fn calculate_custom_size(
|
|
| +++++
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/mod.rs:1041:5
|
|
|
|
|
1041 | / fn calculate_custom_size(
|
|
1042 | | &self,
|
|
1043 | | _method: &str,
|
|
1044 | | _symbol: &str,
|
|
... |
|
|
1047 | | _price: f64,
|
|
1048 | | ) -> Result<f64> {
|
|
| |____________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1048 - ) -> Result<f64> {
|
|
1048 + ) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1050 - Ok(1000.0)
|
|
1050 + 1000.0
|
|
|
|
|
|
|
error: `to_string()` called on a `String`
|
|
--> adaptive-strategy/src/risk/mod.rs:1086:31
|
|
|
|
|
1086 | self.positions.insert(position.symbol.to_string(), position);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.clone()`
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#string_to_string
|
|
= note: requested on the command line with `-D clippy::string-to-string`
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:1104:29
|
|
|
|
|
1104 | portfolio_cvar: portfolio_var * 1.28, // Approximate CVaR
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1119:73
|
|
|
|
|
1119 | let position_value = position.quantity.abs().to_f64().unwrap_or(0.0)
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1120:57
|
|
|
|
|
1120 | * position.average_price.to_f64().unwrap_or(0.0);
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:1119:30
|
|
|
|
|
1119 | let position_value = position.quantity.abs().to_f64().unwrap_or(0.0)
|
|
| ______________________________^
|
|
1120 | | * position.average_price.to_f64().unwrap_or(0.0);
|
|
| |____________________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:1121:33
|
|
|
|
|
1121 | let position_fraction = position_value / portfolio_value;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/mod.rs:1127:5
|
|
|
|
|
1127 | / pub fn get_portfolio_value(&self) -> f64 {
|
|
1128 | | self.pnl_tracker.portfolio_value
|
|
1129 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
1127 | pub const fn get_portfolio_value(&self) -> f64 {
|
|
| +++++
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1140:53
|
|
|
|
|
1140 | p.quantity.abs().to_f64().unwrap_or(0.0) * p.average_price.to_f64().unwrap_or(0.0)
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1140:95
|
|
|
|
|
1140 | p.quantity.abs().to_f64().unwrap_or(0.0) * p.average_price.to_f64().unwrap_or(0.0)
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:1140:17
|
|
|
|
|
1140 | p.quantity.abs().to_f64().unwrap_or(0.0) * p.average_price.to_f64().unwrap_or(0.0)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:1144:24
|
|
|
|
|
1144 | let leverage = total_exposure / portfolio_value;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/mod.rs:1146:13
|
|
|
|
|
1146 | "leverage".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `"leverage".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:1147:13
|
|
|
|
|
1147 | leverage / self.risk_limits.max_leverage,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/risk/mod.rs:1151:13
|
|
|
|
|
1151 | "drawdown".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `"drawdown".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:1152:13
|
|
|
|
|
1152 | self.drawdown_calculator.current_drawdown / self.risk_limits.max_drawdown,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1164:53
|
|
|
|
|
1164 | p.quantity.abs().to_f64().unwrap_or(0.0) * p.average_price.to_f64().unwrap_or(0.0)
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1164:95
|
|
|
|
|
1164 | p.quantity.abs().to_f64().unwrap_or(0.0) * p.average_price.to_f64().unwrap_or(0.0)
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:1164:17
|
|
|
|
|
1164 | p.quantity.abs().to_f64().unwrap_or(0.0) * p.average_price.to_f64().unwrap_or(0.0)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/mod.rs:1175:5
|
|
|
|
|
1175 | fn calculate_leverage(&self) -> Result<f64> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1175 - fn calculate_leverage(&self) -> Result<f64> {
|
|
1175 + fn calculate_leverage(&self) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1186 ~ 0.0
|
|
1187 | } else {
|
|
1188 ~ total_exposure / portfolio_value
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1181:53
|
|
|
|
|
1181 | p.quantity.abs().to_f64().unwrap_or(0.0) * p.average_price.to_f64().unwrap_or(0.0)
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1181:95
|
|
|
|
|
1181 | p.quantity.abs().to_f64().unwrap_or(0.0) * p.average_price.to_f64().unwrap_or(0.0)
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:1181:17
|
|
|
|
|
1181 | p.quantity.abs().to_f64().unwrap_or(0.0) * p.average_price.to_f64().unwrap_or(0.0)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:1188:16
|
|
|
|
|
1188 | Ok(total_exposure / portfolio_value)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> adaptive-strategy/src/risk/mod.rs:1192:29
|
|
|
|
|
1192 | /// Calculate portfolio VaR (simplified)
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1192 - /// Calculate portfolio VaR (simplified)
|
|
1192 + /// Calculate portfolio `VaR` (simplified)
|
|
|
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/mod.rs:1193:5
|
|
|
|
|
1193 | fn calculate_portfolio_var(&self, _metrics_calculator: &RiskMetricsCalculator) -> Result<f64> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1193 - fn calculate_portfolio_var(&self, _metrics_calculator: &RiskMetricsCalculator) -> Result<f64> {
|
|
1193 + fn calculate_portfolio_var(&self, _metrics_calculator: &RiskMetricsCalculator) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1198 - Ok(portfolio_value * estimated_volatility * 1.645) // 95% VaR
|
|
1198 + portfolio_value * estimated_volatility * 1.645 // 95% VaR
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1196:36
|
|
|
|
|
1196 | let estimated_volatility = 0.02; // 2% daily volatility assumption
|
|
| ^^^^ help: consider adding suffix: `0.02_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:1198:12
|
|
|
|
|
1198 | Ok(portfolio_value * estimated_volatility * 1.645) // 95% VaR
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/mod.rs:1202:5
|
|
|
|
|
1202 | / fn calculate_sharpe_ratio(&self) -> Result<f64> {
|
|
1203 | | // Production implementation
|
|
1204 | | Ok(1.5)
|
|
1205 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
1202 | const fn calculate_sharpe_ratio(&self) -> Result<f64> {
|
|
| +++++
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/mod.rs:1202:5
|
|
|
|
|
1202 | fn calculate_sharpe_ratio(&self) -> Result<f64> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1202 - fn calculate_sharpe_ratio(&self) -> Result<f64> {
|
|
1202 + fn calculate_sharpe_ratio(&self) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1204 - Ok(1.5)
|
|
1204 + 1.5
|
|
|
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/mod.rs:1208:5
|
|
|
|
|
1208 | / fn calculate_sortino_ratio(&self) -> Result<f64> {
|
|
1209 | | // Production implementation
|
|
1210 | | Ok(1.8)
|
|
1211 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
1208 | const fn calculate_sortino_ratio(&self) -> Result<f64> {
|
|
| +++++
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/mod.rs:1208:5
|
|
|
|
|
1208 | fn calculate_sortino_ratio(&self) -> Result<f64> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1208 - fn calculate_sortino_ratio(&self) -> Result<f64> {
|
|
1208 + fn calculate_sortino_ratio(&self) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1210 - Ok(1.8)
|
|
1210 + 1.8
|
|
|
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> adaptive-strategy/src/risk/mod.rs:1214:5
|
|
|
|
|
1214 | fn calculate_concentration_risk(&self) -> Result<f64> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1214 - fn calculate_concentration_risk(&self) -> Result<f64> {
|
|
1214 + fn calculate_concentration_risk(&self) -> f64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1216 ~ return 0.0;
|
|
1217 | }
|
|
...
|
|
1228 |
|
|
1229 ~ max_position_value / portfolio_value
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1224:54
|
|
|
|
|
1224 | (p.quantity.abs().to_f64().unwrap_or(0.0) * p.average_price.to_f64().unwrap_or(0.0))
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1224:96
|
|
|
|
|
1224 | (p.quantity.abs().to_f64().unwrap_or(0.0) * p.average_price.to_f64().unwrap_or(0.0))
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:1224:17
|
|
|
|
|
1224 | (p.quantity.abs().to_f64().unwrap_or(0.0) * p.average_price.to_f64().unwrap_or(0.0))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:1229:12
|
|
|
|
|
1229 | Ok(max_position_value / portfolio_value)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/mod.rs:1235:5
|
|
|
|
|
1235 | / pub fn new(initial_value: f64) -> Self {
|
|
1236 | | Self {
|
|
1237 | | daily_pnl: Vec::new(),
|
|
1238 | | session_pnl: 0.0,
|
|
... |
|
|
1242 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
1235 | pub const fn new(initial_value: f64) -> Self {
|
|
| +++++
|
|
|
|
warning: you should consider adding a `Default` implementation for `DrawdownCalculator`
|
|
--> adaptive-strategy/src/risk/mod.rs:1247:5
|
|
|
|
|
1247 | / pub fn new() -> Self {
|
|
1248 | | let initial_value = 100000.0;
|
|
1249 | | Self {
|
|
1250 | | value_history: Vec::new(),
|
|
... |
|
|
1256 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
1245 + impl Default for DrawdownCalculator {
|
|
1246 + fn default() -> Self {
|
|
1247 + Self::new()
|
|
1248 + }
|
|
1249 + }
|
|
|
|
|
|
|
warning: this could be a `const fn`
|
|
--> adaptive-strategy/src/risk/mod.rs:1247:5
|
|
|
|
|
1247 | / pub fn new() -> Self {
|
|
1248 | | let initial_value = 100000.0;
|
|
1249 | | Self {
|
|
1250 | | value_history: Vec::new(),
|
|
... |
|
|
1256 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
1247 | pub const fn new() -> Self {
|
|
| +++++
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1248:29
|
|
|
|
|
1248 | let initial_value = 100000.0;
|
|
| ^^^^^^^^ help: consider adding suffix: `100_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> adaptive-strategy/src/risk/mod.rs:1266:37
|
|
|
|
|
1266 | self.current_drawdown = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> adaptive-strategy/src/risk/mod.rs:1270:37
|
|
|
|
|
1270 | self.current_drawdown = (self.high_water_mark - new_value) / self.high_water_mark;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: use of `or_insert_with` to construct default value
|
|
--> adaptive-strategy/src/risk/mod.rs:1301:56
|
|
|
|
|
1301 | let history = self.price_history.entry(symbol).or_insert_with(Vec::new);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> adaptive-strategy/src/lib.rs:156:29
|
|
|
|
|
156 | current_regime: "unknown".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"unknown".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: multiple implementations of this structure
|
|
--> adaptive-strategy/src/models/deep_learning.rs:963:1
|
|
|
|
|
963 | / impl Mamba2Model {
|
|
964 | | /// Convert training data to tensor format for MAMBA-2
|
|
965 | | fn convert_training_data(
|
|
966 | | &self,
|
|
... |
|
|
973 | | }
|
|
| |_^
|
|
|
|
|
note: first implementation here
|
|
--> adaptive-strategy/src/models/deep_learning.rs:528:1
|
|
|
|
|
528 | / impl Mamba2Model {
|
|
529 | | /// Create a new MAMBA-2 model optimized for HFT
|
|
530 | | pub async fn new(name: String, config: ModelConfig) -> Result<Self> {
|
|
531 | | info!("Creating MAMBA-2 SSM model: {}", name);
|
|
... |
|
|
771 | | }
|
|
| |_^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_inherent_impl
|
|
= note: requested on the command line with `-D clippy::multiple-inherent-impl`
|
|
|
|
warning: `adaptive-strategy` (lib) generated 1794 warnings
|
|
error: could not compile `adaptive-strategy` (lib) due to 267 previous errors; 1794 warnings emitted
|
|
warning: build failed, waiting for other jobs to finish...
|
|
warning: unused import: `std::io::Write`
|
|
--> trading_engine/src/compliance/audit_trails.rs:537:13
|
|
|
|
|
537 | use std::io::Write;
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
warning: variable does not need to be mutable
|
|
--> trading_engine/src/compliance/audit_trails.rs:539:13
|
|
|
|
|
539 | let mut file = OpenOptions::new()
|
|
| ----^^^^
|
|
| |
|
|
| help: remove this `mut`
|
|
|
|
warning: casting `u64` to `i64` may wrap around the value
|
|
--> trading_engine/src/types/timestamp_utils.rs:13:5
|
|
|
|
|
13 | timestamp.as_nanos() as i64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/types/mod.rs:23:5
|
|
|
|
|
23 | clippy::pedantic,
|
|
| ^^^^^^^^^^^^^^^^
|
|
= note: `#[warn(clippy::cast_possible_wrap)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/timestamp_utils.rs:13:5
|
|
|
|
|
13 | timestamp.as_nanos() as i64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
= note: requested on the command line with `-W clippy::as-conversions`
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/timestamp_utils.rs:16:32
|
|
|
|
|
16 | /// Convert i64 nanoseconds to HardwareTimestamp
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
= note: `#[warn(clippy::doc_markdown)]` implied by `#[warn(clippy::pedantic)]`
|
|
help: try
|
|
|
|
|
16 - /// Convert i64 nanoseconds to HardwareTimestamp
|
|
16 + /// Convert i64 nanoseconds to `HardwareTimestamp`
|
|
|
|
|
|
|
warning: you have declared `#[inline(always)]` on `i64_to_hardware_timestamp`. This is usually a bad idea
|
|
--> trading_engine/src/types/timestamp_utils.rs:17:1
|
|
|
|
|
17 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
= note: `#[warn(clippy::inline_always)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: casting `i64` to `u64` may lose the sign of the value
|
|
--> trading_engine/src/types/timestamp_utils.rs:22:37
|
|
|
|
|
22 | let nanos_u64 = if nanos >= 0 { nanos as u64 } else { 0 };
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_sign_loss
|
|
= note: `#[warn(clippy::cast_sign_loss)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/timestamp_utils.rs:22:37
|
|
|
|
|
22 | let nanos_u64 = if nanos >= 0 { nanos as u64 } else { 0 };
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/timestamp_utils.rs:26:13
|
|
|
|
|
26 | /// Convert HardwareTimestamp to DateTime<Utc>
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
26 - /// Convert HardwareTimestamp to DateTime<Utc>
|
|
26 + /// Convert `HardwareTimestamp` to DateTime<Utc>
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/timestamp_utils.rs:26:34
|
|
|
|
|
26 | /// Convert HardwareTimestamp to DateTime<Utc>
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
26 - /// Convert HardwareTimestamp to DateTime<Utc>
|
|
26 + /// Convert HardwareTimestamp to `DateTime`<Utc>
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/timestamp_utils.rs:28:5
|
|
|
|
|
28 | /// hardware_timestamp_to_datetime
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
28 - /// hardware_timestamp_to_datetime
|
|
28 + /// `hardware_timestamp_to_datetime`
|
|
|
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/types/timestamp_utils.rs:33:16
|
|
|
|
|
33 | let secs = nanos / 1_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
= note: requested on the command line with `-W clippy::integer-division`
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/timestamp_utils.rs:34:17
|
|
|
|
|
34 | let nsecs = (nanos % 1_000_000_000) as u32;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: casting `u64` to `i64` may wrap around the value
|
|
--> trading_engine/src/types/timestamp_utils.rs:35:23
|
|
|
|
|
35 | Utc.timestamp_opt(secs as i64, nsecs)
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/timestamp_utils.rs:35:23
|
|
|
|
|
35 | Utc.timestamp_opt(secs as i64, nsecs)
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/timestamp_utils.rs:40:13
|
|
|
|
|
40 | /// Convert DateTime<Utc> to HardwareTimestamp
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
40 - /// Convert DateTime<Utc> to HardwareTimestamp
|
|
40 + /// Convert `DateTime`<Utc> to HardwareTimestamp
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/timestamp_utils.rs:40:30
|
|
|
|
|
40 | /// Convert DateTime<Utc> to HardwareTimestamp
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
40 - /// Convert DateTime<Utc> to HardwareTimestamp
|
|
40 + /// Convert DateTime<Utc> to `HardwareTimestamp`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/timestamp_utils.rs:42:5
|
|
|
|
|
42 | /// datetime_to_hardware_timestamp
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
42 - /// datetime_to_hardware_timestamp
|
|
42 + /// `datetime_to_hardware_timestamp`
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/timestamp_utils.rs:48:9
|
|
|
|
|
48 | dt.timestamp() * 1_000_000_000 + i64::from(dt.timestamp_subsec_nanos())
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
= note: requested on the command line with `-W clippy::arithmetic-side-effects`
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/timestamp_utils.rs:53:13
|
|
|
|
|
53 | /// Convert DateTime<Utc> to i64 nanoseconds (for protobuf)
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
53 - /// Convert DateTime<Utc> to i64 nanoseconds (for protobuf)
|
|
53 + /// Convert `DateTime`<Utc> to i64 nanoseconds (for protobuf)
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/timestamp_utils.rs:55:5
|
|
|
|
|
55 | /// datetime_to_i64
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
55 - /// datetime_to_i64
|
|
55 + /// `datetime_to_i64`
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/timestamp_utils.rs:61:9
|
|
|
|
|
61 | dt.timestamp() * 1_000_000_000 + i64::from(dt.timestamp_subsec_nanos())
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/timestamp_utils.rs:65:32
|
|
|
|
|
65 | /// Convert i64 nanoseconds to DateTime<Utc> (from protobuf)
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
65 - /// Convert i64 nanoseconds to DateTime<Utc> (from protobuf)
|
|
65 + /// Convert i64 nanoseconds to `DateTime`<Utc> (from protobuf)
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/timestamp_utils.rs:67:5
|
|
|
|
|
67 | /// i64_to_datetime
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
67 - /// i64_to_datetime
|
|
67 + /// `i64_to_datetime`
|
|
|
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/types/timestamp_utils.rs:71:16
|
|
|
|
|
71 | let secs = nanos / 1_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: casting `i64` to `u32` may lose the sign of the value
|
|
--> trading_engine/src/types/timestamp_utils.rs:72:17
|
|
|
|
|
72 | let nsecs = (nanos % 1_000_000_000) as u32;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_sign_loss
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/timestamp_utils.rs:72:17
|
|
|
|
|
72 | let nsecs = (nanos % 1_000_000_000) as u32;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: you are using modulo operator on types that might have different signs
|
|
--> trading_engine/src/types/timestamp_utils.rs:72:17
|
|
|
|
|
72 | let nsecs = (nanos % 1_000_000_000) as u32;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: double check for expected result especially when interoperating with different languages
|
|
= note: or consider using `rem_euclid` or similar function
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#modulo_arithmetic
|
|
= note: requested on the command line with `-D clippy::modulo-arithmetic`
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/timestamp_utils.rs:78:25
|
|
|
|
|
78 | /// Get current time as HardwareTimestamp (canonical type)
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
78 - /// Get current time as HardwareTimestamp (canonical type)
|
|
78 + /// Get current time as `HardwareTimestamp` (canonical type)
|
|
|
|
|
|
|
warning: you have declared `#[inline(always)]` on `now`. This is usually a bad idea
|
|
--> trading_engine/src/types/timestamp_utils.rs:79:1
|
|
|
|
|
79 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/timestamp_utils.rs:91:5
|
|
|
|
|
91 | /// now_i64
|
|
| ^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
91 - /// now_i64
|
|
91 + /// `now_i64`
|
|
|
|
|
|
|
warning: you have declared `#[inline(always)]` on `now_i64`. This is usually a bad idea
|
|
--> trading_engine/src/types/timestamp_utils.rs:89:1
|
|
|
|
|
89 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/timestamp_utils.rs:98:25
|
|
|
|
|
98 | /// Get current time as DateTime<Utc>
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
98 - /// Get current time as DateTime<Utc>
|
|
98 + /// Get current time as `DateTime`<Utc>
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/timestamp_utils.rs:101:5
|
|
|
|
|
101 | /// now_datetime
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
101 - /// now_datetime
|
|
101 + /// `now_datetime`
|
|
|
|
|
|
|
warning: you have declared `#[inline(always)]` on `now_datetime`. This is usually a bad idea
|
|
--> trading_engine/src/types/timestamp_utils.rs:99:1
|
|
|
|
|
99 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:30:18
|
|
|
|
|
30 | /// Global no-op IntCounterVec for fallback use
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
30 - /// Global no-op IntCounterVec for fallback use
|
|
30 + /// Global no-op `IntCounterVec` for fallback use
|
|
|
|
|
|
|
error: `panic` should not be present in production code
|
|
--> trading_engine/src/types/metrics.rs:35:13
|
|
|
|
|
35 | panic!("CATASTROPHIC: Cannot create no-op metric counter: {e}. Prometheus library failure.")
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/types/mod.rs:17:5
|
|
|
|
|
17 | clippy::panic,
|
|
| ^^^^^^^^^^^^^
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:39:18
|
|
|
|
|
39 | /// Global no-op HistogramVec for fallback use
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
39 - /// Global no-op HistogramVec for fallback use
|
|
39 + /// Global no-op `HistogramVec` for fallback use
|
|
|
|
|
|
|
error: `panic` should not be present in production code
|
|
--> trading_engine/src/types/metrics.rs:44:13
|
|
|
|
|
44 | panic!("CATASTROPHIC: Cannot create no-op histogram: {e}. Prometheus library failure.")
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:48:18
|
|
|
|
|
48 | /// Global no-op GaugeVec for fallback use
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
48 - /// Global no-op GaugeVec for fallback use
|
|
48 + /// Global no-op `GaugeVec` for fallback use
|
|
|
|
|
|
|
error: `panic` should not be present in production code
|
|
--> trading_engine/src/types/metrics.rs:53:13
|
|
|
|
|
53 | panic!("CATASTROPHIC: Cannot create no-op gauge: {e}. Prometheus library failure.")
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:57:18
|
|
|
|
|
57 | /// Global no-op IntGaugeVec for fallback use
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
57 - /// Global no-op IntGaugeVec for fallback use
|
|
57 + /// Global no-op `IntGaugeVec` for fallback use
|
|
|
|
|
|
|
error: `panic` should not be present in production code
|
|
--> trading_engine/src/types/metrics.rs:62:13
|
|
|
|
|
62 | panic!("CATASTROPHIC: Cannot create no-op int gauge: {e}. Prometheus library failure.")
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:66:40
|
|
|
|
|
66 | /// Return a clone of the global no-op IntCounterVec
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
66 - /// Return a clone of the global no-op IntCounterVec
|
|
66 + /// Return a clone of the global no-op `IntCounterVec`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:74:40
|
|
|
|
|
74 | /// Return a clone of the global no-op HistogramVec
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
74 - /// Return a clone of the global no-op HistogramVec
|
|
74 + /// Return a clone of the global no-op `HistogramVec`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:82:40
|
|
|
|
|
82 | /// Return a clone of the global no-op GaugeVec
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
82 - /// Return a clone of the global no-op GaugeVec
|
|
82 + /// Return a clone of the global no-op `GaugeVec`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:90:40
|
|
|
|
|
90 | /// Return a clone of the global no-op IntGaugeVec
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
90 - /// Return a clone of the global no-op IntGaugeVec
|
|
90 + /// Return a clone of the global no-op `IntGaugeVec`
|
|
|
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/types/metrics.rs:112:9
|
|
|
|
|
112 | eprintln!("Failed to create metrics registry: {e}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
= note: requested on the command line with `-W clippy::print-stderr`
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:119:5
|
|
|
|
|
119 | /// TELEMETRY_ENABLED
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
119 - /// TELEMETRY_ENABLED
|
|
119 + /// `TELEMETRY_ENABLED`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:125:39
|
|
|
|
|
125 | /// Maintains separate histograms per venue/order_type combination for detailed
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
125 - /// Maintains separate histograms per venue/order_type combination for detailed
|
|
125 + /// Maintains separate histograms per `venue/order_type` combination for detailed
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:133:18
|
|
|
|
|
133 | /// Protected by RwLock for concurrent access from multiple trading threads.
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
133 - /// Protected by RwLock for concurrent access from multiple trading threads.
|
|
133 + /// Protected by `RwLock` for concurrent access from multiple trading threads.
|
|
|
|
|
|
|
warning: very complex type used. Consider factoring parts into `type` definitions
|
|
--> trading_engine/src/types/metrics.rs:134:31
|
|
|
|
|
134 | pub static ORDER_ACK_LATENCY: Lazy<Arc<RwLock<LruCache<String, hdrhistogram::Histogram<u64>>>>> =
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/types/mod.rs:26:5
|
|
|
|
|
26 | clippy::complexity,
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
= note: `#[warn(clippy::type_complexity)]` implied by `#[warn(clippy::complexity)]`
|
|
|
|
error: used `expect()` on an `Option` value
|
|
--> trading_engine/src/types/metrics.rs:137:27
|
|
|
|
|
137 | LruCache::new(NonZeroUsize::new(100).expect("Valid non-zero size"))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: if this value is `None`, it will panic
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_used
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/types/mod.rs:16:5
|
|
|
|
|
16 | clippy::expect_used,
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:149:24
|
|
|
|
|
149 | /// - **Legacy mode** (FOXHUNT_USE_OPTIMIZED_METRICS=false): [action, instrument, side, venue] = 500K+ series
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
149 - /// - **Legacy mode** (FOXHUNT_USE_OPTIMIZED_METRICS=false): [action, instrument, side, venue] = 500K+ series
|
|
149 + /// - **Legacy mode** (`FOXHUNT_USE_OPTIMIZED_METRICS=false)`: [action, instrument, side, venue] = 500K+ series
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:150:27
|
|
|
|
|
150 | /// - **Optimized mode** (FOXHUNT_USE_OPTIMIZED_METRICS=true): [action, asset_class, side, venue] = 5K series (99% reduction)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
150 - /// - **Optimized mode** (FOXHUNT_USE_OPTIMIZED_METRICS=true): [action, asset_class, side, venue] = 5K series (99% reduction)
|
|
150 + /// - **Optimized mode** (`FOXHUNT_USE_OPTIMIZED_METRICS=true)`: [action, asset_class, side, venue] = 5K series (99% reduction)
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:150:73
|
|
|
|
|
150 | /// - **Optimized mode** (FOXHUNT_USE_OPTIMIZED_METRICS=true): [action, asset_class, side, venue] = 5K series (99% reduction)
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
150 - /// - **Optimized mode** (FOXHUNT_USE_OPTIMIZED_METRICS=true): [action, asset_class, side, venue] = 5K series (99% reduction)
|
|
150 + /// - **Optimized mode** (FOXHUNT_USE_OPTIMIZED_METRICS=true): [action, `asset_class`, side, venue] = 5K series (99% reduction)
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:153:34
|
|
|
|
|
153 | /// Labels (Optimized): [action, asset_class, side, venue]
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
153 - /// Labels (Optimized): [action, asset_class, side, venue]
|
|
153 + /// Labels (Optimized): [action, `asset_class`, side, venue]
|
|
|
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/types/metrics.rs:163:9
|
|
|
|
|
163 | eprintln!("Failed to create trading counters: {e}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/types/metrics.rs:189:9
|
|
|
|
|
189 | eprintln!("Failed to create latency histograms: {e}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:204:14
|
|
|
|
|
204 | /// Labels: [data_type, service]
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
204 - /// Labels: [data_type, service]
|
|
204 + /// Labels: [`data_type`, service]
|
|
|
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/types/metrics.rs:211:9
|
|
|
|
|
211 | eprintln!("Failed to create throughput counters: {e}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:226:14
|
|
|
|
|
226 | /// Labels: [error_type, service, severity]
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
226 - /// Labels: [error_type, service, severity]
|
|
226 + /// Labels: [`error_type`, service, severity]
|
|
|
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/types/metrics.rs:233:9
|
|
|
|
|
233 | eprintln!("Failed to create error counters: {e}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:248:14
|
|
|
|
|
248 | /// Labels: [metric_type, currency, strategy]
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
248 - /// Labels: [metric_type, currency, strategy]
|
|
248 + /// Labels: [`metric_type`, currency, strategy]
|
|
|
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/types/metrics.rs:255:9
|
|
|
|
|
255 | eprintln!("Failed to create financial gauges: {e}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:270:14
|
|
|
|
|
270 | /// Labels: [pool_type, state, service]
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
270 - /// Labels: [pool_type, state, service]
|
|
270 + /// Labels: [`pool_type`, state, service]
|
|
|
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/types/metrics.rs:277:9
|
|
|
|
|
277 | eprintln!("Failed to create connection pool gauges: {e}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:326:23
|
|
|
|
|
326 | /// Labels: [service, order_type, venue]
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
326 - /// Labels: [service, order_type, venue]
|
|
326 + /// Labels: [service, `order_type`, venue]
|
|
|
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/types/metrics.rs:334:9
|
|
|
|
|
334 | eprintln!("Failed to create order latency histogram: {e}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:350:39
|
|
|
|
|
350 | /// - **Legacy mode**: [feed, symbol, data_type] = 150K+ series (unbounded symbols)
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
350 - /// - **Legacy mode**: [feed, symbol, data_type] = 150K+ series (unbounded symbols)
|
|
350 + /// - **Legacy mode**: [feed, symbol, `data_type`] = 150K+ series (unbounded symbols)
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:351:34
|
|
|
|
|
351 | /// - **Optimized mode**: [feed, asset_class, data_type] = ~150 series (99% reduction)
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
351 - /// - **Optimized mode**: [feed, asset_class, data_type] = ~150 series (99% reduction)
|
|
351 + /// - **Optimized mode**: [feed, `asset_class`, data_type] = ~150 series (99% reduction)
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:351:47
|
|
|
|
|
351 | /// - **Optimized mode**: [feed, asset_class, data_type] = ~150 series (99% reduction)
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
351 - /// - **Optimized mode**: [feed, asset_class, data_type] = ~150 series (99% reduction)
|
|
351 + /// - **Optimized mode**: [feed, asset_class, `data_type`] = ~150 series (99% reduction)
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:353:20
|
|
|
|
|
353 | /// Labels: [feed, asset_class, data_type]
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
353 - /// Labels: [feed, asset_class, data_type]
|
|
353 + /// Labels: [feed, `asset_class`, data_type]
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:353:33
|
|
|
|
|
353 | /// Labels: [feed, asset_class, data_type]
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
353 - /// Labels: [feed, asset_class, data_type]
|
|
353 + /// Labels: [feed, asset_class, `data_type`]
|
|
|
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/types/metrics.rs:361:9
|
|
|
|
|
361 | eprintln!("Failed to create market data throughput histogram: {e}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:376:24
|
|
|
|
|
376 | /// Labels: [strategy, asset_class, currency]
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
376 - /// Labels: [strategy, asset_class, currency]
|
|
376 + /// Labels: [strategy, `asset_class`, currency]
|
|
|
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/types/metrics.rs:383:9
|
|
|
|
|
383 | eprintln!("Failed to create active positions gauge: {e}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:398:23
|
|
|
|
|
398 | /// Labels: [service, memory_type]
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
398 - /// Labels: [service, memory_type]
|
|
398 + /// Labels: [service, `memory_type`]
|
|
|
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/types/metrics.rs:405:9
|
|
|
|
|
405 | eprintln!("Failed to create memory usage gauge: {e}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/types/metrics.rs:427:9
|
|
|
|
|
427 | eprintln!("Failed to create CPU usage gauge: {e}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/types/metrics.rs:453:9
|
|
|
|
|
453 | eprintln!("Failed to create GRPC request duration histogram: {e}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/types/metrics.rs:475:9
|
|
|
|
|
475 | eprintln!("Failed to create GRPC requests counter: {e}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/types/metrics.rs:500:9
|
|
|
|
|
500 | eprintln!("Failed to create DB connections gauge: {e}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/types/metrics.rs:526:9
|
|
|
|
|
526 | eprintln!("Failed to create DB query duration histogram: {e}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:541:23
|
|
|
|
|
541 | /// Labels: [service, breaker_name]
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
541 - /// Labels: [service, breaker_name]
|
|
541 + /// Labels: [service, `breaker_name`]
|
|
|
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/types/metrics.rs:551:9
|
|
|
|
|
551 | eprintln!("Failed to create circuit breaker state gauge: {e}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:569:14
|
|
|
|
|
569 | /// Labels: [limit_type, strategy, asset_class]
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
569 - /// Labels: [limit_type, strategy, asset_class]
|
|
569 + /// Labels: [`limit_type`, strategy, asset_class]
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:569:36
|
|
|
|
|
569 | /// Labels: [limit_type, strategy, asset_class]
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
569 - /// Labels: [limit_type, strategy, asset_class]
|
|
569 + /// Labels: [limit_type, strategy, `asset_class`]
|
|
|
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/types/metrics.rs:579:9
|
|
|
|
|
579 | eprintln!("Failed to create risk limit utilization gauge: {e}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:590:5
|
|
|
|
|
590 | /// LatencyTimer
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
590 - /// LatencyTimer
|
|
590 + /// `LatencyTimer`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:646:60
|
|
|
|
|
646 | /// * `venue` - Trading venue identifier (e.g., "nasdaq", "interactive_brokers")
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
646 - /// * `venue` - Trading venue identifier (e.g., "nasdaq", "interactive_brokers")
|
|
646 + /// * `venue` - Trading venue identifier (e.g., "nasdaq", "`interactive_brokers`")
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/types/metrics.rs:685:18
|
|
|
|
|
685 | .observe(latency_micros as f64 / 1_000_000.0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
= note: requested on the command line with `-W clippy::float-arithmetic`
|
|
|
|
warning: casting `u64` to `f64` causes a loss of precision (`u64` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
|
|
--> trading_engine/src/types/metrics.rs:685:18
|
|
|
|
|
685 | .observe(latency_micros as f64 / 1_000_000.0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
|
|
= note: `#[warn(clippy::cast_precision_loss)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/metrics.rs:685:18
|
|
|
|
|
685 | .observe(latency_micros as f64 / 1_000_000.0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/types/metrics.rs:709:18
|
|
|
|
|
709 | .observe(processing_time_nanos as f64 / 1_000_000_000.0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: casting `u64` to `f64` causes a loss of precision (`u64` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
|
|
--> trading_engine/src/types/metrics.rs:709:18
|
|
|
|
|
709 | .observe(processing_time_nanos as f64 / 1_000_000_000.0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/metrics.rs:709:18
|
|
|
|
|
709 | .observe(processing_time_nanos as f64 / 1_000_000_000.0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/types/metrics.rs:808:1
|
|
|
|
|
808 | pub fn init_telemetry() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
= note: `#[warn(clippy::missing_errors_doc)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:818:60
|
|
|
|
|
818 | /// percentile analysis. Maintains separate histograms per venue/order_type
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
818 - /// percentile analysis. Maintains separate histograms per venue/order_type
|
|
818 + /// percentile analysis. Maintains separate histograms per `venue/order_type`
|
|
|
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/types/metrics.rs:838:39
|
|
|
|
|
838 | let latency_us_existing = latency_ns / 1000;
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/types/metrics.rs:881:34
|
|
|
|
|
881 | let latency_us_new = latency_ns / 1000;
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/types/metrics.rs:891:18
|
|
|
|
|
891 | .observe(latency_ns as f64 / 1_000_000_000.0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: casting `u64` to `f64` causes a loss of precision (`u64` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
|
|
--> trading_engine/src/types/metrics.rs:891:18
|
|
|
|
|
891 | .observe(latency_ns as f64 / 1_000_000_000.0);
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/metrics.rs:891:18
|
|
|
|
|
891 | .observe(latency_ns as f64 / 1_000_000_000.0);
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:905:42
|
|
|
|
|
905 | /// * `None` - No data recorded for this venue/order_type combination
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
905 - /// * `None` - No data recorded for this venue/order_type combination
|
|
905 + /// * `None` - No data recorded for this `venue/order_type` combination
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:933:5
|
|
|
|
|
933 | /// LatencyPercentiles
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
933 - /// LatencyPercentiles
|
|
933 + /// `LatencyPercentiles`
|
|
|
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/types/metrics.rs:999:25
|
|
|
|
|
999 | let venue = parts[0];
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/types/mod.rs:20:5
|
|
|
|
|
20 | clippy::indexing_slicing
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: slicing may panic
|
|
--> trading_engine/src/types/metrics.rs:1000:30
|
|
|
|
|
1000 | let order_type = parts[1..].join("_");
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n..)` or .get_mut(n..)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: casting `u64` to `f64` causes a loss of precision (`u64` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
|
|
--> trading_engine/src/types/metrics.rs:1008:31
|
|
|
|
|
1008 | p50_gauge.set(histogram.value_at_percentile(50.0) as f64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/metrics.rs:1008:31
|
|
|
|
|
1008 | p50_gauge.set(histogram.value_at_percentile(50.0) as f64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: casting `u64` to `f64` causes a loss of precision (`u64` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
|
|
--> trading_engine/src/types/metrics.rs:1015:31
|
|
|
|
|
1015 | p95_gauge.set(histogram.value_at_percentile(95.0) as f64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/metrics.rs:1015:31
|
|
|
|
|
1015 | p95_gauge.set(histogram.value_at_percentile(95.0) as f64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: casting `u64` to `f64` causes a loss of precision (`u64` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
|
|
--> trading_engine/src/types/metrics.rs:1022:31
|
|
|
|
|
1022 | p99_gauge.set(histogram.value_at_percentile(99.0) as f64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/metrics.rs:1022:31
|
|
|
|
|
1022 | p99_gauge.set(histogram.value_at_percentile(99.0) as f64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:1066:5
|
|
|
|
|
1066 | /// ParquetMarketDataEvent
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1066 - /// ParquetMarketDataEvent
|
|
1066 + /// `ParquetMarketDataEvent`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/metrics.rs:1124:5
|
|
|
|
|
1124 | /// MarketDataEventType
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1124 - /// MarketDataEventType
|
|
1124 + /// `MarketDataEventType`
|
|
|
|
|
|
|
warning: temporary with significant `Drop` can be early dropped
|
|
--> trading_engine/src/types/metrics.rs:1184:13
|
|
|
|
|
1183 | pub fn record_market_data_event(event: ParquetMarketDataEvent) {
|
|
| ________________________________________________________________-
|
|
1184 | | let mut buffer = MARKET_DATA_BUFFER.write();
|
|
| | ^^^^^^
|
|
1185 | | buffer.push(event);
|
|
... |
|
|
1192 | | }
|
|
| |_- temporary `buffer` is currently being dropped at the end of its contained scope
|
|
|
|
|
= note: this might lead to unnecessary resource contention
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#significant_drop_tightening
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/types/mod.rs:24:5
|
|
|
|
|
24 | clippy::nursery,
|
|
| ^^^^^^^^^^^^^^^
|
|
= note: `#[warn(clippy::significant_drop_tightening)]` implied by `#[warn(clippy::nursery)]`
|
|
help: drop the temporary after the end of its last usage
|
|
--> /home/jgrusewski/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.41/src/macros.rs:2961:127
|
|
|
|
|
2961 ~ $crate::valueset!(@ { (&$next, $crate::__macro_support::Option::Some(&$crate::__macro_support::format_args!($($rest)+)
|
|
2962 ~ drop(buffer); as &dyn Value)), $($out),* }, $next, )
|
|
|
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/types/metrics.rs:1210:1
|
|
|
|
|
1210 | pub fn initialize_metrics() -> PrometheusResult<()> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/type_registry.rs:18:12
|
|
|
|
|
18 | /// Usage: type_compliance_check!(Price, Quantity, Symbol);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
18 - /// Usage: type_compliance_check!(Price, Quantity, Symbol);
|
|
18 + /// Usage: `type_compliance_check!(Price`, Quantity, Symbol);
|
|
|
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/types/type_registry.rs:42:5
|
|
|
|
|
42 | fn validate_canonical_usage() -> Result<(), TypeViolation> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/type_registry.rs:55:5
|
|
|
|
|
55 | /// TypeViolation
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
55 - /// TypeViolation
|
|
55 + /// `TypeViolation`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/type_registry.rs:86:5
|
|
|
|
|
86 | /// ViolationType
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
86 - /// ViolationType
|
|
86 + /// `ViolationType`
|
|
|
|
|
|
|
warning: you are deriving `PartialEq` and can implement `Eq`
|
|
--> trading_engine/src/types/type_registry.rs:85:24
|
|
|
|
|
85 | #[derive(Debug, Clone, PartialEq)]
|
|
| ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq
|
|
= note: `#[warn(clippy::derive_partial_eq_without_eq)]` implied by `#[warn(clippy::nursery)]`
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/type_registry.rs:111:13
|
|
|
|
|
111 | ViolationType::DuplicateDefinition => write!(f, "DUPLICATE_DEFINITION"),
|
|
| ^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
= note: `#[warn(clippy::use_self)]` implied by `#[warn(clippy::nursery)]`
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/type_registry.rs:112:13
|
|
|
|
|
112 | ViolationType::NonCanonicalImport => write!(f, "NON_CANONICAL_IMPORT"),
|
|
| ^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/type_registry.rs:113:13
|
|
|
|
|
113 | ViolationType::MissingCanonicalTrait => write!(f, "MISSING_CANONICAL_TRAIT"),
|
|
| ^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/type_registry.rs:160:5
|
|
|
|
|
160 | /// TypeRegistry
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
160 - /// TypeRegistry
|
|
160 + /// `TypeRegistry`
|
|
|
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading_engine/src/types/type_registry.rs:169:5
|
|
|
|
|
169 | pub fn new() -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn new() -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
= note: `#[warn(clippy::must_use_candidate)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: calling `to_string` on `&&str`
|
|
--> trading_engine/src/types/type_registry.rs:204:25
|
|
|
|
|
204 | .insert(type_name.to_string(), canonical_path.to_string());
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*type_name).to_string()`
|
|
|
|
|
= help: `&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString`
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inefficient_to_string
|
|
= note: `#[warn(clippy::inefficient_to_string)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: calling `to_string` on `&&str`
|
|
--> trading_engine/src/types/type_registry.rs:204:48
|
|
|
|
|
204 | .insert(type_name.to_string(), canonical_path.to_string());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*canonical_path).to_string()`
|
|
|
|
|
= help: `&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString`
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inefficient_to_string
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/types/type_registry.rs:209:5
|
|
|
|
|
209 | / pub fn validate_type_usage(
|
|
210 | | &self,
|
|
211 | | type_name: &str,
|
|
212 | | usage_path: &str,
|
|
213 | | ) -> Result<(), TypeViolation> {
|
|
| |__________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/types/type_registry.rs:217:32
|
|
|
|
|
217 | type_name: type_name.to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `type_name.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
= note: requested on the command line with `-D clippy::str-to-string`
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/types/type_registry.rs:220:37
|
|
|
|
|
220 | violating_path: usage_path.to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `usage_path.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading_engine/src/types/type_registry.rs:228:5
|
|
|
|
|
228 | pub fn get_canonical_path(&self, type_name: &str) -> Option<&str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn get_canonical_path(&self, type_name: &str) -> Option<&str>`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: redundant closure
|
|
--> trading_engine/src/types/type_registry.rs:229:50
|
|
|
|
|
229 | self.registered_types.get(type_name).map(|s| s.as_str())
|
|
| ^^^^^^^^^^^^^^ help: replace the closure with the method itself: `std::string::String::as_str`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
|
|
= note: `#[warn(clippy::redundant_closure_for_method_calls)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading_engine/src/types/type_registry.rs:233:5
|
|
|
|
|
233 | pub fn list_canonical_types(&self) -> Vec<(&str, &str)> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn list_canonical_types(&self) -> Vec<(&str, &str)>`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/types/type_registry.rs:256:1
|
|
|
|
|
256 | pub fn validate_type_compliance() -> Result<(), Vec<TypeViolation>> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/types/type_registry.rs:264:24
|
|
|
|
|
264 | type_name: "TypeRegistry".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"TypeRegistry".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/types/type_registry.rs:266:29
|
|
|
|
|
266 | canonical_path: "types::type_registry::TypeRegistry".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"types::type_registry::TypeRegistry".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/types/type_registry.rs:267:29
|
|
|
|
|
267 | violating_path: "unknown".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"unknown".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/errors.rs:24:5
|
|
|
|
|
24 | /// ConversionError
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
24 - /// ConversionError
|
|
24 + /// `ConversionError`
|
|
|
|
|
|
|
warning: you are deriving `PartialEq` and can implement `Eq`
|
|
--> trading_engine/src/types/errors.rs:23:31
|
|
|
|
|
23 | #[derive(Error, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
|
| ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq
|
|
|
|
warning: you are deriving `PartialEq` and can implement `Eq`
|
|
--> trading_engine/src/types/errors.rs:71:31
|
|
|
|
|
71 | #[derive(Error, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
|
| ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/errors.rs:92:5
|
|
|
|
|
92 | /// SymbolError
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
92 - /// SymbolError
|
|
92 + /// `SymbolError`
|
|
|
|
|
|
|
warning: you are deriving `PartialEq` and can implement `Eq`
|
|
--> trading_engine/src/types/errors.rs:91:31
|
|
|
|
|
91 | #[derive(Error, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
|
| ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/errors.rs:123:5
|
|
|
|
|
123 | /// FoxhuntError
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
123 - /// FoxhuntError
|
|
123 + /// `FoxhuntError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/errors.rs:609:5
|
|
|
|
|
609 | /// ErrorSeverity
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
609 - /// ErrorSeverity
|
|
609 + /// `ErrorSeverity`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/errors.rs:639:5
|
|
|
|
|
639 | /// RecoveryStrategy
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
639 - /// RecoveryStrategy
|
|
639 + /// `RecoveryStrategy`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/errors.rs:919:5
|
|
|
|
|
919 | /// ErrorContext
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
919 - /// ErrorContext
|
|
919 + /// `ErrorContext`
|
|
|
|
|
|
|
warning: these match arms have identical bodies
|
|
--> trading_engine/src/types/events.rs:210:13
|
|
|
|
|
210 | Self::Quote { symbol, .. } => Some(symbol),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
211 | Self::Trade { symbol, .. } => Some(symbol),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
212 | Self::OrderBook { symbol, .. } => Some(symbol),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
213 | Self::OrderBookUpdate { symbol, .. } => Some(symbol),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
214 | Self::Bar { symbol, .. } => Some(symbol),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: if this is unintentional make the arms return different values
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/types/events.rs:22:9
|
|
|
|
|
22 | #![warn(clippy::pedantic, clippy::nursery, clippy::perf)]
|
|
| ^^^^^^^^^^^^^^^^
|
|
= note: `#[warn(clippy::match_same_arms)]` implied by `#[warn(clippy::pedantic)]`
|
|
help: otherwise merge the patterns into a single arm
|
|
|
|
|
210 - Self::Quote { symbol, .. } => Some(symbol),
|
|
211 - Self::Trade { symbol, .. } => Some(symbol),
|
|
210 + Self::Quote { symbol, .. } | Self::Trade { symbol, .. } | Self::OrderBook { symbol, .. } | Self::OrderBookUpdate { symbol, .. } | Self::Bar { symbol, .. } => Some(symbol),
|
|
|
|
|
|
|
warning: these match arms have identical bodies
|
|
--> trading_engine/src/types/events.rs:215:13
|
|
|
|
|
215 | Self::Sentiment { .. } => None,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
216 | Self::Control { .. } => None,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: if this is unintentional make the arms return different values
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
|
|
help: otherwise merge the patterns into a single arm
|
|
|
|
|
215 ~ Self::Sentiment { .. } | Self::Control { .. } => None,
|
|
216 ~ }
|
|
|
|
|
|
|
warning: these match arms have identical bodies
|
|
--> trading_engine/src/types/events.rs:224:13
|
|
|
|
|
224 | Self::Quote { timestamp, .. } => *timestamp,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
225 | Self::Trade { timestamp, .. } => *timestamp,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
226 | Self::OrderBook { timestamp, .. } => *timestamp,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
227 | Self::OrderBookUpdate { timestamp, .. } => *timestamp,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
228 | Self::Bar { timestamp, .. } => *timestamp,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
229 | Self::Sentiment { timestamp, .. } => *timestamp,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
230 | Self::Control { timestamp, .. } => *timestamp,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: if this is unintentional make the arms return different values
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
|
|
help: otherwise merge the patterns into a single arm
|
|
|
|
|
224 - Self::Quote { timestamp, .. } => *timestamp,
|
|
225 - Self::Trade { timestamp, .. } => *timestamp,
|
|
224 + Self::Quote { timestamp, .. } | Self::Trade { timestamp, .. } | Self::OrderBook { timestamp, .. } | Self::OrderBookUpdate { timestamp, .. } | Self::Bar { timestamp, .. } | Self::Sentiment { timestamp, .. } | Self::Control { timestamp, .. } => *timestamp,
|
|
|
|
|
|
|
warning: these match arms have identical bodies
|
|
--> trading_engine/src/types/events.rs:244:13
|
|
|
|
|
244 | Self::Quote { venue, .. } => venue.as_deref(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
245 | Self::Trade { venue, .. } => venue.as_deref(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
246 | Self::OrderBook { venue, .. } => venue.as_deref(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
247 | Self::OrderBookUpdate { venue, .. } => venue.as_deref(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
248 | Self::Bar { venue, .. } => venue.as_deref(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: if this is unintentional make the arms return different values
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
|
|
help: otherwise merge the patterns into a single arm
|
|
|
|
|
244 - Self::Quote { venue, .. } => venue.as_deref(),
|
|
245 - Self::Trade { venue, .. } => venue.as_deref(),
|
|
244 + Self::Quote { venue, .. } | Self::Trade { venue, .. } | Self::OrderBook { venue, .. } | Self::OrderBookUpdate { venue, .. } | Self::Bar { venue, .. } => venue.as_deref(),
|
|
|
|
|
|
|
warning: these match arms have identical bodies
|
|
--> trading_engine/src/types/events.rs:249:13
|
|
|
|
|
249 | Self::Sentiment { .. } => None,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
250 | Self::Control { .. } => None,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: if this is unintentional make the arms return different values
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
|
|
help: otherwise merge the patterns into a single arm
|
|
|
|
|
249 ~ Self::Sentiment { .. } | Self::Control { .. } => None,
|
|
250 ~ }
|
|
|
|
|
|
|
warning: these match arms have identical bodies
|
|
--> trading_engine/src/types/events.rs:756:17
|
|
|
|
|
756 | MarketEvent::Quote { symbol: s, .. } => s == symbol,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
757 | MarketEvent::Trade { symbol: s, .. } => s == symbol,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
758 | MarketEvent::OrderBook { symbol: s, .. } => s == symbol,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
759 | MarketEvent::OrderBookUpdate { symbol: s, .. } => s == symbol,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
760 | MarketEvent::Bar { symbol: s, .. } => s == symbol,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: if this is unintentional make the arms return different values
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
|
|
help: otherwise merge the patterns into a single arm
|
|
|
|
|
756 - MarketEvent::Quote { symbol: s, .. } => s == symbol,
|
|
757 - MarketEvent::Trade { symbol: s, .. } => s == symbol,
|
|
756 + MarketEvent::Quote { symbol: s, .. } | MarketEvent::Trade { symbol: s, .. } | MarketEvent::OrderBook { symbol: s, .. } | MarketEvent::OrderBookUpdate { symbol: s, .. } | MarketEvent::Bar { symbol: s, .. } => s == symbol,
|
|
|
|
|
|
|
warning: these match arms have identical bodies
|
|
--> trading_engine/src/types/events.rs:775:17
|
|
|
|
|
775 | PositionEvent::PositionOpened { symbol: s, .. } => s == symbol,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
776 | PositionEvent::PositionUpdated { symbol: s, .. } => s == symbol,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
777 | PositionEvent::PositionClosed { symbol: s, .. } => s == symbol,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
778 | PositionEvent::PositionReconciled { symbol: s, .. } => s == symbol,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: if this is unintentional make the arms return different values
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
|
|
help: otherwise merge the patterns into a single arm
|
|
|
|
|
775 - PositionEvent::PositionOpened { symbol: s, .. } => s == symbol,
|
|
776 - PositionEvent::PositionUpdated { symbol: s, .. } => s == symbol,
|
|
775 + PositionEvent::PositionOpened { symbol: s, .. } | PositionEvent::PositionUpdated { symbol: s, .. } | PositionEvent::PositionClosed { symbol: s, .. } | PositionEvent::PositionReconciled { symbol: s, .. } => s == symbol,
|
|
|
|
|
|
|
warning: match expression looks like `matches!` macro
|
|
--> trading_engine/src/types/events.rs:786:9
|
|
|
|
|
786 | / match (event, event_type) {
|
|
787 | | (Event::Market(_), EventType::Market) => true,
|
|
788 | | (Event::Order(_), EventType::Order) => true,
|
|
789 | | (Event::Fill(_), EventType::Fill) => true,
|
|
... |
|
|
793 | | _ => false,
|
|
794 | | }
|
|
| |_________^ help: try: `matches!((event, event_type), (Event::Market(_), EventType::Market) | (Event::Order(_), EventType::Order) | (Event::Fill(_), EventType::Fill) | (Event::System(_), EventType::System) | (Event::Risk(_), EventType::Risk) | (Event::Position(_), EventType::Position))`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/types/mod.rs:27:5
|
|
|
|
|
27 | clippy::style,
|
|
| ^^^^^^^^^^^^^
|
|
= note: `#[warn(clippy::match_like_matches_macro)]` implied by `#[warn(clippy::style)]`
|
|
|
|
warning: these match arms have identical bodies
|
|
--> trading_engine/src/types/events.rs:825:17
|
|
|
|
|
825 | MarketEvent::Quote { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
826 | MarketEvent::Trade { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
827 | MarketEvent::OrderBook { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
828 | MarketEvent::OrderBookUpdate { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
829 | MarketEvent::Bar { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
830 | MarketEvent::Control { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
831 | MarketEvent::Sentiment { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: if this is unintentional make the arms return different values
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
|
|
help: otherwise merge the patterns into a single arm
|
|
|
|
|
825 - MarketEvent::Quote { timestamp, .. } => Some(*timestamp),
|
|
826 - MarketEvent::Trade { timestamp, .. } => Some(*timestamp),
|
|
825 + MarketEvent::Quote { timestamp, .. } | MarketEvent::Trade { timestamp, .. } | MarketEvent::OrderBook { timestamp, .. } | MarketEvent::OrderBookUpdate { timestamp, .. } | MarketEvent::Bar { timestamp, .. } | MarketEvent::Control { timestamp, .. } | MarketEvent::Sentiment { timestamp, .. } => Some(*timestamp),
|
|
|
|
|
|
|
warning: these match arms have identical bodies
|
|
--> trading_engine/src/types/events.rs:836:17
|
|
|
|
|
836 | SystemEvent::Heartbeat { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
837 | SystemEvent::Progress { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
838 | SystemEvent::Error { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
839 | SystemEvent::ServiceStarted { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
840 | SystemEvent::ServiceStopped { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: if this is unintentional make the arms return different values
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
|
|
help: otherwise merge the patterns into a single arm
|
|
|
|
|
836 - SystemEvent::Heartbeat { timestamp, .. } => Some(*timestamp),
|
|
837 - SystemEvent::Progress { timestamp, .. } => Some(*timestamp),
|
|
836 + SystemEvent::Heartbeat { timestamp, .. } | SystemEvent::Progress { timestamp, .. } | SystemEvent::Error { timestamp, .. } | SystemEvent::ServiceStarted { timestamp, .. } | SystemEvent::ServiceStopped { timestamp, .. } => Some(*timestamp),
|
|
|
|
|
|
|
warning: these match arms have identical bodies
|
|
--> trading_engine/src/types/events.rs:843:17
|
|
|
|
|
843 | RiskEvent::PositionLimitBreach { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
844 | RiskEvent::DrawdownAlert { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
845 | RiskEvent::ExposureLimitBreach { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
846 | RiskEvent::MarginCall { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: if this is unintentional make the arms return different values
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
|
|
help: otherwise merge the patterns into a single arm
|
|
|
|
|
843 - RiskEvent::PositionLimitBreach { timestamp, .. } => Some(*timestamp),
|
|
844 - RiskEvent::DrawdownAlert { timestamp, .. } => Some(*timestamp),
|
|
843 + RiskEvent::PositionLimitBreach { timestamp, .. } | RiskEvent::DrawdownAlert { timestamp, .. } | RiskEvent::ExposureLimitBreach { timestamp, .. } | RiskEvent::MarginCall { timestamp, .. } => Some(*timestamp),
|
|
|
|
|
|
|
warning: these match arms have identical bodies
|
|
--> trading_engine/src/types/events.rs:849:17
|
|
|
|
|
849 | PositionEvent::PositionOpened { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
850 | PositionEvent::PositionUpdated { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
851 | PositionEvent::PositionClosed { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
852 | PositionEvent::PositionReconciled { timestamp, .. } => Some(*timestamp),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: if this is unintentional make the arms return different values
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
|
|
help: otherwise merge the patterns into a single arm
|
|
|
|
|
849 - PositionEvent::PositionOpened { timestamp, .. } => Some(*timestamp),
|
|
850 - PositionEvent::PositionUpdated { timestamp, .. } => Some(*timestamp),
|
|
849 + PositionEvent::PositionOpened { timestamp, .. } | PositionEvent::PositionUpdated { timestamp, .. } | PositionEvent::PositionClosed { timestamp, .. } | PositionEvent::PositionReconciled { timestamp, .. } => Some(*timestamp),
|
|
|
|
|
|
|
warning: these match arms have identical bodies
|
|
--> trading_engine/src/types/events.rs:862:17
|
|
|
|
|
862 | MarketEvent::Quote { symbol, .. } => Some(symbol),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
863 | MarketEvent::Trade { symbol, .. } => Some(symbol),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
864 | MarketEvent::OrderBook { symbol, .. } => Some(symbol),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
865 | MarketEvent::OrderBookUpdate { symbol, .. } => Some(symbol),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
866 | MarketEvent::Bar { symbol, .. } => Some(symbol),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: if this is unintentional make the arms return different values
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
|
|
help: otherwise merge the patterns into a single arm
|
|
|
|
|
862 - MarketEvent::Quote { symbol, .. } => Some(symbol),
|
|
863 - MarketEvent::Trade { symbol, .. } => Some(symbol),
|
|
862 + MarketEvent::Quote { symbol, .. } | MarketEvent::Trade { symbol, .. } | MarketEvent::OrderBook { symbol, .. } | MarketEvent::OrderBookUpdate { symbol, .. } | MarketEvent::Bar { symbol, .. } => Some(symbol),
|
|
|
|
|
|
|
warning: these match arms have identical bodies
|
|
--> trading_engine/src/types/events.rs:867:17
|
|
|
|
|
867 | MarketEvent::Control { .. } => None, // Control events don't have specific symbols
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
868 | MarketEvent::Sentiment { .. } => None, // Multiple symbols possible
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: if this is unintentional make the arms return different values
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
|
|
help: otherwise merge the patterns into a single arm
|
|
|
|
|
867 ~ MarketEvent::Control { .. } | MarketEvent::Sentiment { .. } => None, // Control events don't have specific symbols
|
|
868 ~ // Multiple symbols possible
|
|
|
|
|
|
|
warning: these match arms have identical bodies
|
|
--> trading_engine/src/types/events.rs:879:17
|
|
|
|
|
879 | PositionEvent::PositionOpened { symbol, .. } => Some(symbol),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
880 | PositionEvent::PositionUpdated { symbol, .. } => Some(symbol),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
881 | PositionEvent::PositionClosed { symbol, .. } => Some(symbol),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
882 | PositionEvent::PositionReconciled { symbol, .. } => Some(symbol),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: if this is unintentional make the arms return different values
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
|
|
help: otherwise merge the patterns into a single arm
|
|
|
|
|
879 - PositionEvent::PositionOpened { symbol, .. } => Some(symbol),
|
|
880 - PositionEvent::PositionUpdated { symbol, .. } => Some(symbol),
|
|
879 + PositionEvent::PositionOpened { symbol, .. } | PositionEvent::PositionUpdated { symbol, .. } | PositionEvent::PositionClosed { symbol, .. } | PositionEvent::PositionReconciled { symbol, .. } => Some(symbol),
|
|
|
|
|
|
|
warning: this function has too many arguments (9/8)
|
|
--> trading_engine/src/types/events.rs:1033:5
|
|
|
|
|
1033 | / pub const fn fill(
|
|
1034 | | fill_id: String,
|
|
1035 | | order_id: OrderId,
|
|
1036 | | symbol: Symbol,
|
|
... |
|
|
1042 | | slippage_bps: Decimal,
|
|
1043 | | ) -> Event {
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
|
|
= note: `#[warn(clippy::too_many_arguments)]` implied by `#[warn(clippy::complexity)]`
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/financial.rs:83:14
|
|
|
|
|
83 | Self((value * PRICE_SCALE as f64) as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/types/financial.rs:83:14
|
|
|
|
|
83 | Self((value * PRICE_SCALE as f64) as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/financial.rs:83:23
|
|
|
|
|
83 | Self((value * PRICE_SCALE as f64) as i64)
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/types/financial.rs:90:9
|
|
|
|
|
90 | self.0 as f64 / PRICE_SCALE as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/financial.rs:90:9
|
|
|
|
|
90 | self.0 as f64 / PRICE_SCALE as f64
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/financial.rs:90:25
|
|
|
|
|
90 | self.0 as f64 / PRICE_SCALE as f64
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/types/financial.rs:104:9
|
|
|
|
|
104 | self.0 as f32 / PRICE_SCALE as f32
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/financial.rs:104:9
|
|
|
|
|
104 | self.0 as f32 / PRICE_SCALE as f32
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/financial.rs:104:25
|
|
|
|
|
104 | self.0 as f32 / PRICE_SCALE as f32
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/financial.rs:117:24
|
|
|
|
|
117 | let sqrt_val = ((self.0 as f64 / PRICE_SCALE as f64).sqrt() * PRICE_SCALE as f64) as i64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/types/financial.rs:117:24
|
|
|
|
|
117 | let sqrt_val = ((self.0 as f64 / PRICE_SCALE as f64).sqrt() * PRICE_SCALE as f64) as i64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/financial.rs:117:26
|
|
|
|
|
117 | let sqrt_val = ((self.0 as f64 / PRICE_SCALE as f64).sqrt() * PRICE_SCALE as f64) as i64;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/financial.rs:117:42
|
|
|
|
|
117 | let sqrt_val = ((self.0 as f64 / PRICE_SCALE as f64).sqrt() * PRICE_SCALE as f64) as i64;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/financial.rs:117:71
|
|
|
|
|
117 | let sqrt_val = ((self.0 as f64 / PRICE_SCALE as f64).sqrt() * PRICE_SCALE as f64) as i64;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/financial.rs:141:16
|
|
|
|
|
141 | /// Create IntegerPrice from Decimal
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
141 - /// Create IntegerPrice from Decimal
|
|
141 + /// Create `IntegerPrice` from Decimal
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:145:22
|
|
|
|
|
145 | let scaled = decimal * Decimal::new(PRICE_SCALE, 0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:184:40
|
|
|
|
|
184 | Self(self.0.saturating_div(rhs))
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:193:9
|
|
|
|
|
193 | self.to_decimal() + rhs
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:200:9
|
|
|
|
|
200 | self.to_decimal() - rhs
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:207:9
|
|
|
|
|
207 | self.to_decimal() * rhs
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:217:13
|
|
|
|
|
217 | self.to_decimal() / rhs
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/financial.rs:256:14
|
|
|
|
|
256 | Self((value * QUANTITY_SCALE as f64) as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/types/financial.rs:256:14
|
|
|
|
|
256 | Self((value * QUANTITY_SCALE as f64) as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/financial.rs:256:23
|
|
|
|
|
256 | Self((value * QUANTITY_SCALE as f64) as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/types/financial.rs:263:9
|
|
|
|
|
263 | self.0 as f64 / QUANTITY_SCALE as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/financial.rs:263:9
|
|
|
|
|
263 | self.0 as f64 / QUANTITY_SCALE as f64
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/financial.rs:263:25
|
|
|
|
|
263 | self.0 as f64 / QUANTITY_SCALE as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/financial.rs:291:16
|
|
|
|
|
291 | /// Create IntegerQuantity from Decimal
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
291 - /// Create IntegerQuantity from Decimal
|
|
291 + /// Create `IntegerQuantity` from Decimal
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:295:22
|
|
|
|
|
295 | let scaled = decimal * Decimal::new(QUANTITY_SCALE, 0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:328:40
|
|
|
|
|
328 | Self(self.0.saturating_div(rhs))
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:337:9
|
|
|
|
|
337 | self.to_decimal() + rhs
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:344:9
|
|
|
|
|
344 | self.to_decimal() - rhs
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:351:9
|
|
|
|
|
351 | self.to_decimal() * rhs
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:361:13
|
|
|
|
|
361 | self.to_decimal() / rhs
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/types/financial.rs:381:23
|
|
|
|
|
381 | let dollars = self.0 / 100;
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
error: you are using modulo operator on types that might have different signs
|
|
--> trading_engine/src/types/financial.rs:382:21
|
|
|
|
|
382 | let cents = self.0 % 100;
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= note: double check for expected result especially when interoperating with different languages
|
|
= note: or consider using `rem_euclid` or similar function
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#modulo_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/financial.rs:419:14
|
|
|
|
|
419 | Self((value * MONEY_SCALE as f64) as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/types/financial.rs:419:14
|
|
|
|
|
419 | Self((value * MONEY_SCALE as f64) as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/financial.rs:419:23
|
|
|
|
|
419 | Self((value * MONEY_SCALE as f64) as i64)
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/types/financial.rs:426:9
|
|
|
|
|
426 | self.0 as f64 / MONEY_SCALE as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/financial.rs:426:9
|
|
|
|
|
426 | self.0 as f64 / MONEY_SCALE as f64
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/types/financial.rs:426:25
|
|
|
|
|
426 | self.0 as f64 / MONEY_SCALE as f64
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:481:40
|
|
|
|
|
481 | Self(self.0.saturating_div(rhs))
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:488:19
|
|
|
|
|
488 | type Output = Decimal;
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:489:40
|
|
|
|
|
489 | fn add(self, rhs: IntegerPrice) -> Decimal {
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:490:9
|
|
|
|
|
490 | self + rhs.to_decimal()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:495:19
|
|
|
|
|
495 | type Output = Decimal;
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:496:40
|
|
|
|
|
496 | fn sub(self, rhs: IntegerPrice) -> Decimal {
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:497:9
|
|
|
|
|
497 | self - rhs.to_decimal()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:502:19
|
|
|
|
|
502 | type Output = Decimal;
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:503:40
|
|
|
|
|
503 | fn mul(self, rhs: IntegerPrice) -> Decimal {
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:504:9
|
|
|
|
|
504 | self * rhs.to_decimal()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:509:19
|
|
|
|
|
509 | type Output = Decimal;
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:510:40
|
|
|
|
|
510 | fn div(self, rhs: IntegerPrice) -> Decimal {
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:511:32
|
|
|
|
|
511 | if rhs.to_decimal() == Decimal::ZERO {
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:512:13
|
|
|
|
|
512 | Decimal::ZERO
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:514:13
|
|
|
|
|
514 | self / rhs.to_decimal()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:520:19
|
|
|
|
|
520 | type Output = Decimal;
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:521:43
|
|
|
|
|
521 | fn add(self, rhs: IntegerQuantity) -> Decimal {
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:522:9
|
|
|
|
|
522 | self + rhs.to_decimal()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:527:19
|
|
|
|
|
527 | type Output = Decimal;
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:528:43
|
|
|
|
|
528 | fn sub(self, rhs: IntegerQuantity) -> Decimal {
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:529:9
|
|
|
|
|
529 | self - rhs.to_decimal()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:534:19
|
|
|
|
|
534 | type Output = Decimal;
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:535:43
|
|
|
|
|
535 | fn mul(self, rhs: IntegerQuantity) -> Decimal {
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:536:9
|
|
|
|
|
536 | self * rhs.to_decimal()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:541:19
|
|
|
|
|
541 | type Output = Decimal;
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:542:43
|
|
|
|
|
542 | fn div(self, rhs: IntegerQuantity) -> Decimal {
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:543:32
|
|
|
|
|
543 | if rhs.to_decimal() == Decimal::ZERO {
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: unnecessary structure name repetition
|
|
--> trading_engine/src/types/financial.rs:544:13
|
|
|
|
|
544 | Decimal::ZERO
|
|
| ^^^^^^^ help: use the applicable keyword: `Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:546:13
|
|
|
|
|
546 | self / rhs.to_decimal()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:563:9
|
|
|
|
|
563 | self + other
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:567:9
|
|
|
|
|
567 | self - other
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:583:9
|
|
|
|
|
583 | self + other
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:587:9
|
|
|
|
|
587 | self - other
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:603:9
|
|
|
|
|
603 | self + other
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/types/financial.rs:607:9
|
|
|
|
|
607 | self - other
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/validation.rs:15:5
|
|
|
|
|
15 | /// MAX_ACCOUNT_ID_LENGTH
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
15 - /// MAX_ACCOUNT_ID_LENGTH
|
|
15 + /// `MAX_ACCOUNT_ID_LENGTH`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/validation.rs:17:5
|
|
|
|
|
17 | /// MAX_DESCRIPTION_LENGTH
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
17 - /// MAX_DESCRIPTION_LENGTH
|
|
17 + /// `MAX_DESCRIPTION_LENGTH`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/validation.rs:19:5
|
|
|
|
|
19 | /// MAX_METADATA_KEY_LENGTH
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
19 - /// MAX_METADATA_KEY_LENGTH
|
|
19 + /// `MAX_METADATA_KEY_LENGTH`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/validation.rs:21:5
|
|
|
|
|
21 | /// MAX_METADATA_VALUE_LENGTH
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
21 - /// MAX_METADATA_VALUE_LENGTH
|
|
21 + /// `MAX_METADATA_VALUE_LENGTH`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/validation.rs:23:5
|
|
|
|
|
23 | /// MAX_METADATA_ENTRIES
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
23 - /// MAX_METADATA_ENTRIES
|
|
23 + /// `MAX_METADATA_ENTRIES`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/validation.rs:28:5
|
|
|
|
|
28 | /// MIN_PRICE
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
28 - /// MIN_PRICE
|
|
28 + /// `MIN_PRICE`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/validation.rs:30:5
|
|
|
|
|
30 | /// MAX_QUANTITY
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
30 - /// MAX_QUANTITY
|
|
30 + /// `MAX_QUANTITY`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/validation.rs:32:5
|
|
|
|
|
32 | /// MIN_QUANTITY
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
32 - /// MIN_QUANTITY
|
|
32 + /// `MIN_QUANTITY`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/validation.rs:34:5
|
|
|
|
|
34 | /// MAX_LEVERAGE
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
34 - /// MAX_LEVERAGE
|
|
34 + /// `MAX_LEVERAGE`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/validation.rs:36:5
|
|
|
|
|
36 | /// MIN_LEVERAGE
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
36 - /// MIN_LEVERAGE
|
|
36 + /// `MIN_LEVERAGE`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/validation.rs:41:5
|
|
|
|
|
41 | /// ValidationError
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
41 - /// ValidationError
|
|
41 + /// `ValidationError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/validation.rs:87:5
|
|
|
|
|
87 | /// InputValidator
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
87 - /// InputValidator
|
|
87 + /// `InputValidator`
|
|
|
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/types/validation.rs:94:5
|
|
|
|
|
94 | pub fn validate_symbol(symbol: &str) -> ValidationResult<String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/types/validation.rs:120:5
|
|
|
|
|
120 | pub fn validate_account_id(account_id: &str) -> ValidationResult<String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/types/validation.rs:144:5
|
|
|
|
|
144 | pub fn validate_price(price: f64) -> ValidationResult<Decimal> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/types/validation.rs:161:42
|
|
|
|
|
161 | Decimal::try_from(price).map_err(|_| ValidationError::InvalidPrice {
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
= note: requested on the command line with `-W clippy::map-err-ignore`
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/types/validation.rs:169:5
|
|
|
|
|
169 | pub fn validate_quantity(quantity: f64) -> ValidationResult<Decimal> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/types/validation.rs:170:71
|
|
|
|
|
170 | if quantity.is_nan() || quantity.is_infinite() || quantity <= 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
= note: requested on the command line with `-W clippy::default-numeric-fallback`
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/types/validation.rs:186:45
|
|
|
|
|
186 | Decimal::try_from(quantity).map_err(|_| ValidationError::InvalidQuantity {
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/types/validation.rs:194:5
|
|
|
|
|
194 | pub fn validate_leverage(leverage: f64) -> ValidationResult<f64> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/types/validation.rs:195:71
|
|
|
|
|
195 | if leverage.is_nan() || leverage.is_infinite() || leverage <= 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/types/validation.rs:216:5
|
|
|
|
|
216 | / pub fn validate_text(
|
|
217 | | text: &str,
|
|
218 | | max_length: usize,
|
|
219 | | _field_name: &str,
|
|
220 | | ) -> ValidationResult<String> {
|
|
| |_________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/types/validation.rs:242:5
|
|
|
|
|
242 | / pub fn validate_metadata(
|
|
243 | | metadata: &HashMap<String, String>,
|
|
244 | | ) -> ValidationResult<HashMap<String, String>> {
|
|
| |__________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/types/validation.rs:340:5
|
|
|
|
|
340 | pub fn require_field<T>(field: Option<T>, field_name: &str) -> ValidationResult<T> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/types/validation.rs:347:5
|
|
|
|
|
347 | / pub fn validate_enum_value<T: std::fmt::Display>(
|
|
348 | | value: &str,
|
|
349 | | valid_values: &[&str],
|
|
350 | | field_name: &str,
|
|
351 | | ) -> ValidationResult<()> {
|
|
| |_____________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/types/validation.rs:364:5
|
|
|
|
|
364 | fn validate(&self) -> ValidationResult<()>;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/cardinality_limiter.rs:29:9
|
|
|
|
|
29 | /// Set FOXHUNT_USE_OPTIMIZED_METRICS=true to enable
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
29 - /// Set FOXHUNT_USE_OPTIMIZED_METRICS=true to enable
|
|
29 + /// Set `FOXHUNT_USE_OPTIMIZED_METRICS=true` to enable
|
|
|
|
|
|
|
warning: this function could have a `#[must_use]` attribute
|
|
--> trading_engine/src/types/cardinality_limiter.rs:84:1
|
|
|
|
|
84 | pub fn bucket_instrument(symbol: &str) -> &'static str {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn bucket_instrument(symbol: &str) -> &'static str`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/types/cardinality_limiter.rs:152:34
|
|
|
|
|
152 | let (base, quote) = (parts[0], parts[1]);
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/types/cardinality_limiter.rs:152:44
|
|
|
|
|
152 | let (base, quote) = (parts[0], parts[1]);
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: manual `!RangeInclusive::contains` implementation
|
|
--> trading_engine/src/types/cardinality_limiter.rs:167:8
|
|
|
|
|
167 | if len < 6 || len > 7 {
|
|
| ^^^^^^^^^^^^^^^^^^ help: use: `!(6..=7).contains(&len)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
|
|
= note: `#[warn(clippy::manual_range_contains)]` implied by `#[warn(clippy::style)]`
|
|
|
|
warning: redundant closure
|
|
--> trading_engine/src/types/cardinality_limiter.rs:179:27
|
|
|
|
|
179 | if !clean.chars().all(|c| c.is_alphabetic()) {
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `char::is_alphabetic`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
|
|
|
|
warning: manual `!RangeInclusive::contains` implementation
|
|
--> trading_engine/src/types/cardinality_limiter.rs:196:8
|
|
|
|
|
196 | if len < 1 || len > 5 {
|
|
| ^^^^^^^^^^^^^^^^^^ help: use: `!(1..=5).contains(&len)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
|
|
|
|
warning: redundant closure
|
|
--> trading_engine/src/types/cardinality_limiter.rs:201:24
|
|
|
|
|
201 | symbol.chars().all(|c| c.is_alphabetic())
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `char::is_alphabetic`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
|
|
|
|
warning: manual `!RangeInclusive::contains` implementation
|
|
--> trading_engine/src/types/cardinality_limiter.rs:215:8
|
|
|
|
|
215 | if len < 4 || len > 8 {
|
|
| ^^^^^^^^^^^^^^^^^^ help: use: `!(4..=8).contains(&len)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
|
|
|
|
warning: redundant closure
|
|
--> trading_engine/src/types/cardinality_limiter.rs:219:42
|
|
|
|
|
219 | let has_letters = symbol.chars().any(|c| c.is_alphabetic());
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `char::is_alphabetic`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
|
|
|
|
warning: redundant closure
|
|
--> trading_engine/src/types/cardinality_limiter.rs:220:41
|
|
|
|
|
220 | let has_digits = symbol.chars().any(|c| c.is_numeric());
|
|
| ^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `char::is_numeric`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/types/mod.rs:82:5
|
|
|
|
|
82 | /// TradingEngineError
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
82 - /// TradingEngineError
|
|
82 + /// `TradingEngineError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/timing.rs:131:5
|
|
|
|
|
131 | /// HardwareTimestamp
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/timing.rs:108:5
|
|
|
|
|
108 | clippy::pedantic,
|
|
| ^^^^^^^^^^^^^^^^
|
|
help: try
|
|
|
|
|
131 - /// HardwareTimestamp
|
|
131 + /// `HardwareTimestamp`
|
|
|
|
|
|
|
warning: you are deriving `serde::Deserialize` on a type that has methods using `unsafe`
|
|
--> trading_engine/src/timing.rs:130:48
|
|
|
|
|
130 | #[derive(Debug, Clone, Copy, serde::Serialize, serde::Deserialize)]
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider implementing `serde::Deserialize` manually. See https://serde.rs/impl-deserialize.html
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unsafe_derive_deserialize
|
|
= note: `#[warn(clippy::unsafe_derive_deserialize)]` implied by `#[warn(clippy::pedantic)]`
|
|
= note: this warning originates in the derive macro `serde::Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/timing.rs:147:5
|
|
|
|
|
147 | /// TimingSource
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
147 - /// TimingSource
|
|
147 + /// `TimingSource`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/timing.rs:166:5
|
|
|
|
|
166 | /// TimingSafetyConfig
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
166 - /// TimingSafetyConfig
|
|
166 + /// `TimingSafetyConfig`
|
|
|
|
|
|
|
warning: you have declared `#[inline(always)]` on `now`. This is usually a bad idea
|
|
--> trading_engine/src/timing.rs:196:5
|
|
|
|
|
196 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: use Option::map_or_else instead of an if let/else
|
|
--> trading_engine/src/timing.rs:219:13
|
|
|
|
|
219 | / match Self::rdtsc_with_validation() {
|
|
220 | | Ok(timestamp) => timestamp,
|
|
221 | | Err(_) => Self::fallback_system_clock(),
|
|
222 | | }
|
|
| |_____________^ help: try: `Self::rdtsc_with_validation().map_or_else(Self::fallback_system_clock, |timestamp| timestamp)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/timing.rs:109:5
|
|
|
|
|
109 | clippy::nursery,
|
|
| ^^^^^^^^^^^^^^^
|
|
= note: `#[warn(clippy::option_if_let_else)]` implied by `#[warn(clippy::nursery)]`
|
|
|
|
warning: casts from `u64` to `u128` can be expressed infallibly using `From`
|
|
--> trading_engine/src/timing.rs:282:35
|
|
|
|
|
282 | let cycles_u128 = cycles as u128;
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: an `as` cast can become silently lossy if the types change in the future
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
|
|
= note: `#[warn(clippy::cast_lossless)]` implied by `#[warn(clippy::pedantic)]`
|
|
help: use `u128::from` instead
|
|
|
|
|
282 - let cycles_u128 = cycles as u128;
|
|
282 + let cycles_u128 = u128::from(cycles);
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:282:35
|
|
|
|
|
282 | let cycles_u128 = cycles as u128;
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/timing.rs:283:34
|
|
|
|
|
283 | let nanos_u128 = cycles_u128 * 1_000_000_000u128 / freq as u128;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/timing.rs:283:34
|
|
|
|
|
283 | let nanos_u128 = cycles_u128 * 1_000_000_000u128 / freq as u128;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: casts from `u64` to `u128` can be expressed infallibly using `From`
|
|
--> trading_engine/src/timing.rs:283:68
|
|
|
|
|
283 | let nanos_u128 = cycles_u128 * 1_000_000_000u128 / freq as u128;
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: an `as` cast can become silently lossy if the types change in the future
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
|
|
help: use `u128::from` instead
|
|
|
|
|
283 - let nanos_u128 = cycles_u128 * 1_000_000_000u128 / freq as u128;
|
|
283 + let nanos_u128 = cycles_u128 * 1_000_000_000u128 / u128::from(freq);
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:283:68
|
|
|
|
|
283 | let nanos_u128 = cycles_u128 * 1_000_000_000u128 / freq as u128;
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: casts from `u64` to `u128` can be expressed infallibly using `From`
|
|
--> trading_engine/src/timing.rs:286:33
|
|
|
|
|
286 | if nanos_u128 > u64::MAX as u128 {
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: an `as` cast can become silently lossy if the types change in the future
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
|
|
help: use `u128::from` instead
|
|
|
|
|
286 - if nanos_u128 > u64::MAX as u128 {
|
|
286 + if nanos_u128 > u128::from(u64::MAX) {
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:286:33
|
|
|
|
|
286 | if nanos_u128 > u64::MAX as u128 {
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:294:49
|
|
|
|
|
294 | .map_or_else(|_| 0, |d| d.as_nanos() as u64)
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:296:21
|
|
|
|
|
296 | nanos_u128 as u64
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:301:45
|
|
|
|
|
301 | .map_or_else(|_| 0, |d| d.as_nanos() as u64) // Handle time before epoch error gracefully
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: this `unsafe` block contains 3 unsafe operations, expected only one
|
|
--> trading_engine/src/timing.rs:334:9
|
|
|
|
|
334 | / unsafe {
|
|
335 | | // Take multiple readings to validate monotonicity
|
|
336 | | let cycles1 = __rdtsc();
|
|
337 | | let cycles2 = __rdtsc();
|
|
... |
|
|
387 | | })
|
|
388 | | }
|
|
| |_________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/timing.rs:336:27
|
|
|
|
|
336 | let cycles1 = __rdtsc();
|
|
| ^^^^^^^^^
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/timing.rs:337:27
|
|
|
|
|
337 | let cycles2 = __rdtsc();
|
|
| ^^^^^^^^^
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/timing.rs:338:27
|
|
|
|
|
338 | let cycles3 = __rdtsc();
|
|
| ^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
= note: requested on the command line with `-W clippy::multiple-unsafe-ops-per-block`
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/timing.rs:353:28
|
|
|
|
|
353 | let overhead = cycles3 - cycles1;
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: casts from `u64` to `u128` can be expressed infallibly using `From`
|
|
--> trading_engine/src/timing.rs:368:35
|
|
|
|
|
368 | let cycles_u128 = cycles2 as u128;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: an `as` cast can become silently lossy if the types change in the future
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
|
|
help: use `u128::from` instead
|
|
|
|
|
368 - let cycles_u128 = cycles2 as u128;
|
|
368 + let cycles_u128 = u128::from(cycles2);
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:368:35
|
|
|
|
|
368 | let cycles_u128 = cycles2 as u128;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/timing.rs:369:34
|
|
|
|
|
369 | let nanos_u128 = cycles_u128 * 1_000_000_000u128 / freq as u128;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/timing.rs:369:34
|
|
|
|
|
369 | let nanos_u128 = cycles_u128 * 1_000_000_000u128 / freq as u128;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: casts from `u64` to `u128` can be expressed infallibly using `From`
|
|
--> trading_engine/src/timing.rs:369:68
|
|
|
|
|
369 | let nanos_u128 = cycles_u128 * 1_000_000_000u128 / freq as u128;
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: an `as` cast can become silently lossy if the types change in the future
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
|
|
help: use `u128::from` instead
|
|
|
|
|
369 - let nanos_u128 = cycles_u128 * 1_000_000_000u128 / freq as u128;
|
|
369 + let nanos_u128 = cycles_u128 * 1_000_000_000u128 / u128::from(freq);
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:369:68
|
|
|
|
|
369 | let nanos_u128 = cycles_u128 * 1_000_000_000u128 / freq as u128;
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: casts from `u64` to `u128` can be expressed infallibly using `From`
|
|
--> trading_engine/src/timing.rs:371:33
|
|
|
|
|
371 | if nanos_u128 > u64::MAX as u128 {
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: an `as` cast can become silently lossy if the types change in the future
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
|
|
help: use `u128::from` instead
|
|
|
|
|
371 - if nanos_u128 > u64::MAX as u128 {
|
|
371 + if nanos_u128 > u128::from(u64::MAX) {
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:371:33
|
|
|
|
|
371 | if nanos_u128 > u64::MAX as u128 {
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: variables can be used directly in the `format!` string
|
|
--> trading_engine/src/timing.rs:372:32
|
|
|
|
|
372 | return Err(anyhow!(
|
|
| ________________________________^
|
|
373 | | "TSC calculation overflow: cycles={}, freq={}, result={}",
|
|
374 | | cycles2, freq, nanos_u128
|
|
375 | | ));
|
|
| |_____________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
|
= note: `#[warn(clippy::uninlined_format_args)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:377:17
|
|
|
|
|
377 | nanos_u128 as u64
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:395:37
|
|
|
|
|
395 | .map_or_else(|_| 0, |d| d.as_nanos() as u64);
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: you have declared `#[inline(always)]` on `latency_ns`. This is usually a bad idea
|
|
--> trading_engine/src/timing.rs:406:5
|
|
|
|
|
406 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/timing.rs:416:5
|
|
|
|
|
416 | pub fn latency_ns_safe(&self, earlier: &Self) -> Result<u64> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/timing.rs:429:13
|
|
|
|
|
429 | self.nanos - earlier.nanos
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: you have declared `#[inline(always)]` on `latency_us`. This is usually a bad idea
|
|
--> trading_engine/src/timing.rs:449:5
|
|
|
|
|
449 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: called `map(<f>).unwrap_or_else(<g>)` on a `Result` value
|
|
--> trading_engine/src/timing.rs:452:9
|
|
|
|
|
452 | / self.latency_ns_safe(earlier)
|
|
453 | | .map(|ns| ns as f64 / 1000.0)
|
|
454 | | .unwrap_or_else(|_| {
|
|
455 | | tracing::warn!("Failed to calculate safe latency in microseconds, returning 0");
|
|
456 | | 0.0
|
|
457 | | })
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or
|
|
= note: `#[warn(clippy::map_unwrap_or)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/timing.rs:453:35
|
|
|
|
|
453 | .map(|ns| ns as f64 / 1000.0)
|
|
| ^^^^^^ help: consider adding suffix: `1_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/timing.rs:453:23
|
|
|
|
|
453 | .map(|ns| ns as f64 / 1000.0)
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:453:23
|
|
|
|
|
453 | .map(|ns| ns as f64 / 1000.0)
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/timing.rs:456:17
|
|
|
|
|
456 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/timing.rs:461:5
|
|
|
|
|
461 | pub fn latency_us_safe(&self, earlier: &Self) -> Result<f64> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/timing.rs:464:12
|
|
|
|
|
464 | Ok(ns as f64 / 1000.0)
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:464:12
|
|
|
|
|
464 | Ok(ns as f64 / 1000.0)
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: you have declared `#[inline(always)]` on `as_nanos`. This is usually a bad idea
|
|
--> trading_engine/src/timing.rs:468:5
|
|
|
|
|
468 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `from_nanos`. This is usually a bad idea
|
|
--> trading_engine/src/timing.rs:475:5
|
|
|
|
|
475 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/timing.rs:488:5
|
|
|
|
|
488 | pub fn duration_since(&self, earlier: &Self) -> Result<u64> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: you have declared `#[inline(always)]` on `duration_since`. This is usually a bad idea
|
|
--> trading_engine/src/timing.rs:487:5
|
|
|
|
|
487 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/timing.rs:502:30
|
|
|
|
|
502 | /// - Rate limiting prevents DoS via repeated calibration
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
502 - /// - Rate limiting prevents DoS via repeated calibration
|
|
502 + /// - Rate limiting prevents `DoS` via repeated calibration
|
|
|
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/timing.rs:514:1
|
|
|
|
|
514 | pub fn calibrate_tsc() -> Result<u64, &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/timing.rs:536:1
|
|
|
|
|
536 | pub fn calibrate_tsc_with_config(config: &TimingSafetyConfig) -> Result<u64, &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: the function has a cognitive complexity of (31/30)
|
|
--> trading_engine/src/timing.rs:536:8
|
|
|
|
|
536 | pub fn calibrate_tsc_with_config(config: &TimingSafetyConfig) -> Result<u64, &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cognitive_complexity
|
|
= note: `#[warn(clippy::cognitive_complexity)]` implied by `#[warn(clippy::nursery)]`
|
|
|
|
warning: adding items after statements is confusing, since items exist from the start of the scope
|
|
--> trading_engine/src/timing.rs:546:5
|
|
|
|
|
546 | const ATTEMPTS: usize = 5;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
|
|
= note: `#[warn(clippy::items_after_statements)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/timing.rs:553:73
|
|
|
|
|
553 | tracing::warn!("TSC calibration attempt {} failed: {}", attempt + 1, e);
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/timing.rs:565:14
|
|
|
|
|
565 | .get(frequencies.len() / 2)
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/timing.rs:569:25
|
|
|
|
|
569 | let max_deviation = median_freq / 100; // 1% deviation allowed
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/timing.rs:572:26
|
|
|
|
|
572 | .filter(|&&freq| (freq as i64 - median_freq as i64).abs() <= max_deviation as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: casting `u64` to `i64` may wrap around the value
|
|
--> trading_engine/src/timing.rs:572:27
|
|
|
|
|
572 | .filter(|&&freq| (freq as i64 - median_freq as i64).abs() <= max_deviation as i64)
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:572:27
|
|
|
|
|
572 | .filter(|&&freq| (freq as i64 - median_freq as i64).abs() <= max_deviation as i64)
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: casting `u64` to `i64` may wrap around the value
|
|
--> trading_engine/src/timing.rs:572:41
|
|
|
|
|
572 | .filter(|&&freq| (freq as i64 - median_freq as i64).abs() <= max_deviation as i64)
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:572:41
|
|
|
|
|
572 | .filter(|&&freq| (freq as i64 - median_freq as i64).abs() <= max_deviation as i64)
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: casting `u64` to `i64` may wrap around the value
|
|
--> trading_engine/src/timing.rs:572:70
|
|
|
|
|
572 | .filter(|&&freq| (freq as i64 - median_freq as i64).abs() <= max_deviation as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:572:70
|
|
|
|
|
572 | .filter(|&&freq| (freq as i64 - median_freq as i64).abs() <= max_deviation as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/timing.rs:575:27
|
|
|
|
|
575 | if consistent_count < frequencies.len() / 2 {
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/timing.rs:628:67
|
|
|
|
|
628 | /// - Could be called repeatedly to consume CPU cycles and create DoS
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
628 - /// - Could be called repeatedly to consume CPU cycles and create DoS
|
|
628 + /// - Could be called repeatedly to consume CPU cycles and create `DoS`
|
|
|
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/timing.rs:661:5
|
|
|
|
|
661 | / unsafe {
|
|
662 | | // SAFETY: Take initial RDTSC reading for calibration baseline
|
|
663 | | // This is safe because RDTSC is a read-only operation
|
|
664 | | let start_tsc = __rdtsc();
|
|
... |
|
|
703 | | Ok(frequency)
|
|
704 | | }
|
|
| |_____^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/timing.rs:664:25
|
|
|
|
|
664 | let start_tsc = __rdtsc();
|
|
| ^^^^^^^^^
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/timing.rs:670:23
|
|
|
|
|
670 | let end_tsc = __rdtsc();
|
|
| ^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:675:30
|
|
|
|
|
675 | let expected_nanos = calibration_duration.as_nanos() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:676:28
|
|
|
|
|
676 | let actual_nanos = actual_duration.as_nanos() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/timing.rs:680:27
|
|
|
|
|
680 | if actual_nanos < expected_nanos / 2 || actual_nanos > expected_nanos * 3 / 2 {
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/timing.rs:680:64
|
|
|
|
|
680 | if actual_nanos < expected_nanos / 2 || actual_nanos > expected_nanos * 3 / 2 {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/timing.rs:680:64
|
|
|
|
|
680 | if actual_nanos < expected_nanos / 2 || actual_nanos > expected_nanos * 3 / 2 {
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/timing.rs:726:5
|
|
|
|
|
726 | /// LatencyMeasurement
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
726 - /// LatencyMeasurement
|
|
726 + /// `LatencyMeasurement`
|
|
|
|
|
|
|
warning: you have declared `#[inline(always)]` on `start`. This is usually a bad idea
|
|
--> trading_engine/src/timing.rs:737:5
|
|
|
|
|
737 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `finish`. This is usually a bad idea
|
|
--> trading_engine/src/timing.rs:746:5
|
|
|
|
|
746 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: called `map(<f>).unwrap_or_else(<g>)` on an `Option` value
|
|
--> trading_engine/src/timing.rs:749:9
|
|
|
|
|
749 | / self.end
|
|
750 | | .as_ref()
|
|
751 | | .map(|end| end.latency_ns(&self.start))
|
|
752 | | .unwrap_or_else(|| {
|
|
753 | | tracing::warn!("Failed to capture end timestamp, returning 0 latency");
|
|
754 | | 0
|
|
755 | | })
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or
|
|
|
|
warning: you have declared `#[inline(always)]` on `finish_us`. This is usually a bad idea
|
|
--> trading_engine/src/timing.rs:758:5
|
|
|
|
|
758 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/timing.rs:760:9
|
|
|
|
|
760 | self.finish() as f64 / 1000.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:760:9
|
|
|
|
|
760 | self.finish() as f64 / 1000.0
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/timing.rs:766:5
|
|
|
|
|
766 | /// HftLatencyTracker
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
766 - /// HftLatencyTracker
|
|
766 + /// `HftLatencyTracker`
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/timing.rs:803:34
|
|
|
|
|
803 | order_processing_us: self.order_processing_ns.load(Ordering::Relaxed) as f64 / 1000.0,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:803:34
|
|
|
|
|
803 | order_processing_us: self.order_processing_ns.load(Ordering::Relaxed) as f64 / 1000.0,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/timing.rs:804:28
|
|
|
|
|
804 | risk_check_us: self.risk_check_ns.load(Ordering::Relaxed) as f64 / 1000.0,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:804:28
|
|
|
|
|
804 | risk_check_us: self.risk_check_ns.load(Ordering::Relaxed) as f64 / 1000.0,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/timing.rs:805:29
|
|
|
|
|
805 | market_data_us: self.market_data_ns.load(Ordering::Relaxed) as f64 / 1000.0,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:805:29
|
|
|
|
|
805 | market_data_us: self.market_data_ns.load(Ordering::Relaxed) as f64 / 1000.0,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/timing.rs:806:31
|
|
|
|
|
806 | total_latency_us: self.total_latency_ns.load(Ordering::Relaxed) as f64 / 1000.0,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/timing.rs:806:31
|
|
|
|
|
806 | total_latency_us: self.total_latency_ns.load(Ordering::Relaxed) as f64 / 1000.0,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/timing.rs:813:5
|
|
|
|
|
813 | /// LatencyStats
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
813 - /// LatencyStats
|
|
813 + /// `LatencyStats`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/simd/mod.rs:179:5
|
|
|
|
|
179 | /// AlignedPrices
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/simd/mod.rs:56:5
|
|
|
|
|
56 | clippy::pedantic,
|
|
| ^^^^^^^^^^^^^^^^
|
|
help: try
|
|
|
|
|
179 - /// AlignedPrices
|
|
179 + /// `AlignedPrices`
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:193:31
|
|
|
|
|
193 | data.resize(capacity, 0.0);
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/mod.rs:219:9
|
|
|
|
|
219 | (self.data.as_ptr() as usize) % 32 == 0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/simd/mod.rs:226:5
|
|
|
|
|
226 | /// AlignedVolumes
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
226 - /// AlignedVolumes
|
|
226 + /// `AlignedVolumes`
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:239:31
|
|
|
|
|
239 | data.resize(capacity, 0.0);
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/simd/mod.rs:260:5
|
|
|
|
|
260 | /// SimdPrefetch
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
260 - /// SimdPrefetch
|
|
260 + /// `SimdPrefetch`
|
|
|
|
|
|
|
warning: you have declared `#[inline(always)]` on `prefetch_read`. This is usually a bad idea
|
|
--> trading_engine/src/simd/mod.rs:274:5
|
|
|
|
|
274 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `prefetch_write`. This is usually a bad idea
|
|
--> trading_engine/src/simd/mod.rs:287:5
|
|
|
|
|
287 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `prefetch_range`. This is usually a bad idea
|
|
--> trading_engine/src/simd/mod.rs:300:5
|
|
|
|
|
300 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:303:26
|
|
|
|
|
303 | let offset = start_offset + (i * 8); // 8 f64s per cache line (64 bytes)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/simd/mod.rs:311:5
|
|
|
|
|
311 | /// CpuFeatures
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
311 - /// CpuFeatures
|
|
311 + /// `CpuFeatures`
|
|
|
|
|
|
|
warning: more than 3 bools in a struct
|
|
--> trading_engine/src/simd/mod.rs:314:1
|
|
|
|
|
314 | / pub struct CpuFeatures {
|
|
315 | | /// Avx2
|
|
316 | | pub avx2: bool,
|
|
317 | | /// Sse2
|
|
... |
|
|
324 | | pub fma: bool,
|
|
325 | | }
|
|
| |_^
|
|
|
|
|
= help: consider using a state machine or refactoring bools into two-variant enums
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#struct_excessive_bools
|
|
= note: `#[warn(clippy::struct_excessive_bools)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/simd/mod.rs:344:5
|
|
|
|
|
344 | pub fn require_avx2(&self) -> Result<(), &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/simd/mod.rs:356:5
|
|
|
|
|
356 | pub fn require_sse2(&self) -> Result<(), &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/simd/mod.rs:386:5
|
|
|
|
|
386 | /// SimdLevel
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
386 - /// SimdLevel
|
|
386 + /// `SimdLevel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/simd/mod.rs:416:5
|
|
|
|
|
416 | /// SafeSimdDispatcher
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
416 - /// SafeSimdDispatcher
|
|
416 + /// `SafeSimdDispatcher`
|
|
|
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/simd/mod.rs:445:5
|
|
|
|
|
445 | pub fn create_price_ops(&self) -> Result<SimdPriceOps, &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/simd/mod.rs:452:5
|
|
|
|
|
452 | pub fn create_risk_engine(&self) -> Result<SimdRiskEngine, &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/simd/mod.rs:459:5
|
|
|
|
|
459 | pub fn create_market_data_ops(&self) -> Result<SimdMarketDataOps, &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/simd/mod.rs:466:5
|
|
|
|
|
466 | pub fn create_sse2_price_ops(&self) -> Result<Sse2PriceOps, &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: use Option::map_or instead of an if let/else
|
|
--> trading_engine/src/simd/mod.rs:476:32
|
|
|
|
|
476 | SimdLevel::AVX2 => match self.create_price_ops() {
|
|
| ________________________________^
|
|
477 | | Ok(ops) => AdaptivePriceOps::AVX2(ops),
|
|
478 | | Err(_) => AdaptivePriceOps::Scalar,
|
|
479 | | },
|
|
| |_____________^ help: try: `self.create_price_ops().map_or(AdaptivePriceOps::Scalar, |ops| AdaptivePriceOps::AVX2(ops))`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/simd/mod.rs:57:5
|
|
|
|
|
57 | clippy::nursery,
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
warning: use Option::map_or instead of an if let/else
|
|
--> trading_engine/src/simd/mod.rs:481:17
|
|
|
|
|
481 | / match self.create_sse2_price_ops() {
|
|
482 | | Ok(ops) => AdaptivePriceOps::SSE2(ops),
|
|
483 | | Err(_) => AdaptivePriceOps::Scalar,
|
|
484 | | }
|
|
| |_________________^ help: try: `self.create_sse2_price_ops().map_or(AdaptivePriceOps::Scalar, |ops| AdaptivePriceOps::SSE2(ops))`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/simd/mod.rs:499:5
|
|
|
|
|
499 | /// SimdConstants
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
499 - /// SimdConstants
|
|
499 + /// `SimdConstants`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/simd/mod.rs:546:5
|
|
|
|
|
546 | /// SimdPriceOps
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
546 - /// SimdPriceOps
|
|
546 + /// `SimdPriceOps`
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:603:53
|
|
|
|
|
603 | if prices.len() % 4 != 0 || prices.len() != results.len() * 4 {
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:625:43
|
|
|
|
|
625 | _mm256_storeu_pd(&mut results[chunk_idx * 4], min_all);
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:631:29
|
|
|
|
|
631 | let start_idx = prices.len() - remaining;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:636:28
|
|
|
|
|
636 | if i + j < prices.len() {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:637:58
|
|
|
|
|
637 | ... min_val = min_val.min(prices[i + j]);
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/simd/mod.rs:640:24
|
|
|
|
|
640 | if i / 4 < results.len() {
|
|
| ^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/simd/mod.rs:641:33
|
|
|
|
|
641 | results[i / 4] = min_val;
|
|
| ^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:672:25
|
|
|
|
|
672 | for j in 0..3 - i {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:673:39
|
|
|
|
|
673 | if prices[j] > prices[j + 1] {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:674:36
|
|
|
|
|
674 | prices.swap(j, j + 1);
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unsafe function's docs are missing a `# Safety` section
|
|
--> trading_engine/src/simd/mod.rs:683:5
|
|
|
|
|
683 | pub unsafe fn simd_binary_search(&self, sorted_prices: &[f64], target: f64) -> Option<usize> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/simd/mod.rs:60:5
|
|
|
|
|
60 | clippy::style,
|
|
| ^^^^^^^^^^^^^
|
|
= note: `#[warn(clippy::missing_safety_doc)]` implied by `#[warn(clippy::style)]`
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:687:32
|
|
|
|
|
687 | .position(|&price| (price - target).abs() < f64::EPSILON)
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:770:29
|
|
|
|
|
770 | let mut pv_array = [0.0; 4];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:771:30
|
|
|
|
|
771 | let mut vol_array = [0.0; 4];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:734:15
|
|
|
|
|
734 | while i + 8 <= len {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:738:54
|
|
|
|
|
738 | let price_vec2 = _mm256_loadu_pd(&prices[i + 4]);
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:739:56
|
|
|
|
|
739 | let volume_vec2 = _mm256_loadu_pd(&volumes[i + 4]);
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:751:13
|
|
|
|
|
751 | i += 8;
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:755:15
|
|
|
|
|
755 | while i + 4 <= len {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:766:13
|
|
|
|
|
766 | i += 4;
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:775:22
|
|
|
|
|
775 | let pv_sum = pv_array[0] + pv_array[1] + pv_array[2] + pv_array[3];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:776:23
|
|
|
|
|
776 | let vol_sum = vol_array[0] + vol_array[1] + vol_array[2] + vol_array[3];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:783:13
|
|
|
|
|
783 | total_pv += prices[j] * volumes[j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:784:13
|
|
|
|
|
784 | total_volume += volumes[j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:789:13
|
|
|
|
|
789 | total_pv / total_volume
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading_engine/src/simd/mod.rs:819:5
|
|
|
|
|
819 | pub unsafe fn sum_aligned(&self, prices: &AlignedPrices) -> f64 {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub unsafe fn sum_aligned(&self, prices: &AlignedPrices) -> f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:846:30
|
|
|
|
|
846 | let mut sum_array = [0.0; 4];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:826:15
|
|
|
|
|
826 | while i + 16 <= len {
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:827:40
|
|
|
|
|
827 | _mm_prefetch(price_ptr.add(i + 16).cast::<i8>(), _MM_HINT_T0);
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:830:26
|
|
|
|
|
830 | for j in (i..i + 16).step_by(4) {
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:835:13
|
|
|
|
|
835 | i += 16;
|
|
| ^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:839:15
|
|
|
|
|
839 | while i + 4 <= len {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:842:13
|
|
|
|
|
842 | i += 4;
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:848:25
|
|
|
|
|
848 | let mut total = sum_array[0] + sum_array[1] + sum_array[2] + sum_array[3];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:852:13
|
|
|
|
|
852 | total += prices.data[j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:922:29
|
|
|
|
|
922 | let mut pv_array = [0.0; 4];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:923:30
|
|
|
|
|
923 | let mut vol_array = [0.0; 4];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:889:15
|
|
|
|
|
889 | while i + 8 <= len {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:893:60
|
|
|
|
|
893 | let price_vec2 = _mm256_loadu_pd(price_ptr.add(i + 4));
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:894:62
|
|
|
|
|
894 | let volume_vec2 = _mm256_loadu_pd(volume_ptr.add(i + 4));
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:906:13
|
|
|
|
|
906 | i += 8;
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:910:15
|
|
|
|
|
910 | while i + 4 <= len {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:918:13
|
|
|
|
|
918 | i += 4;
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:927:22
|
|
|
|
|
927 | let pv_sum = pv_array[0] + pv_array[1] + pv_array[2] + pv_array[3];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:928:23
|
|
|
|
|
928 | let vol_sum = vol_array[0] + vol_array[1] + vol_array[2] + vol_array[3];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:935:13
|
|
|
|
|
935 | total_pv += prices.data[j] * volumes.data[j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:936:13
|
|
|
|
|
936 | total_volume += volumes.data[j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:941:13
|
|
|
|
|
941 | total_pv / total_volume
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/simd/mod.rs:950:5
|
|
|
|
|
950 | /// SimdRiskEngine
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
950 - /// SimdRiskEngine
|
|
950 + /// `SimdRiskEngine`
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1077:35
|
|
|
|
|
1077 | let mut variance_array = [0.0; 4];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1027:15
|
|
|
|
|
1027 | while i + 16 <= len {
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1029:62
|
|
|
|
|
1029 | SimdPrefetch::prefetch_range(positions.as_ptr(), i + 16, 2);
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1030:59
|
|
|
|
|
1030 | SimdPrefetch::prefetch_range(prices.as_ptr(), i + 16, 2);
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1031:65
|
|
|
|
|
1031 | SimdPrefetch::prefetch_range(volatilities.as_ptr(), i + 16, 2);
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1034:26
|
|
|
|
|
1034 | for j in (i..i + 16).step_by(4) {
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1052:13
|
|
|
|
|
1052 | i += 16;
|
|
| ^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1056:15
|
|
|
|
|
1056 | while i + 4 <= len {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1073:13
|
|
|
|
|
1073 | i += 4;
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1080:13
|
|
|
|
|
1080 | variance_array[0] + variance_array[1] + variance_array[2] + variance_array[3];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1084:34
|
|
|
|
|
1084 | let position_value = positions[j] * prices[j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1085:33
|
|
|
|
|
1085 | let var_component = position_value * volatilities[j] * confidence_level;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1086:13
|
|
|
|
|
1086 | total_variance += var_component * var_component;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: unsafe function's docs are missing a `# Safety` section
|
|
--> trading_engine/src/simd/mod.rs:1095:5
|
|
|
|
|
1095 | / pub unsafe fn calculate_correlation_matrix(
|
|
1096 | | &self,
|
|
1097 | | returns: &[Vec<f64>], // returns[asset][time]
|
|
1098 | | correlations: &mut [f64], // Flattened correlation matrix
|
|
1099 | | ) {
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1108:30
|
|
|
|
|
1108 | let mut means = vec![0.0; n_assets];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1117:54
|
|
|
|
|
1117 | correlations[i * n_assets + j] = 1.0;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1162:38
|
|
|
|
|
1162 | let mut num_array = [0.0; 4];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1163:39
|
|
|
|
|
1163 | let mut sq_i_array = [0.0; 4];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1164:39
|
|
|
|
|
1164 | let mut sq_j_array = [0.0; 4];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1189:21
|
|
|
|
|
1189 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1110:24
|
|
|
|
|
1110 | means[i] = returns[i].iter().sum::<f64>() / n_periods as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/mod.rs:1110:57
|
|
|
|
|
1110 | means[i] = returns[i].iter().sum::<f64>() / n_periods as f64;
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1117:34
|
|
|
|
|
1117 | correlations[i * n_assets + j] = 1.0;
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1132:23
|
|
|
|
|
1132 | while t + 4 <= n_periods {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1135:36
|
|
|
|
|
1135 | returns[i][t + 3],
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1136:36
|
|
|
|
|
1136 | returns[i][t + 2],
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1137:36
|
|
|
|
|
1137 | returns[i][t + 1],
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1141:36
|
|
|
|
|
1141 | returns[j][t + 3],
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1142:36
|
|
|
|
|
1142 | returns[j][t + 2],
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1143:36
|
|
|
|
|
1143 | returns[j][t + 1],
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1158:21
|
|
|
|
|
1158 | t += 4;
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: `t` shadows a previous, unrelated binding
|
|
--> trading_engine/src/simd/mod.rs:1175:21
|
|
|
|
|
1175 | for t in t..n_periods {
|
|
| ^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/simd/mod.rs:1131:21
|
|
|
|
|
1131 | let mut t = 0;
|
|
| ^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
|
|
= note: requested on the command line with `-D clippy::shadow-unrelated`
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1176:33
|
|
|
|
|
1176 | let dev_i = returns[i][t] - mean_i;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1177:33
|
|
|
|
|
1177 | let dev_j = returns[j][t] - mean_j;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1179:21
|
|
|
|
|
1179 | total_numerator += dev_i * dev_j;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1180:21
|
|
|
|
|
1180 | total_sq_i += dev_i * dev_i;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1181:21
|
|
|
|
|
1181 | total_sq_j += dev_j * dev_j;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1185:35
|
|
|
|
|
1185 | let denominator = (total_sq_i * total_sq_j).sqrt();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1187:21
|
|
|
|
|
1187 | total_numerator / denominator
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1193:30
|
|
|
|
|
1193 | correlations[i * n_assets + j] = correlation;
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1194:30
|
|
|
|
|
1194 | correlations[j * n_assets + i] = correlation;
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unsafe function's docs are missing a `# Safety` section
|
|
--> trading_engine/src/simd/mod.rs:1202:5
|
|
|
|
|
1202 | / pub unsafe fn calculate_expected_shortfall(
|
|
1203 | | &self,
|
|
1204 | | returns: &[f64],
|
|
1205 | | confidence_level: f64,
|
|
1206 | | ) -> f64 {
|
|
| |____________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1230:27
|
|
|
|
|
1230 | let var_index = ((1.0 - confidence_level) * returns.len() as f64) as usize;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1246:30
|
|
|
|
|
1246 | let mut sum_array = [0.0; 4];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: use Option::map_or_else instead of an if let/else
|
|
--> trading_engine/src/simd/mod.rs:1215:13
|
|
|
|
|
1215 | / match a.partial_cmp(b) {
|
|
1216 | | Some(ordering) => ordering,
|
|
1217 | | None => {
|
|
... |
|
|
1226 | | },
|
|
1227 | | }
|
|
| |_____________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
|
|
help: try
|
|
|
|
|
1215 ~ a.partial_cmp(b).map_or_else(|| if a.is_nan() && b.is_nan() {
|
|
1216 + Ordering::Equal
|
|
1217 + } else if a.is_nan() {
|
|
1218 + Ordering::Less // NaN is "worse" (comes first)
|
|
1219 + } else {
|
|
1220 + Ordering::Greater
|
|
1221 + }, |ordering| ordering)
|
|
|
|
|
|
|
warning: casting `f64` to `usize` may lose the sign of the value
|
|
--> trading_engine/src/simd/mod.rs:1230:25
|
|
|
|
|
1230 | let var_index = ((1.0 - confidence_level) * returns.len() as f64) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_sign_loss
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/mod.rs:1230:25
|
|
|
|
|
1230 | let var_index = ((1.0 - confidence_level) * returns.len() as f64) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1230:25
|
|
|
|
|
1230 | let var_index = ((1.0 - confidence_level) * returns.len() as f64) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/mod.rs:1230:53
|
|
|
|
|
1230 | let var_index = ((1.0 - confidence_level) * returns.len() as f64) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1239:15
|
|
|
|
|
1239 | while i + 4 <= var_index {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1242:13
|
|
|
|
|
1242 | i += 4;
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: the loop variable `j` is only used to index `sorted_returns`
|
|
--> trading_engine/src/simd/mod.rs:1251:18
|
|
|
|
|
1251 | for j in i..var_index {
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
|
|
= note: `#[warn(clippy::needless_range_loop)]` implied by `#[warn(clippy::style)]`
|
|
help: consider using an iterator
|
|
|
|
|
1251 - for j in i..var_index {
|
|
1251 + for <item> in sorted_returns.iter().take(var_index).skip(i) {
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1252:13
|
|
|
|
|
1252 | total_sum += sorted_returns[j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1257:13
|
|
|
|
|
1257 | total_sum / var_index as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/mod.rs:1257:25
|
|
|
|
|
1257 | total_sum / var_index as f64
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1374:29
|
|
|
|
|
1374 | let mut pv_array = [0.0; 4];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1375:30
|
|
|
|
|
1375 | let mut vol_array = [0.0; 4];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1337:15
|
|
|
|
|
1337 | while i + 16 <= len {
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1339:59
|
|
|
|
|
1339 | SimdPrefetch::prefetch_range(prices.as_ptr(), i + 16, 2);
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1340:60
|
|
|
|
|
1340 | SimdPrefetch::prefetch_range(volumes.as_ptr(), i + 16, 2);
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1343:26
|
|
|
|
|
1343 | for j in (i..i + 16).step_by(4) {
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1355:13
|
|
|
|
|
1355 | i += 16;
|
|
| ^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1359:15
|
|
|
|
|
1359 | while i + 4 <= len {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1370:13
|
|
|
|
|
1370 | i += 4;
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1379:22
|
|
|
|
|
1379 | let pv_sum = pv_array[0] + pv_array[1] + pv_array[2] + pv_array[3];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1380:23
|
|
|
|
|
1380 | let vol_sum = vol_array[0] + vol_array[1] + vol_array[2] + vol_array[3];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1387:13
|
|
|
|
|
1387 | total_pv += prices[j] * volumes[j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1388:13
|
|
|
|
|
1388 | total_volume += volumes[j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1393:13
|
|
|
|
|
1393 | total_pv / total_volume
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: unsafe function's docs are missing a `# Safety` section
|
|
--> trading_engine/src/simd/mod.rs:1401:5
|
|
|
|
|
1401 | / pub unsafe fn calculate_multi_period_sma(
|
|
1402 | | &self,
|
|
1403 | | prices: &[f64],
|
|
1404 | | periods: &[usize; 4], // Calculate 4 different SMAs simultaneously
|
|
1405 | | results: &mut [Vec<f64>; 4],
|
|
1406 | | ) {
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1425:29
|
|
|
|
|
1425 | let mut sums = [0.0; 4];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1444:46
|
|
|
|
|
1444 | let mut sum_array = [0.0; 4];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1420:60
|
|
|
|
|
1420 | results[i].reserve(prices.len().saturating_sub(periods[i] - 1));
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1424:26
|
|
|
|
|
1424 | for start_idx in max_period - 1..prices.len() {
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1429:20
|
|
|
|
|
1429 | if start_idx + 1 >= periods[i] {
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1430:40
|
|
|
|
|
1430 | let window_start = start_idx + 1 - periods[i];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1437:31
|
|
|
|
|
1437 | while j + 4 <= start_idx + 1 {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1437:40
|
|
|
|
|
1437 | while j + 4 <= start_idx + 1 {
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1440:29
|
|
|
|
|
1440 | ... j += 4;
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: the loop variable `k` is only used to index `prices`
|
|
--> trading_engine/src/simd/mod.rs:1449:34
|
|
|
|
|
1449 | for k in j..=start_idx {
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
|
|
help: consider using an iterator
|
|
|
|
|
1449 - for k in j..=start_idx {
|
|
1449 + for <item> in prices.iter().take(start_idx + 1).skip(j) {
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1450:29
|
|
|
|
|
1450 | ... sums[i] += prices[k];
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: the loop variable `k` is only used to index `prices`
|
|
--> trading_engine/src/simd/mod.rs:1454:34
|
|
|
|
|
1454 | for k in window_start..=start_idx {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
|
|
help: consider using an iterator
|
|
|
|
|
1454 - for k in window_start..=start_idx {
|
|
1454 + for <item> in prices.iter().take(start_idx + 1).skip(window_start) {
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1455:29
|
|
|
|
|
1455 | ... sums[i] += prices[k];
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1460:37
|
|
|
|
|
1460 | results[i].push(sums[i] / periods[i] as f64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/mod.rs:1460:47
|
|
|
|
|
1460 | results[i].push(sums[i] / periods[i] as f64);
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: unsafe function's docs are missing a `# Safety` section
|
|
--> trading_engine/src/simd/mod.rs:1468:5
|
|
|
|
|
1468 | / pub unsafe fn detect_price_anomalies(
|
|
1469 | | &self,
|
|
1470 | | prices: &[f64],
|
|
1471 | | threshold_std_devs: f64,
|
|
1472 | | anomalies: &mut Vec<usize>,
|
|
1473 | | ) {
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1490:30
|
|
|
|
|
1490 | let mut sum_array = [0.0; 4];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1543:34
|
|
|
|
|
1543 | if (mask_bits & (1 << j)) != 0 {
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1543:46
|
|
|
|
|
1543 | if (mask_bits & (1 << j)) != 0 {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1484:15
|
|
|
|
|
1484 | while i + 4 <= prices.len() {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1487:13
|
|
|
|
|
1487 | i += 4;
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: the loop variable `j` is only used to index `prices`
|
|
--> trading_engine/src/simd/mod.rs:1494:18
|
|
|
|
|
1494 | for j in i..prices.len() {
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
|
|
help: consider using an iterator
|
|
|
|
|
1494 - for j in i..prices.len() {
|
|
1494 + for <item> in prices.iter().skip(i) {
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1495:13
|
|
|
|
|
1495 | total_sum += prices[j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1498:20
|
|
|
|
|
1498 | let mean = total_sum / prices.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/mod.rs:1498:32
|
|
|
|
|
1498 | let mean = total_sum / prices.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1505:15
|
|
|
|
|
1505 | while i + 4 <= prices.len() {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1510:13
|
|
|
|
|
1510 | i += 4;
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: the loop variable `j` is only used to index `prices`
|
|
--> trading_engine/src/simd/mod.rs:1516:18
|
|
|
|
|
1516 | for j in i..prices.len() {
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
|
|
help: consider using an iterator
|
|
|
|
|
1516 - for j in i..prices.len() {
|
|
1516 + for <item> in prices.iter().skip(i) {
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1517:24
|
|
|
|
|
1517 | let diff = prices[j] - mean;
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1518:13
|
|
|
|
|
1518 | total_sq_diff += diff * diff;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1521:24
|
|
|
|
|
1521 | let variance = total_sq_diff / prices.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/mod.rs:1521:40
|
|
|
|
|
1521 | let variance = total_sq_diff / prices.len() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1523:25
|
|
|
|
|
1523 | let threshold = std_dev * threshold_std_devs;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1527:48
|
|
|
|
|
1527 | let neg_threshold_vec = _mm256_set1_pd(-threshold);
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1530:15
|
|
|
|
|
1530 | while i + 4 <= prices.len() {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1544:36
|
|
|
|
|
1544 | anomalies.push(i + j);
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1548:13
|
|
|
|
|
1548 | i += 4;
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: the loop variable `j` is used to index `prices`
|
|
--> trading_engine/src/simd/mod.rs:1552:18
|
|
|
|
|
1552 | for j in i..prices.len() {
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
|
|
help: consider using an iterator and enumerate()
|
|
|
|
|
1552 - for j in i..prices.len() {
|
|
1552 + for (j, <item>) in prices.iter().enumerate().skip(i) {
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1553:24
|
|
|
|
|
1553 | let diff = (prices[j] - mean).abs();
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: unsafe function's docs are missing a `# Safety` section
|
|
--> trading_engine/src/simd/mod.rs:1616:5
|
|
|
|
|
1616 | pub unsafe fn batch_min_prices_sse2(&self, prices: &[f64], results: &mut [f64]) -> bool {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1617:53
|
|
|
|
|
1617 | if prices.len() % 2 != 0 || prices.len() != results.len() * 2 {
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1635:40
|
|
|
|
|
1635 | _mm_storeu_pd(&mut results[chunk_idx * 2], min_result);
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1641:29
|
|
|
|
|
1641 | let start_idx = prices.len() - remaining;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1643:20
|
|
|
|
|
1643 | if i + 1 < prices.len() && i / 2 < results.len() {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/simd/mod.rs:1643:44
|
|
|
|
|
1643 | if i + 1 < prices.len() && i / 2 < results.len() {
|
|
| ^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1644:59
|
|
|
|
|
1644 | results[i / 2] = prices[i].min(prices[i + 1]);
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/simd/mod.rs:1644:29
|
|
|
|
|
1644 | results[i / 2] = prices[i].min(prices[i + 1]);
|
|
| ^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: unsafe function's docs are missing a `# Safety` section
|
|
--> trading_engine/src/simd/mod.rs:1654:5
|
|
|
|
|
1654 | pub unsafe fn calculate_vwap_sse2(&self, prices: &[f64], volumes: &[f64]) -> f64 {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1686:29
|
|
|
|
|
1686 | let mut pv_array = [0.0; 2];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1687:30
|
|
|
|
|
1687 | let mut vol_array = [0.0; 2];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1671:15
|
|
|
|
|
1671 | while i + 2 <= len {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1682:13
|
|
|
|
|
1682 | i += 2;
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1696:13
|
|
|
|
|
1696 | total_pv += prices[i] * volumes[i];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1697:13
|
|
|
|
|
1697 | total_volume += volumes[i];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1702:13
|
|
|
|
|
1702 | total_pv / total_volume
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/simd/mod.rs:1738:61
|
|
|
|
|
1738 | if prices.len() % 4 != 0 || prices.len() != results.len() * 4 {
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1772:84
|
|
|
|
|
1772 | let total_pv: f64 = prices.iter().zip(volumes.iter()).map(|(p, v)| p * v).sum();
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1776:21
|
|
|
|
|
1776 | total_pv / total_volume
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1813:18
|
|
|
|
|
1813 | for _ in 0..100 {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1813:21
|
|
|
|
|
1813 | for _ in 0..100 {
|
|
| ^^^ help: consider adding suffix: `100_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/mod.rs:1839:22
|
|
|
|
|
1839 | if speedup < 2.0 {
|
|
| ^^^ help: consider adding suffix: `2.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: `start` shadows a previous, unrelated binding
|
|
--> trading_engine/src/simd/mod.rs:1826:13
|
|
|
|
|
1826 | let start = Instant::now();
|
|
| ^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/simd/mod.rs:1819:13
|
|
|
|
|
1819 | let start = Instant::now();
|
|
| ^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/mod.rs:1832:23
|
|
|
|
|
1832 | let speedup = scalar_duration.as_nanos() as f64 / simd_duration.as_nanos() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/mod.rs:1832:23
|
|
|
|
|
1832 | let speedup = scalar_duration.as_nanos() as f64 / simd_duration.as_nanos() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/mod.rs:1832:59
|
|
|
|
|
1832 | let speedup = scalar_duration.as_nanos() as f64 / simd_duration.as_nanos() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/simd/performance_test.rs:12:5
|
|
|
|
|
12 | /// PerformanceResult
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
12 - /// PerformanceResult
|
|
12 + /// `PerformanceResult`
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/performance_test.rs:35:13
|
|
|
|
|
35 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/performance_test.rs:37:33
|
|
|
|
|
37 | let passed = speedup >= 2.0;
|
|
| ^^^ help: consider adding suffix: `2.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/performance_test.rs:33:13
|
|
|
|
|
33 | scalar_time_ns as f64 / simd_time_ns as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/performance_test.rs:33:13
|
|
|
|
|
33 | scalar_time_ns as f64 / simd_time_ns as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/performance_test.rs:33:37
|
|
|
|
|
33 | scalar_time_ns as f64 / simd_time_ns as f64
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/simd/performance_test.rs:51:5
|
|
|
|
|
51 | /// generate_test_data
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
51 - /// generate_test_data
|
|
51 + /// `generate_test_data`
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/performance_test.rs:58:26
|
|
|
|
|
58 | let mut base_price = 100.0;
|
|
| ^^^^^ help: consider adding suffix: `100.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/performance_test.rs:69:38
|
|
|
|
|
69 | let price_change = (random - 0.5) * 0.002;
|
|
| ^^^ help: consider adding suffix: `0.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/performance_test.rs:69:45
|
|
|
|
|
69 | let price_change = (random - 0.5) * 0.002;
|
|
| ^^^^^ help: consider adding suffix: `0.002_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/performance_test.rs:70:23
|
|
|
|
|
70 | base_price *= 1.0 + price_change;
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/performance_test.rs:66:22
|
|
|
|
|
66 | let random = (rng_state as f64) / (u64::MAX as f64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/performance_test.rs:66:22
|
|
|
|
|
66 | let random = (rng_state as f64) / (u64::MAX as f64);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/performance_test.rs:66:43
|
|
|
|
|
66 | let random = (rng_state as f64) / (u64::MAX as f64);
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/performance_test.rs:69:28
|
|
|
|
|
69 | let price_change = (random - 0.5) * 0.002;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/performance_test.rs:70:9
|
|
|
|
|
70 | base_price *= 1.0 + price_change;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/performance_test.rs:77:26
|
|
|
|
|
77 | let vol_random = (rng_state as f64) / (u64::MAX as f64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/performance_test.rs:77:26
|
|
|
|
|
77 | let vol_random = (rng_state as f64) / (u64::MAX as f64);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/performance_test.rs:77:47
|
|
|
|
|
77 | let vol_random = (rng_state as f64) / (u64::MAX as f64);
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/simd/performance_test.rs:86:5
|
|
|
|
|
86 | /// scalar_vwap
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
86 - /// scalar_vwap
|
|
86 + /// `scalar_vwap`
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/performance_test.rs:94:27
|
|
|
|
|
94 | let mut total_value = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/performance_test.rs:95:28
|
|
|
|
|
95 | let mut total_volume = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/performance_test.rs:98:9
|
|
|
|
|
98 | total_value += prices[i] * volumes[i];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/performance_test.rs:99:9
|
|
|
|
|
99 | total_volume += volumes[i];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/performance_test.rs:103:9
|
|
|
|
|
103 | total_value / total_volume
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/simd/performance_test.rs:111:5
|
|
|
|
|
111 | /// validate_simd_performance
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
111 - /// validate_simd_performance
|
|
111 + /// `validate_simd_performance`
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/performance_test.rs:132:26
|
|
|
|
|
132 | let iterations = 1000;
|
|
| ^^^^ help: consider adding suffix: `1_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/performance_test.rs:135:18
|
|
|
|
|
135 | for _ in 0..10 {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/performance_test.rs:135:21
|
|
|
|
|
135 | for _ in 0..10 {
|
|
| ^^ help: consider adding suffix: `10_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/performance_test.rs:151:18
|
|
|
|
|
151 | for _ in 0..iterations {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/performance_test.rs:158:18
|
|
|
|
|
158 | for _ in 0..iterations {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/performance_test.rs:190:18
|
|
|
|
|
190 | for _ in 0..10 {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/performance_test.rs:190:21
|
|
|
|
|
190 | for _ in 0..10 {
|
|
| ^^ help: consider adding suffix: `10_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/performance_test.rs:206:18
|
|
|
|
|
206 | for _ in 0..iterations {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/performance_test.rs:213:18
|
|
|
|
|
213 | for _ in 0..iterations {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/simd/performance_test.rs:253:9
|
|
|
|
|
253 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/simd/performance_test.rs:117:5
|
|
|
|
|
117 | println!("\u{1f680} SIMD Performance Validation Starting...");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
= note: requested on the command line with `-W clippy::print-stdout`
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/simd/performance_test.rs:118:5
|
|
|
|
|
118 | println!("Target: 2x+ speedup improvement");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/simd/performance_test.rs:119:5
|
|
|
|
|
119 | println!();
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/simd/performance_test.rs:122:9
|
|
|
|
|
122 | println!("\u{274c} AVX2 not available - cannot validate SIMD performance");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/simd/performance_test.rs:128:9
|
|
|
|
|
128 | println!("Testing with {size} elements:");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
error: non-binding `let` on a result of a `#[must_use]` function
|
|
--> trading_engine/src/simd/performance_test.rs:136:13
|
|
|
|
|
136 | let _ = scalar_vwap(&prices, &volumes);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider explicitly using function result
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
|
|
= note: requested on the command line with `-D clippy::let-underscore-must-use`
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/simd/performance_test.rs:143:13
|
|
|
|
|
143 | / unsafe {
|
|
144 | | let market_ops = SimdMarketDataOps::new();
|
|
145 | | let _ = market_ops.calculate_vwap(&prices, &volumes);
|
|
146 | | }
|
|
| |_____________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/simd/performance_test.rs:144:34
|
|
|
|
|
144 | let market_ops = SimdMarketDataOps::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/simd/performance_test.rs:145:25
|
|
|
|
|
145 | let _ = market_ops.calculate_vwap(&prices, &volumes);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
error: non-binding `let` on a result of a `#[must_use]` function
|
|
--> trading_engine/src/simd/performance_test.rs:152:13
|
|
|
|
|
152 | let _ = scalar_vwap(&prices, &volumes);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider explicitly using function result
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/performance_test.rs:154:27
|
|
|
|
|
154 | let scalar_time = start.elapsed().as_nanos() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `start` shadows a previous, unrelated binding
|
|
--> trading_engine/src/simd/performance_test.rs:157:13
|
|
|
|
|
157 | let start = Instant::now();
|
|
| ^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/simd/performance_test.rs:150:13
|
|
|
|
|
150 | let start = Instant::now();
|
|
| ^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/simd/performance_test.rs:165:13
|
|
|
|
|
165 | / unsafe {
|
|
166 | | let market_ops = SimdMarketDataOps::new();
|
|
167 | | let _ = market_ops.calculate_vwap(&prices, &volumes);
|
|
168 | | }
|
|
| |_____________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/simd/performance_test.rs:166:34
|
|
|
|
|
166 | let market_ops = SimdMarketDataOps::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/simd/performance_test.rs:167:25
|
|
|
|
|
167 | let _ = market_ops.calculate_vwap(&prices, &volumes);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/performance_test.rs:170:25
|
|
|
|
|
170 | let simd_time = start.elapsed().as_nanos() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/simd/performance_test.rs:174:9
|
|
|
|
|
174 | / println!(
|
|
175 | | " VWAP: {:.2}x speedup - {}",
|
|
176 | | vwap_result.speedup,
|
|
177 | | if vwap_result.passed {
|
|
... |
|
|
182 | | );
|
|
| |_________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
error: non-binding `let` on a result of a `#[must_use]` function
|
|
--> trading_engine/src/simd/performance_test.rs:191:13
|
|
|
|
|
191 | let _ = scalar_vwap(&prices, &volumes);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider explicitly using function result
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/simd/performance_test.rs:198:13
|
|
|
|
|
198 | / unsafe {
|
|
199 | | let price_ops = SimdPriceOps::new();
|
|
200 | | let _ = price_ops.calculate_vwap_aligned(&aligned_prices, &aligned_volumes);
|
|
201 | | }
|
|
| |_____________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/simd/performance_test.rs:199:33
|
|
|
|
|
199 | let price_ops = SimdPriceOps::new();
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/simd/performance_test.rs:200:25
|
|
|
|
|
200 | let _ = price_ops.calculate_vwap_aligned(&aligned_prices, &aligned_volumes);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
error: `start` shadows a previous, unrelated binding
|
|
--> trading_engine/src/simd/performance_test.rs:205:13
|
|
|
|
|
205 | let start = Instant::now();
|
|
| ^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/simd/performance_test.rs:157:13
|
|
|
|
|
157 | let start = Instant::now();
|
|
| ^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
|
|
|
|
error: non-binding `let` on a result of a `#[must_use]` function
|
|
--> trading_engine/src/simd/performance_test.rs:207:13
|
|
|
|
|
207 | let _ = scalar_vwap(&prices, &volumes);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider explicitly using function result
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/performance_test.rs:209:35
|
|
|
|
|
209 | let scalar_time_aligned = start.elapsed().as_nanos() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `start` shadows a previous, unrelated binding
|
|
--> trading_engine/src/simd/performance_test.rs:212:13
|
|
|
|
|
212 | let start = Instant::now();
|
|
| ^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/simd/performance_test.rs:205:13
|
|
|
|
|
205 | let start = Instant::now();
|
|
| ^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/simd/performance_test.rs:220:13
|
|
|
|
|
220 | / unsafe {
|
|
221 | | let price_ops = SimdPriceOps::new();
|
|
222 | | let _ = price_ops.calculate_vwap_aligned(&aligned_prices, &aligned_volumes);
|
|
223 | | }
|
|
| |_____________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/simd/performance_test.rs:221:33
|
|
|
|
|
221 | let price_ops = SimdPriceOps::new();
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/simd/performance_test.rs:222:25
|
|
|
|
|
222 | let _ = price_ops.calculate_vwap_aligned(&aligned_prices, &aligned_volumes);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/performance_test.rs:225:33
|
|
|
|
|
225 | let simd_time_aligned = start.elapsed().as_nanos() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/simd/performance_test.rs:233:9
|
|
|
|
|
233 | / println!(
|
|
234 | | " VWAP Aligned: {:.2}x speedup - {}",
|
|
235 | | vwap_aligned_result.speedup,
|
|
236 | | if vwap_aligned_result.passed {
|
|
... |
|
|
241 | | );
|
|
| |_________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/simd/performance_test.rs:244:9
|
|
|
|
|
244 | println!();
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/simd/performance_test.rs:251:9
|
|
|
|
|
251 | results.iter().map(|r| r.speedup).sum::<f64>() / total_tests as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/simd/performance_test.rs:251:58
|
|
|
|
|
251 | results.iter().map(|r| r.speedup).sum::<f64>() / total_tests as f64
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/simd/performance_test.rs:256:5
|
|
|
|
|
256 | println!("\u{1f4ca} PERFORMANCE VALIDATION SUMMARY");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/simd/performance_test.rs:257:5
|
|
|
|
|
257 | println!("================================");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/simd/performance_test.rs:258:5
|
|
|
|
|
258 | println!("Tests passed: {passed_tests}/{total_tests}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/simd/performance_test.rs:259:5
|
|
|
|
|
259 | println!("Average speedup: {average_speedup:.2}x");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/simd/performance_test.rs:262:9
|
|
|
|
|
262 | println!("\u{1f389} ALL TESTS PASSED! SIMD optimization successful.");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/simd/performance_test.rs:264:9
|
|
|
|
|
264 | println!("\u{26a0}\u{fe0f} Some tests failed. SIMD optimization needs improvement.");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/simd/performance_test.rs:268:17
|
|
|
|
|
268 | / println!(
|
|
269 | | " \u{274c} {}: {:.2}x (target: 2.0x)",
|
|
270 | | result.test_name, result.speedup
|
|
271 | | );
|
|
| |_________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/affinity.rs:37:5
|
|
|
|
|
37 | /// CpuTopology
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/affinity.rs:17:5
|
|
|
|
|
17 | clippy::pedantic,
|
|
| ^^^^^^^^^^^^^^^^
|
|
help: try
|
|
|
|
|
37 - /// CpuTopology
|
|
37 + /// `CpuTopology`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/affinity.rs:73:5
|
|
|
|
|
73 | /// MemoryPolicy
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
73 - /// MemoryPolicy
|
|
73 + /// `MemoryPolicy`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/affinity.rs:89:5
|
|
|
|
|
89 | /// CpuAffinityManager
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
89 - /// CpuAffinityManager
|
|
89 + /// `CpuAffinityManager`
|
|
|
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/affinity.rs:121:5
|
|
|
|
|
121 | pub fn new() -> Result<Self, &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: doc list item without indentation
|
|
--> trading_engine/src/affinity.rs:141:9
|
|
|
|
|
141 | /// Detect enhanced CPU topology with NUMA and cache awareness
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/affinity.rs:21:5
|
|
|
|
|
21 | clippy::style,
|
|
| ^^^^^^^^^^^^^
|
|
= note: `#[warn(clippy::doc_lazy_continuation)]` implied by `#[warn(clippy::style)]`
|
|
help: indent this line
|
|
|
|
|
141 | /// Detect enhanced CPU topology with NUMA and cache awareness
|
|
| ++
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> trading_engine/src/affinity.rs:162:5
|
|
|
|
|
162 | fn detect_linux_topology() -> Result<CpuTopology, &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
= note: `#[warn(clippy::unnecessary_wraps)]` implied by `#[warn(clippy::pedantic)]`
|
|
help: remove `Result` from the return type...
|
|
|
|
|
162 - fn detect_linux_topology() -> Result<CpuTopology, &'static str> {
|
|
162 + fn detect_linux_topology() -> affinity::CpuTopology {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
248 - Ok(topology)
|
|
248 + topology
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/affinity.rs:179:43
|
|
|
|
|
179 | topology.physical_cores = topology.logical_cores / siblings_count.max(1);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/affinity.rs:179:43
|
|
|
|
|
179 | topology.physical_cores = topology.logical_cores / siblings_count.max(1);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used
|
|
--> trading_engine/src/affinity.rs:188:13
|
|
|
|
|
188 | / for entry in entries {
|
|
189 | | if let Ok(entry) = entry {
|
|
190 | | let name = entry.file_name();
|
|
191 | | if let Some(name_str) = name.to_str() {
|
|
... |
|
|
206 | | }
|
|
| |_____________^
|
|
|
|
|
help: try `.flatten()` and remove the `if let` statement in the for loop
|
|
--> trading_engine/src/affinity.rs:189:17
|
|
|
|
|
189 | / if let Ok(entry) = entry {
|
|
190 | | let name = entry.file_name();
|
|
191 | | if let Some(name_str) = name.to_str() {
|
|
192 | | if name_str.starts_with("node") {
|
|
... |
|
|
205 | | }
|
|
| |_________________^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/affinity.rs:20:5
|
|
|
|
|
20 | clippy::complexity,
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
= note: `#[warn(clippy::manual_flatten)]` implied by `#[warn(clippy::complexity)]`
|
|
help: try
|
|
|
|
|
188 ~ for entry in entries.flatten() {
|
|
189 + let name = entry.file_name();
|
|
190 + if let Some(name_str) = name.to_str() {
|
|
191 + if name_str.starts_with("node") {
|
|
192 + if let Ok(node_id) = name_str[4..].parse::<usize>() {
|
|
193 + numa_nodes = numa_nodes.max(node_id + 1);
|
|
194 +
|
|
195 + // Read CPUs for this node
|
|
196 + let cpulist_path = entry.path().join("cpulist");
|
|
197 + if let Ok(cpulist) = fs::read_to_string(cpulist_path) {
|
|
198 + let cores = Self::parse_cpu_list(cpulist.trim());
|
|
199 + numa_mapping.insert(node_id, cores);
|
|
200 + }
|
|
201 + }
|
|
202 + }
|
|
203 + }
|
|
204 + }
|
|
|
|
|
|
|
error: `entry` is shadowed
|
|
--> trading_engine/src/affinity.rs:189:27
|
|
|
|
|
189 | if let Ok(entry) = entry {
|
|
| ^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/affinity.rs:188:17
|
|
|
|
|
188 | for entry in entries {
|
|
| ^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_reuse
|
|
= note: requested on the command line with `-D clippy::shadow-reuse`
|
|
|
|
warning: stripping a prefix manually
|
|
--> trading_engine/src/affinity.rs:193:50
|
|
|
|
|
193 | ... if let Ok(node_id) = name_str[4..].parse::<usize>() {
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
note: the prefix was tested here
|
|
--> trading_engine/src/affinity.rs:192:25
|
|
|
|
|
192 | if name_str.starts_with("node") {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip
|
|
= note: `#[warn(clippy::manual_strip)]` implied by `#[warn(clippy::complexity)]`
|
|
help: try using the `strip_prefix` method
|
|
|
|
|
192 ~ if let Some(<stripped>) = name_str.strip_prefix("node") {
|
|
193 ~ if let Ok(node_id) = <stripped>.parse::<usize>() {
|
|
|
|
|
|
|
error: indexing into a string may panic if the index is within a UTF-8 character
|
|
--> trading_engine/src/affinity.rs:193:50
|
|
|
|
|
193 | ... if let Ok(node_id) = name_str[4..].parse::<usize>() {
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#string_slice
|
|
= note: requested on the command line with `-D clippy::string-slice`
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/affinity.rs:194:61
|
|
|
|
|
194 | ... numa_nodes = numa_nodes.max(node_id + 1);
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used
|
|
--> trading_engine/src/affinity.rs:217:13
|
|
|
|
|
217 | / for entry in entries {
|
|
218 | | if let Ok(entry) = entry {
|
|
219 | | let name = entry.file_name();
|
|
220 | | if let Some(name_str) = name.to_str() {
|
|
... |
|
|
241 | | }
|
|
| |_____________^
|
|
|
|
|
help: try `.flatten()` and remove the `if let` statement in the for loop
|
|
--> trading_engine/src/affinity.rs:218:17
|
|
|
|
|
218 | / if let Ok(entry) = entry {
|
|
219 | | let name = entry.file_name();
|
|
220 | | if let Some(name_str) = name.to_str() {
|
|
221 | | if name_str.starts_with("cpu")
|
|
... |
|
|
240 | | }
|
|
| |_________________^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten
|
|
help: try
|
|
|
|
|
217 ~ for entry in entries.flatten() {
|
|
218 + let name = entry.file_name();
|
|
219 + if let Some(name_str) = name.to_str() {
|
|
220 + if name_str.starts_with("cpu")
|
|
221 + && name_str[3..].chars().all(|c| c.is_ascii_digit())
|
|
222 + {
|
|
223 + if let Ok(cpu_id) = name_str[3..].parse::<usize>() {
|
|
224 + let scaling_path = entry.path().join("cpufreq/scaling_max_freq");
|
|
225 + if let Ok(max_freq) = fs::read_to_string(scaling_path) {
|
|
226 + if let Ok(freq) = max_freq.trim().parse::<u64>() {
|
|
227 + // Heuristic: higher max frequency = performance core
|
|
228 + if freq > 3_000_000 {
|
|
229 + // 3GHz threshold
|
|
230 + perf_cores.push(cpu_id);
|
|
231 + } else {
|
|
232 + eff_cores.push(cpu_id);
|
|
233 + }
|
|
234 + }
|
|
235 + }
|
|
236 + }
|
|
237 + }
|
|
238 + }
|
|
239 + }
|
|
|
|
|
|
|
error: `entry` is shadowed
|
|
--> trading_engine/src/affinity.rs:218:27
|
|
|
|
|
218 | if let Ok(entry) = entry {
|
|
| ^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/affinity.rs:217:17
|
|
|
|
|
217 | for entry in entries {
|
|
| ^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_reuse
|
|
|
|
error: indexing into a string may panic if the index is within a UTF-8 character
|
|
--> trading_engine/src/affinity.rs:222:32
|
|
|
|
|
222 | ... && name_str[3..].chars().all(|c| c.is_ascii_digit())
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#string_slice
|
|
|
|
error: indexing into a string may panic if the index is within a UTF-8 character
|
|
--> trading_engine/src/affinity.rs:224:49
|
|
|
|
|
224 | ... if let Ok(cpu_id) = name_str[3..].parse::<usize>() {
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#string_slice
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/affinity.rs:260:26
|
|
|
|
|
260 | (range[0].parse::<usize>(), range[1].parse::<usize>())
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/affinity.rs:14:5
|
|
|
|
|
14 | clippy::indexing_slicing
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/affinity.rs:260:53
|
|
|
|
|
260 | (range[0].parse::<usize>(), range[1].parse::<usize>())
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: use of `File::read_to_string`
|
|
--> trading_engine/src/affinity.rs:295:20
|
|
|
|
|
295 | if file.read_to_string(&mut cmdline).is_err() {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `fs::read_to_string` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#verbose_file_reads
|
|
= note: requested on the command line with `-D clippy::verbose-file-reads`
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/affinity.rs:337:26
|
|
|
|
|
337 | for i in (cpu_count - 4)..cpu_count {
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/affinity.rs:354:57
|
|
|
|
|
354 | /// - `core_id` - CPU core ID to pin to (must be in isolated_cores)
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
354 - /// - `core_id` - CPU core ID to pin to (must be in isolated_cores)
|
|
354 + /// - `core_id` - CPU core ID to pin to (must be in `isolated_cores`)
|
|
|
|
|
|
|
warning: doc list item without indentation
|
|
--> trading_engine/src/affinity.rs:359:9
|
|
|
|
|
359 | /// Pin current thread to specific CPU core
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
|
|
help: indent this line
|
|
|
|
|
359 | /// Pin current thread to specific CPU core
|
|
| ++
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/affinity.rs:360:5
|
|
|
|
|
360 | pub fn pin_to_core(&mut self, service_name: &str, core_id: usize) -> Result<(), &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/affinity.rs:369:9
|
|
|
|
|
369 | println!("HFT Service '{service_name}' pinned to CPU core {core_id}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: unused `self` argument
|
|
--> trading_engine/src/affinity.rs:385:25
|
|
|
|
|
385 | fn set_cpu_affinity(&self, core_id: usize) -> Result<(), &'static str> {
|
|
| ^^^^^
|
|
|
|
|
= help: consider refactoring to an associated function
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
|
|
= note: `#[warn(clippy::unused_self)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/affinity.rs:397:26
|
|
|
|
|
397 | if result != 0 {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/affinity.rs:386:9
|
|
|
|
|
386 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
= note: requested on the command line with `-W clippy::undocumented-unsafe-blocks`
|
|
|
|
warning: this `unsafe` block contains 4 unsafe operations, expected only one
|
|
--> trading_engine/src/affinity.rs:386:9
|
|
|
|
|
386 | / unsafe {
|
|
387 | | let mut cpu_set: libc::cpu_set_t = std::mem::zeroed();
|
|
388 | | libc::CPU_ZERO(&mut cpu_set);
|
|
389 | | libc::CPU_SET(core_id, &mut cpu_set);
|
|
... |
|
|
400 | | }
|
|
| |_________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/affinity.rs:387:48
|
|
|
|
|
387 | let mut cpu_set: libc::cpu_set_t = std::mem::zeroed();
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/affinity.rs:388:13
|
|
|
|
|
388 | libc::CPU_ZERO(&mut cpu_set);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/affinity.rs:389:13
|
|
|
|
|
389 | libc::CPU_SET(core_id, &mut cpu_set);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/affinity.rs:391:26
|
|
|
|
|
391 | let result = libc::sched_setaffinity(
|
|
| __________________________^
|
|
392 | | 0, // Current thread
|
|
393 | | size_of::<libc::cpu_set_t>(),
|
|
394 | | &cpu_set,
|
|
395 | | );
|
|
| |_____________^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: doc list item without indentation
|
|
--> trading_engine/src/affinity.rs:420:9
|
|
|
|
|
420 | /// Auto-assign cores to HFT services based on priority
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
|
|
help: indent this line
|
|
|
|
|
420 | /// Auto-assign cores to HFT services based on priority
|
|
| +++
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/affinity.rs:421:5
|
|
|
|
|
421 | pub fn auto_assign_hft_services(&mut self) -> Result<HftCoreAssignment, &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/affinity.rs:442:9
|
|
|
|
|
442 | println!("HFT Core Assignment:");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/affinity.rs:443:9
|
|
|
|
|
443 | println!(" Trading Engine: CPU {}", assignment.trading_engine);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/affinity.rs:444:9
|
|
|
|
|
444 | println!(" Risk Management: CPU {}", assignment.risk_management);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/affinity.rs:445:9
|
|
|
|
|
445 | println!(" Market Data: CPU {}", assignment.market_data);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/affinity.rs:447:13
|
|
|
|
|
447 | println!(" Spare Core: CPU {spare}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: doc list item without indentation
|
|
--> trading_engine/src/affinity.rs:465:9
|
|
|
|
|
465 | /// Set process scheduling policy to real-time
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
|
|
help: indent this line
|
|
|
|
|
465 | /// Set process scheduling policy to real-time
|
|
| ++
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/affinity.rs:466:5
|
|
|
|
|
466 | pub fn set_realtime_priority(&self, priority: i32) -> Result<(), &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/affinity.rs:473:26
|
|
|
|
|
473 | if result != 0 {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/affinity.rs:467:9
|
|
|
|
|
467 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/affinity.rs:478:9
|
|
|
|
|
478 | println!("Process set to SCHED_FIFO with priority {priority}");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: doc list item without indentation
|
|
--> trading_engine/src/affinity.rs:490:9
|
|
|
|
|
490 | /// Enable memory locking to prevent swapping
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
|
|
help: indent this line
|
|
|
|
|
490 | /// Enable memory locking to prevent swapping
|
|
| ++
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/affinity.rs:491:5
|
|
|
|
|
491 | pub fn lock_memory(&self) -> Result<(), &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/affinity.rs:494:26
|
|
|
|
|
494 | if result != 0 {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/affinity.rs:492:9
|
|
|
|
|
492 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/affinity.rs:499:9
|
|
|
|
|
499 | println!("Memory locked to prevent swapping");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: doc list item without indentation
|
|
--> trading_engine/src/affinity.rs:511:9
|
|
|
|
|
511 | /// Get current CPU affinity
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
|
|
help: indent this line
|
|
|
|
|
511 | /// Get current CPU affinity
|
|
| ++
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/affinity.rs:512:5
|
|
|
|
|
512 | pub fn get_current_affinity(&self) -> Result<Vec<usize>, &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/affinity.rs:522:26
|
|
|
|
|
522 | if result != 0 {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/affinity.rs:519:9
|
|
|
|
|
519 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/affinity.rs:519:9
|
|
|
|
|
519 | / unsafe {
|
|
520 | | let result = libc::sched_getaffinity(0, size_of::<libc::cpu_set_t>(), &mut cpu_set);
|
|
521 | |
|
|
522 | | if result != 0 {
|
|
... |
|
|
531 | | }
|
|
| |_________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/affinity.rs:520:26
|
|
|
|
|
520 | let result = libc::sched_getaffinity(0, size_of::<libc::cpu_set_t>(), &mut cpu_set);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/affinity.rs:527:20
|
|
|
|
|
527 | if libc::CPU_ISSET(i, &cpu_set) {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/affinity.rs:540:5
|
|
|
|
|
540 | /// HftCoreAssignment
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
540 - /// HftCoreAssignment
|
|
540 + /// `HftCoreAssignment`
|
|
|
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/affinity.rs:556:5
|
|
|
|
|
556 | pub fn apply_for_service(&self, service_name: &str) -> Result<(), &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/affinity.rs:575:1
|
|
|
|
|
575 | pub fn initialize_hft_cpu_optimizations(service_name: &str) -> Result<(), &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/affinity.rs:588:1
|
|
|
|
|
588 | fn disable_cpu_scaling() -> Result<(), &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
588 - fn disable_cpu_scaling() -> Result<(), &'static str> {
|
|
588 + fn disable_cpu_scaling() -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
601 - Ok(())
|
|
|
|
|
|
|
error: non-binding `let` on an expression with `#[must_use]` type
|
|
--> trading_engine/src/affinity.rs:596:13
|
|
|
|
|
596 | let _ = file.write_all(b"performance");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider explicitly using expression value
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/affinity.rs:600:5
|
|
|
|
|
600 | println!("CPU frequency scaling disabled (performance mode)");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:12:5
|
|
|
|
|
12 | /// SequenceGenerator
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/lockfree/mod.rs:30:5
|
|
|
|
|
30 | clippy::pedantic,
|
|
| ^^^^^^^^^^^^^^^^
|
|
help: try
|
|
|
|
|
12 - /// SequenceGenerator
|
|
12 + /// `SequenceGenerator`
|
|
|
|
|
|
|
warning: you have declared `#[inline(always)]` on `next`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:38:5
|
|
|
|
|
38 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `current`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:44:5
|
|
|
|
|
44 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `reset`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:50:5
|
|
|
|
|
50 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:64:5
|
|
|
|
|
64 | /// AtomicFlag
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
64 - /// AtomicFlag
|
|
64 + /// `AtomicFlag`
|
|
|
|
|
|
|
warning: you have declared `#[inline(always)]` on `set`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:89:5
|
|
|
|
|
89 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `clear`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:95:5
|
|
|
|
|
95 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `is_set`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:101:5
|
|
|
|
|
101 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `test_and_set`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:108:5
|
|
|
|
|
108 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `compare_and_swap`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:114:5
|
|
|
|
|
114 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:138:5
|
|
|
|
|
138 | /// AtomicMetrics
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
138 - /// AtomicMetrics
|
|
138 + /// `AtomicMetrics`
|
|
|
|
|
|
|
warning: this method could have a `#[must_use]` attribute
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:153:5
|
|
|
|
|
153 | pub fn new() -> Self {
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn new() -> Self`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:162:17
|
|
|
|
|
162 | / SystemTime::now()
|
|
163 | | .duration_since(UNIX_EPOCH)
|
|
164 | | .unwrap_or_default()
|
|
165 | | .as_nanos() as u64
|
|
| |______________________________________^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:170:42
|
|
|
|
|
170 | /// Record operation time (alias for record_operation for API compatibility)
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
170 - /// Record operation time (alias for record_operation for API compatibility)
|
|
170 + /// Record operation time (alias for `record_operation` for API compatibility)
|
|
|
|
|
|
|
warning: you have declared `#[inline(always)]` on `record_operation_time`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:171:5
|
|
|
|
|
171 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `avg_operation_time_ns`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:177:5
|
|
|
|
|
177 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:181:13
|
|
|
|
|
181 | self.total_latency_ns.load(Ordering::Relaxed) / ops
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:181:13
|
|
|
|
|
181 | self.total_latency_ns.load(Ordering::Relaxed) / ops
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: you have declared `#[inline(always)]` on `operations_per_second`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:188:5
|
|
|
|
|
188 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:199:48
|
|
|
|
|
199 | let elapsed_secs = elapsed_ns as f64 / 1_000_000_000.0;
|
|
| ^^^^^^^^^^^^^^^ help: consider adding suffix: `1_000_000_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:193:22
|
|
|
|
|
193 | let now_ns = SystemTime::now()
|
|
| ______________________^
|
|
194 | | .duration_since(UNIX_EPOCH)
|
|
195 | | .unwrap_or_default()
|
|
196 | | .as_nanos() as u64;
|
|
| |______________________________^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:199:28
|
|
|
|
|
199 | let elapsed_secs = elapsed_ns as f64 / 1_000_000_000.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: casting `u64` to `f64` causes a loss of precision (`u64` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:199:28
|
|
|
|
|
199 | let elapsed_secs = elapsed_ns as f64 / 1_000_000_000.0;
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:199:28
|
|
|
|
|
199 | let elapsed_secs = elapsed_ns as f64 / 1_000_000_000.0;
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:202:13
|
|
|
|
|
202 | ops as f64 / elapsed_secs
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: casting `u64` to `f64` causes a loss of precision (`u64` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:202:13
|
|
|
|
|
202 | ops as f64 / elapsed_secs
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:202:13
|
|
|
|
|
202 | ops as f64 / elapsed_secs
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: you have declared `#[inline(always)]` on `total_operations`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:209:5
|
|
|
|
|
209 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `record_operation`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:215:5
|
|
|
|
|
215 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `record_error`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:263:5
|
|
|
|
|
263 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `record_bytes`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:269:5
|
|
|
|
|
269 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:281:42
|
|
|
|
|
281 | avg_latency_ns: if ops > 0 { total_lat / ops } else { 0 },
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:281:42
|
|
|
|
|
281 | avg_latency_ns: if ops > 0 { total_lat / ops } else { 0 },
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:300:13
|
|
|
|
|
300 | / SystemTime::now()
|
|
301 | | .duration_since(UNIX_EPOCH)
|
|
302 | | .unwrap_or_default()
|
|
303 | | .as_nanos() as u64,
|
|
| |__________________________________^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:331:5
|
|
|
|
|
331 | /// MetricsSnapshot
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
331 - /// MetricsSnapshot
|
|
331 + /// `MetricsSnapshot`
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:355:57
|
|
|
|
|
355 | self.operations_per_second = if duration_secs > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:358:13
|
|
|
|
|
358 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:356:13
|
|
|
|
|
356 | self.operations_count as f64 / duration_secs
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: casting `u64` to `f64` causes a loss of precision (`u64` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:356:13
|
|
|
|
|
356 | self.operations_count as f64 / duration_secs
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:356:13
|
|
|
|
|
356 | self.operations_count as f64 / duration_secs
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:367:13
|
|
|
|
|
367 | (self.bytes_processed as f64 / (1024.0 * 1024.0)) / duration_secs
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: casting `u64` to `f64` causes a loss of precision (`u64` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:367:14
|
|
|
|
|
367 | (self.bytes_processed as f64 / (1024.0 * 1024.0)) / duration_secs
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:367:14
|
|
|
|
|
367 | (self.bytes_processed as f64 / (1024.0 * 1024.0)) / duration_secs
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:377:13
|
|
|
|
|
377 | (self.errors_count as f64 / self.operations_count as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: casting `u64` to `f64` causes a loss of precision (`u64` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:377:14
|
|
|
|
|
377 | (self.errors_count as f64 / self.operations_count as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:377:14
|
|
|
|
|
377 | (self.errors_count as f64 / self.operations_count as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: casting `u64` to `f64` causes a loss of precision (`u64` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:377:41
|
|
|
|
|
377 | (self.errors_count as f64 / self.operations_count as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:377:41
|
|
|
|
|
377 | (self.errors_count as f64 / self.operations_count as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: you have declared `#[inline(always)]` on `full`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:389:5
|
|
|
|
|
389 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `acquire`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:395:5
|
|
|
|
|
395 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `release`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:401:5
|
|
|
|
|
401 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `acq_rel`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/atomic_ops.rs:407:5
|
|
|
|
|
407 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:72:24
|
|
|
|
|
72 | let next = unsafe { (*tail).next.load(Ordering::Acquire) };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:78:24
|
|
|
|
|
78 | if unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
error: non-binding `let` on an expression with `#[must_use]` type
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:90:25
|
|
|
|
|
90 | / let _ = self.tail.compare_exchange_weak(
|
|
91 | | tail,
|
|
92 | | new_node,
|
|
93 | | Ordering::Release,
|
|
94 | | Ordering::Relaxed,
|
|
95 | | );
|
|
| |__________________________^
|
|
|
|
|
= help: consider explicitly using expression value
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
|
|
|
|
error: non-binding `let` on an expression with `#[must_use]` type
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:100:21
|
|
|
|
|
100 | / let _ = self.tail.compare_exchange_weak(
|
|
101 | | tail,
|
|
102 | | next,
|
|
103 | | Ordering::Release,
|
|
104 | | Ordering::Relaxed,
|
|
105 | | );
|
|
| |______________________^
|
|
|
|
|
= help: consider explicitly using expression value
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:118:24
|
|
|
|
|
118 | let next = unsafe { (*head).next.load(Ordering::Acquire) };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
error: non-binding `let` on an expression with `#[must_use]` type
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:128:21
|
|
|
|
|
128 | / let _ = self.tail.compare_exchange_weak(
|
|
129 | | tail,
|
|
130 | | next,
|
|
131 | | Ordering::Release,
|
|
132 | | Ordering::Relaxed,
|
|
133 | | );
|
|
| |______________________^
|
|
|
|
|
= help: consider explicitly using expression value
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:140:32
|
|
|
|
|
140 | let data = unsafe { (*next).data.take() };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:177:13
|
|
|
|
|
177 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
error: non-binding `let` on a result of a `#[must_use]` function
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:178:17
|
|
|
|
|
178 | let _ = Box::from_raw(head);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider explicitly using function result
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:234:13
|
|
|
|
|
234 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:263:13
|
|
|
|
|
263 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:263:13
|
|
|
|
|
263 | / unsafe {
|
|
264 | | let node = Box::from_raw(current);
|
|
265 | | let _ = Box::from_raw(node.ptr);
|
|
266 | | current = node.next;
|
|
267 | | count += 1;
|
|
268 | | }
|
|
| |_____________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:264:28
|
|
|
|
|
264 | let node = Box::from_raw(current);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:265:25
|
|
|
|
|
265 | let _ = Box::from_raw(node.ptr);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
error: non-binding `let` on a result of a `#[must_use]` function
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:265:17
|
|
|
|
|
265 | let _ = Box::from_raw(node.ptr);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider explicitly using function result
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:267:17
|
|
|
|
|
267 | count += 1;
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:283:5
|
|
|
|
|
283 | /// AtomicCounter
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
283 - /// AtomicCounter
|
|
283 + /// `AtomicCounter`
|
|
|
|
|
|
|
warning: you have declared `#[inline(always)]` on `next`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:311:5
|
|
|
|
|
311 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `get`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:317:5
|
|
|
|
|
317 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `reset`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:323:5
|
|
|
|
|
323 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `add`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/mpsc_queue.rs:329:5
|
|
|
|
|
329 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:17:5
|
|
|
|
|
17 | /// LockFreeRingBuffer
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
17 - /// LockFreeRingBuffer
|
|
17 + /// `LockFreeRingBuffer`
|
|
|
|
|
|
|
warning: manual `Debug` impl does not include all fields
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:41:1
|
|
|
|
|
41 | / impl<T> std::fmt::Debug for LockFreeRingBuffer<T> {
|
|
42 | | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
43 | | f.debug_struct("LockFreeRingBuffer")
|
|
44 | | .field("capacity", &self.capacity)
|
|
... |
|
|
51 | | }
|
|
| |_^
|
|
|
|
|
note: this field is unused
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:21:5
|
|
|
|
|
21 | buffer: NonNull<T>,
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
= help: consider including all fields in this `Debug` impl
|
|
= help: consider calling `.finish_non_exhaustive()` if you intend to ignore fields
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_fields_in_debug
|
|
= note: `#[warn(clippy::missing_fields_in_debug)]` implied by `#[warn(clippy::pedantic)]`
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:62:5
|
|
|
|
|
62 | pub fn new(capacity: usize) -> Result<Self, &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:71:59
|
|
|
|
|
71 | let layout = Layout::array::<T>(capacity).map_err(|_| "Layout creation failed")?;
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:73:22
|
|
|
|
|
73 | let buffer = unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:73:22
|
|
|
|
|
73 | let buffer = unsafe {
|
|
| ______________________^
|
|
... |
|
|
83 | | NonNull::new_unchecked(ptr.cast::<T>())
|
|
84 | | };
|
|
| |_________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:79:23
|
|
|
|
|
79 | let ptr = alloc(layout);
|
|
| ^^^^^^^^^^^^^
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:83:13
|
|
|
|
|
83 | NonNull::new_unchecked(ptr.cast::<T>())
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:89:19
|
|
|
|
|
89 | mask: capacity - 1,
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:100:5
|
|
|
|
|
100 | pub fn try_push(&self, item: T) -> Result<(), T> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: you have declared `#[inline(always)]` on `try_push`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:99:5
|
|
|
|
|
99 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:105:39
|
|
|
|
|
105 | if head.wrapping_sub(tail) >= self.capacity as u64 {
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:109:21
|
|
|
|
|
109 | let index = (head as usize) & self.mask;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:110:9
|
|
|
|
|
110 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:110:9
|
|
|
|
|
110 | / unsafe {
|
|
... |
|
|
116 | | self.buffer.as_ptr().add(index).write(item);
|
|
117 | | }
|
|
| |_________^
|
|
|
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:116:13
|
|
|
|
|
116 | self.buffer.as_ptr().add(index).write(item);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:116:13
|
|
|
|
|
116 | self.buffer.as_ptr().add(index).write(item);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: you have declared `#[inline(always)]` on `try_pop`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:127:5
|
|
|
|
|
127 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:137:21
|
|
|
|
|
137 | let index = (tail as usize) & self.mask;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:138:20
|
|
|
|
|
138 | let item = unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:138:20
|
|
|
|
|
138 | let item = unsafe {
|
|
| ____________________^
|
|
... |
|
|
145 | | self.buffer.as_ptr().add(index).read()
|
|
146 | | };
|
|
| |_________^
|
|
|
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:145:13
|
|
|
|
|
145 | self.buffer.as_ptr().add(index).read()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:145:13
|
|
|
|
|
145 | self.buffer.as_ptr().add(index).read()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:159:20
|
|
|
|
|
159 | let used = head.wrapping_sub(tail) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:160:9
|
|
|
|
|
160 | used as f64 / self.capacity as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: casting `usize` to `f64` causes a loss of precision on targets with 64-bit wide pointers (`usize` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:160:9
|
|
|
|
|
160 | used as f64 / self.capacity as f64
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:160:9
|
|
|
|
|
160 | used as f64 / self.capacity as f64
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: casting `usize` to `f64` causes a loss of precision on targets with 64-bit wide pointers (`usize` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:160:23
|
|
|
|
|
160 | used as f64 / self.capacity as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:160:23
|
|
|
|
|
160 | used as f64 / self.capacity as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:182:36
|
|
|
|
|
182 | head.wrapping_sub(tail) >= self.capacity as u64
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:190:9
|
|
|
|
|
190 | head.wrapping_sub(tail) as usize
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/lockfree/ring_buffer.rs:196:9
|
|
|
|
|
196 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:20:5
|
|
|
|
|
20 | /// SmallBatchRing
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
20 - /// SmallBatchRing
|
|
20 + /// `SmallBatchRing`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:39:5
|
|
|
|
|
39 | /// BatchMode
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
39 - /// BatchMode
|
|
39 + /// `BatchMode`
|
|
|
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:64:5
|
|
|
|
|
64 | pub fn new(capacity: usize, batch_mode: BatchMode) -> Result<Self, &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:74:62
|
|
|
|
|
74 | Layout::array::<UnsafeCell<T>>(capacity).map_err(|_| "Layout creation failed")?;
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:76:22
|
|
|
|
|
76 | let buffer = unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:76:22
|
|
|
|
|
76 | let buffer = unsafe {
|
|
| ______________________^
|
|
77 | | let ptr = alloc(layout);
|
|
78 | | if ptr.is_null() {
|
|
79 | | return Err("Memory allocation failed");
|
|
80 | | }
|
|
81 | | NonNull::new_unchecked(ptr.cast::<UnsafeCell<T>>())
|
|
82 | | };
|
|
| |_________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:77:23
|
|
|
|
|
77 | let ptr = alloc(layout);
|
|
| ^^^^^^^^^^^^^
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:81:13
|
|
|
|
|
81 | NonNull::new_unchecked(ptr.cast::<UnsafeCell<T>>())
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:87:19
|
|
|
|
|
87 | mask: capacity - 1,
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:97:5
|
|
|
|
|
97 | pub fn push_batch(&self, items: &[T]) -> Result<usize, usize> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: you have declared `#[inline(always)]` on `push_batch`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:96:5
|
|
|
|
|
96 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `push_batch_st`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:109:5
|
|
|
|
|
109 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:114:54
|
|
|
|
|
114 | let available = self.capacity.saturating_sub((head - tail) as usize);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:114:54
|
|
|
|
|
114 | let available = self.capacity.saturating_sub((head - tail) as usize);
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:123:25
|
|
|
|
|
123 | let index = ((head + i as u64) as usize) & self.mask;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:123:26
|
|
|
|
|
123 | let index = ((head + i as u64) as usize) & self.mask;
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:123:34
|
|
|
|
|
123 | let index = ((head + i as u64) as usize) & self.mask;
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:124:13
|
|
|
|
|
124 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 3 unsafe operations, expected only one
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:124:13
|
|
|
|
|
124 | / unsafe {
|
|
125 | | (*self.buffer.as_ptr().add(index)).get().write(item);
|
|
126 | | }
|
|
| |_____________^
|
|
|
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:125:17
|
|
|
|
|
125 | (*self.buffer.as_ptr().add(index)).get().write(item);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: raw pointer dereference occurs here
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:125:17
|
|
|
|
|
125 | (*self.buffer.as_ptr().add(index)).get().write(item);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:125:19
|
|
|
|
|
125 | (*self.buffer.as_ptr().add(index)).get().write(item);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:133:25
|
|
|
|
|
133 | self.head.store(head + push_count as u64, Ordering::Relaxed);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:133:32
|
|
|
|
|
133 | self.head.store(head + push_count as u64, Ordering::Relaxed);
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: you have declared `#[inline(always)]` on `push_batch_mt`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:140:5
|
|
|
|
|
140 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:145:54
|
|
|
|
|
145 | let available = self.capacity.saturating_sub((head - tail) as usize);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:145:54
|
|
|
|
|
145 | let available = self.capacity.saturating_sub((head - tail) as usize);
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:154:25
|
|
|
|
|
154 | let index = ((head + i as u64) as usize) & self.mask;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:154:26
|
|
|
|
|
154 | let index = ((head + i as u64) as usize) & self.mask;
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:154:34
|
|
|
|
|
154 | let index = ((head + i as u64) as usize) & self.mask;
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:155:13
|
|
|
|
|
155 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 3 unsafe operations, expected only one
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:155:13
|
|
|
|
|
155 | / unsafe {
|
|
156 | | (*self.buffer.as_ptr().add(index)).get().write(item);
|
|
157 | | }
|
|
| |_____________^
|
|
|
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:156:17
|
|
|
|
|
156 | (*self.buffer.as_ptr().add(index)).get().write(item);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: raw pointer dereference occurs here
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:156:17
|
|
|
|
|
156 | (*self.buffer.as_ptr().add(index)).get().write(item);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:156:19
|
|
|
|
|
156 | (*self.buffer.as_ptr().add(index)).get().write(item);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:161:25
|
|
|
|
|
161 | self.head.store(head + push_count as u64, Ordering::Release);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:161:32
|
|
|
|
|
161 | self.head.store(head + push_count as u64, Ordering::Release);
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: you have declared `#[inline(always)]` on `pop_batch`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:168:5
|
|
|
|
|
168 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `pop_batch_st`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:181:5
|
|
|
|
|
181 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:186:25
|
|
|
|
|
186 | let available = (head - tail) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:186:25
|
|
|
|
|
186 | let available = (head - tail) as usize;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: the loop variable `i` is used to index `output`
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:194:18
|
|
|
|
|
194 | for i in 0..pop_count {
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/lockfree/mod.rs:34:5
|
|
|
|
|
34 | clippy::style,
|
|
| ^^^^^^^^^^^^^
|
|
help: consider using an iterator and enumerate()
|
|
|
|
|
194 - for i in 0..pop_count {
|
|
194 + for (i, <item>) in output.iter_mut().enumerate().take(pop_count) {
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:195:25
|
|
|
|
|
195 | let index = ((tail + i as u64) as usize) & self.mask;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:195:26
|
|
|
|
|
195 | let index = ((tail + i as u64) as usize) & self.mask;
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:195:34
|
|
|
|
|
195 | let index = ((tail + i as u64) as usize) & self.mask;
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:196:13
|
|
|
|
|
196 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 3 unsafe operations, expected only one
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:196:13
|
|
|
|
|
196 | / unsafe {
|
|
197 | | output[i] = (*self.buffer.as_ptr().add(index)).get().read();
|
|
198 | | }
|
|
| |_____________^
|
|
|
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:197:29
|
|
|
|
|
197 | output[i] = (*self.buffer.as_ptr().add(index)).get().read();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: raw pointer dereference occurs here
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:197:29
|
|
|
|
|
197 | output[i] = (*self.buffer.as_ptr().add(index)).get().read();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:197:31
|
|
|
|
|
197 | output[i] = (*self.buffer.as_ptr().add(index)).get().read();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:197:17
|
|
|
|
|
197 | output[i] = (*self.buffer.as_ptr().add(index)).get().read();
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/lockfree/mod.rs:27:5
|
|
|
|
|
27 | clippy::indexing_slicing
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:205:25
|
|
|
|
|
205 | self.tail.store(tail + pop_count as u64, Ordering::Relaxed);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:205:32
|
|
|
|
|
205 | self.tail.store(tail + pop_count as u64, Ordering::Relaxed);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: you have declared `#[inline(always)]` on `pop_batch_mt`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:211:5
|
|
|
|
|
211 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:216:25
|
|
|
|
|
216 | let available = (head - tail) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:216:25
|
|
|
|
|
216 | let available = (head - tail) as usize;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: the loop variable `i` is used to index `output`
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:224:18
|
|
|
|
|
224 | for i in 0..pop_count {
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
|
|
help: consider using an iterator and enumerate()
|
|
|
|
|
224 - for i in 0..pop_count {
|
|
224 + for (i, <item>) in output.iter_mut().enumerate().take(pop_count) {
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:225:25
|
|
|
|
|
225 | let index = ((tail + i as u64) as usize) & self.mask;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:225:26
|
|
|
|
|
225 | let index = ((tail + i as u64) as usize) & self.mask;
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:225:34
|
|
|
|
|
225 | let index = ((tail + i as u64) as usize) & self.mask;
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:226:13
|
|
|
|
|
226 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 3 unsafe operations, expected only one
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:226:13
|
|
|
|
|
226 | / unsafe {
|
|
227 | | output[i] = (*self.buffer.as_ptr().add(index)).get().read();
|
|
228 | | }
|
|
| |_____________^
|
|
|
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:227:29
|
|
|
|
|
227 | output[i] = (*self.buffer.as_ptr().add(index)).get().read();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: raw pointer dereference occurs here
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:227:29
|
|
|
|
|
227 | output[i] = (*self.buffer.as_ptr().add(index)).get().read();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:227:31
|
|
|
|
|
227 | output[i] = (*self.buffer.as_ptr().add(index)).get().read();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:227:17
|
|
|
|
|
227 | output[i] = (*self.buffer.as_ptr().add(index)).get().read();
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:232:25
|
|
|
|
|
232 | self.tail.store(tail + pop_count as u64, Ordering::Release);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:232:32
|
|
|
|
|
232 | self.tail.store(tail + pop_count as u64, Ordering::Release);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:239:5
|
|
|
|
|
239 | pub fn try_push(&self, item: T) -> Result<(), T> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: you have declared `#[inline(always)]` on `try_push`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:238:5
|
|
|
|
|
238 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: you have declared `#[inline(always)]` on `try_pop`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:248:5
|
|
|
|
|
248 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:250:27
|
|
|
|
|
250 | let mut output = [unsafe { std::mem::zeroed() }];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:259:20
|
|
|
|
|
259 | let used = (head - tail) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:259:20
|
|
|
|
|
259 | let used = (head - tail) as usize;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:260:9
|
|
|
|
|
260 | used as f64 / self.capacity as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: casting `usize` to `f64` causes a loss of precision on targets with 64-bit wide pointers (`usize` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:260:9
|
|
|
|
|
260 | used as f64 / self.capacity as f64
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:260:9
|
|
|
|
|
260 | used as f64 / self.capacity as f64
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: casting `usize` to `f64` causes a loss of precision on targets with 64-bit wide pointers (`usize` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:260:23
|
|
|
|
|
260 | used as f64 / self.capacity as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:260:23
|
|
|
|
|
260 | used as f64 / self.capacity as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:274:9
|
|
|
|
|
274 | (head - tail) as usize
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:274:9
|
|
|
|
|
274 | (head - tail) as usize
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:290:9
|
|
|
|
|
290 | (head - tail) as usize >= self.capacity
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:290:9
|
|
|
|
|
290 | (head - tail) as usize >= self.capacity
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:312:9
|
|
|
|
|
312 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: manual `Debug` impl does not include all fields
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:318:1
|
|
|
|
|
318 | / impl<T> fmt::Debug for SmallBatchRing<T> {
|
|
319 | | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
320 | | let head = self.head.load(Ordering::Relaxed);
|
|
321 | | let tail = self.tail.load(Ordering::Relaxed);
|
|
... |
|
|
331 | | }
|
|
| |_^
|
|
|
|
|
note: this field is unused
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:24:5
|
|
|
|
|
24 | buffer: NonNull<UnsafeCell<T>>,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: this field is unused
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:26:5
|
|
|
|
|
26 | mask: usize,
|
|
| ^^^^^^^^^^^
|
|
note: this field is unused
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:33:5
|
|
|
|
|
33 | layout: Layout,
|
|
| ^^^^^^^^^^^^^^
|
|
= help: consider including all fields in this `Debug` impl
|
|
= help: consider calling `.finish_non_exhaustive()` if you intend to ignore fields
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_fields_in_debug
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:322:19
|
|
|
|
|
322 | let len = (head - tail) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:322:19
|
|
|
|
|
322 | let len = (head - tail) as usize;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:335:5
|
|
|
|
|
335 | /// SmallBatchOrdersSoA
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
335 - /// SmallBatchOrdersSoA
|
|
335 + /// `SmallBatchOrdersSoA`
|
|
|
|
|
|
|
warning: you have declared `#[inline(always)]` on `add_order`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:379:5
|
|
|
|
|
379 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:395:9
|
|
|
|
|
395 | self.order_ids[idx] = order_id;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:396:9
|
|
|
|
|
396 | self.prices[idx] = price;
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:397:9
|
|
|
|
|
397 | self.quantities[idx] = quantity;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:398:9
|
|
|
|
|
398 | self.timestamps[idx] = timestamp;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:399:9
|
|
|
|
|
399 | self.sides[idx] = side;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:400:9
|
|
|
|
|
400 | self.order_types[idx] = order_type;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:403:13
|
|
|
|
|
403 | self.symbols[idx] = symbol_hash;
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:406:9
|
|
|
|
|
406 | self.count += 1;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: you have declared `#[inline(always)]` on `clear`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:411:5
|
|
|
|
|
411 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
error: slicing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:421:10
|
|
|
|
|
421 | &self.prices[..self.count]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(..n)`or `.get_mut(..n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: slicing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:428:10
|
|
|
|
|
428 | &self.quantities[..self.count]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(..n)`or `.get_mut(..n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:440:13
|
|
|
|
|
440 | unsafe { self.calculate_total_notional_avx2() }
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:459:15
|
|
|
|
|
459 | while i + 4 <= self.count {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:460:47
|
|
|
|
|
460 | let prices_vec = _mm256_loadu_pd(&self.prices[i]);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:461:51
|
|
|
|
|
461 | let quantities_vec = _mm256_loadu_pd(&self.quantities[i]);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:466:13
|
|
|
|
|
466 | i += 4;
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:477:13
|
|
|
|
|
477 | total += self.prices[j] * self.quantities[j];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:477:22
|
|
|
|
|
477 | total += self.prices[j] * self.quantities[j];
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:477:39
|
|
|
|
|
477 | total += self.prices[j] * self.quantities[j];
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: slicing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:486:9
|
|
|
|
|
486 | self.prices[..self.count]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(..n)`or `.get_mut(..n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: slicing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:488:19
|
|
|
|
|
488 | .zip(&self.quantities[..self.count])
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(..n)`or `.get_mut(..n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:489:40
|
|
|
|
|
489 | .map(|(&price, &quantity)| price * quantity)
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: slicing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:504:35
|
|
|
|
|
504 | .field("order_ids", &&self.order_ids[..self.count])
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(..n)`or `.get_mut(..n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: slicing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:505:32
|
|
|
|
|
505 | .field("prices", &&self.prices[..self.count])
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(..n)`or `.get_mut(..n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: slicing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:506:36
|
|
|
|
|
506 | .field("quantities", &&self.quantities[..self.count])
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(..n)`or `.get_mut(..n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: slicing may panic
|
|
--> trading_engine/src/lockfree/small_batch_ring.rs:507:36
|
|
|
|
|
507 | .field("timestamps", &&self.timestamps[..self.count])
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(..n)`or `.get_mut(..n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/lockfree/mod.rs:66:5
|
|
|
|
|
66 | /// HftMessage
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
66 - /// HftMessage
|
|
66 + /// `HftMessage`
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/mod.rs:85:27
|
|
|
|
|
85 | timestamp_ns: SystemTime::now()
|
|
| ___________________________^
|
|
86 | | .duration_since(UNIX_EPOCH)
|
|
87 | | .unwrap_or_default()
|
|
88 | | .as_nanos() as u64,
|
|
| |__________________________________^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/lockfree/mod.rs:107:5
|
|
|
|
|
107 | /// ChannelStats
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
107 - /// ChannelStats
|
|
107 + /// `ChannelStats`
|
|
|
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/lockfree/mod.rs:125:5
|
|
|
|
|
125 | pub fn new(buffer_size: usize) -> Result<Self, &'static str> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: docs for function returning `Result` missing `# Errors` section
|
|
--> trading_engine/src/lockfree/mod.rs:135:5
|
|
|
|
|
135 | pub fn send(&self, message: HftMessage) -> Result<(), HftMessage> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
|
|
|
warning: you have declared `#[inline(always)]` on `send`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/mod.rs:134:5
|
|
|
|
|
134 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/mod.rs:136:24
|
|
|
|
|
136 | let start_ns = SystemTime::now()
|
|
| ________________________^
|
|
137 | | .duration_since(UNIX_EPOCH)
|
|
138 | | .unwrap_or_default()
|
|
139 | | .as_nanos() as u64;
|
|
| |______________________________^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/mod.rs:143:34
|
|
|
|
|
143 | let latency_ns = SystemTime::now()
|
|
| __________________________________^
|
|
144 | | .duration_since(UNIX_EPOCH)
|
|
145 | | .unwrap_or_default()
|
|
146 | | .as_nanos() as u64
|
|
147 | | - start_ns;
|
|
| |______________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/lockfree/mod.rs:143:34
|
|
|
|
|
143 | let latency_ns = SystemTime::now()
|
|
| __________________________________^
|
|
144 | | .duration_since(UNIX_EPOCH)
|
|
145 | | .unwrap_or_default()
|
|
146 | | .as_nanos() as u64
|
|
| |______________________________________^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: you have declared `#[inline(always)]` on `try_receive`. This is usually a bad idea
|
|
--> trading_engine/src/lockfree/mod.rs:162:5
|
|
|
|
|
162 | #[inline(always)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
|
|
|
|
warning: use Option::map_or instead of an if let/else
|
|
--> trading_engine/src/lockfree/mod.rs:165:9
|
|
|
|
|
165 | / if let Some(message) = self.producer_to_consumer.try_pop() {
|
|
166 | | self.stats.messages_received.fetch_add(1, Ordering::Relaxed);
|
|
167 | | // Some variant
|
|
168 | | Some(message)
|
|
... |
|
|
171 | | None
|
|
172 | | }
|
|
| |_________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/lockfree/mod.rs:31:5
|
|
|
|
|
31 | clippy::nursery,
|
|
| ^^^^^^^^^^^^^^^
|
|
help: try
|
|
|
|
|
165 ~ self.producer_to_consumer.try_pop().map_or(None, |message| {
|
|
166 + self.stats.messages_received.fetch_add(1, Ordering::Relaxed);
|
|
167 + // Some variant
|
|
168 + Some(message)
|
|
169 + })
|
|
|
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/lockfree/mod.rs:183:13
|
|
|
|
|
183 | (current_avg * 9 + latency_ns) / 10
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/lockfree/mod.rs:183:13
|
|
|
|
|
183 | (current_avg * 9 + latency_ns) / 10
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/lockfree/mod.rs:224:5
|
|
|
|
|
224 | /// SharedMemoryStats
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
224 - /// SharedMemoryStats
|
|
224 + /// `SharedMemoryStats`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/small_batch_optimizer.rs:30:5
|
|
|
|
|
30 | /// SmallBatchProcessor
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
= note: requested on the command line with `-W clippy::doc-markdown`
|
|
help: try
|
|
|
|
|
30 - /// SmallBatchProcessor
|
|
30 + /// `SmallBatchProcessor`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/small_batch_optimizer.rs:50:5
|
|
|
|
|
50 | /// OrderRequest
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
50 - /// OrderRequest
|
|
50 + /// `OrderRequest`
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/small_batch_optimizer.rs:98:21
|
|
|
|
|
98 | hash ^= byte as u64;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/small_batch_optimizer.rs:107:5
|
|
|
|
|
107 | /// SmallBatchMetrics
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
107 - /// SmallBatchMetrics
|
|
107 + /// `SmallBatchMetrics`
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/small_batch_optimizer.rs:177:13
|
|
|
|
|
177 | total as f64 / count as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/small_batch_optimizer.rs:177:13
|
|
|
|
|
177 | total as f64 / count as f64
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/small_batch_optimizer.rs:177:28
|
|
|
|
|
177 | total as f64 / count as f64
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/small_batch_optimizer.rs:188:13
|
|
|
|
|
188 | 1_000_000_000.0 / avg_latency // Convert ns to ops/sec
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/small_batch_optimizer.rs:236:30
|
|
|
|
|
236 | self.prices[i] = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/small_batch_optimizer.rs:237:34
|
|
|
|
|
237 | self.quantities[i] = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/small_batch_optimizer.rs:228:13
|
|
|
|
|
228 | self.prices[i] = order.price;
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/small_batch_optimizer.rs:18:5
|
|
|
|
|
18 | clippy::indexing_slicing
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/small_batch_optimizer.rs:229:13
|
|
|
|
|
229 | self.quantities[i] = order.quantity;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/small_batch_optimizer.rs:230:13
|
|
|
|
|
230 | self.timestamps[i] = order.timestamp_ns;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/small_batch_optimizer.rs:231:28
|
|
|
|
|
231 | padded_count = i + 1;
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/small_batch_optimizer.rs:236:13
|
|
|
|
|
236 | self.prices[i] = 0.0;
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/small_batch_optimizer.rs:237:13
|
|
|
|
|
237 | self.quantities[i] = 0.0;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/small_batch_optimizer.rs:238:13
|
|
|
|
|
238 | self.timestamps[i] = 0;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/small_batch_optimizer.rs:241:9
|
|
|
|
|
241 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/small_batch_optimizer.rs:241:9
|
|
|
|
|
241 | / unsafe {
|
|
242 | | self.validate_prices_simd()?;
|
|
243 | | self.calculate_notional_simd()?;
|
|
244 | | }
|
|
| |_________^
|
|
|
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/small_batch_optimizer.rs:242:13
|
|
|
|
|
242 | self.validate_prices_simd()?;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/small_batch_optimizer.rs:243:13
|
|
|
|
|
243 | self.calculate_notional_simd()?;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/small_batch_optimizer.rs:269:25
|
|
|
|
|
269 | if mask_bits == 0 {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/small_batch_optimizer.rs:290:37
|
|
|
|
|
290 | let mut notional_results = [0.0; 4];
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/small_batch_optimizer.rs:295:27
|
|
|
|
|
295 | if notional < 0.0 || notional > 1_000_000_000.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/small_batch_optimizer.rs:295:45
|
|
|
|
|
295 | if notional < 0.0 || notional > 1_000_000_000.0 {
|
|
| ^^^^^^^^^^^^^^^ help: consider adding suffix: `1_000_000_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: manual `!RangeInclusive::contains` implementation
|
|
--> trading_engine/src/small_batch_optimizer.rs:295:16
|
|
|
|
|
295 | if notional < 0.0 || notional > 1_000_000_000.0 {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(0.0..=1_000_000_000.0).contains(¬ional)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
|
|
= note: `-W clippy::manual-range-contains` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::manual_range_contains)]`
|
|
|
|
warning: unnecessary closure used to substitute value for `Result::Err`
|
|
--> trading_engine/src/small_batch_optimizer.rs:306:9
|
|
|
|
|
306 | / Self::new().unwrap_or_else(|_| Self {
|
|
307 | | prices: [0.0; 4],
|
|
308 | | quantities: [0.0; 4],
|
|
309 | | timestamps: [0; 4],
|
|
310 | | })
|
|
| |__________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
|
|
= note: `-W clippy::unnecessary-lazy-evaluations` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::unnecessary_lazy_evaluations)]`
|
|
help: use `unwrap_or` instead
|
|
|
|
|
306 ~ Self::new().unwrap_or(Self {
|
|
307 + prices: [0.0; 4],
|
|
308 + quantities: [0.0; 4],
|
|
309 + timestamps: [0; 4],
|
|
310 + })
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/small_batch_optimizer.rs:307:22
|
|
|
|
|
307 | prices: [0.0; 4],
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/small_batch_optimizer.rs:308:26
|
|
|
|
|
308 | quantities: [0.0; 4],
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/small_batch_optimizer.rs:342:9
|
|
|
|
|
342 | self.orders[self.batch_size] = Some(order);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/small_batch_optimizer.rs:343:9
|
|
|
|
|
343 | self.batch_size += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: slicing may panic
|
|
--> trading_engine/src/small_batch_optimizer.rs:385:47
|
|
|
|
|
385 | let valid_orders: Vec<OrderRequest> = self.orders[..self.batch_size]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(..n)`or `.get_mut(..n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/small_batch_optimizer.rs:396:26
|
|
|
|
|
396 | .map(|order| order.price * order.quantity)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/small_batch_optimizer.rs:409:34
|
|
|
|
|
409 | let mut total_notional = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/small_batch_optimizer.rs:414:35
|
|
|
|
|
414 | if order.price <= 0.0 || order.quantity <= 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/small_batch_optimizer.rs:414:60
|
|
|
|
|
414 | if order.price <= 0.0 || order.quantity <= 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/small_batch_optimizer.rs:420:31
|
|
|
|
|
420 | if notional > 1_000_000_000.0 {
|
|
| ^^^^^^^^^^^^^^^ help: consider adding suffix: `1_000_000_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: slicing may panic
|
|
--> trading_engine/src/small_batch_optimizer.rs:411:28
|
|
|
|
|
411 | for &order_opt in &self.orders[..self.batch_size] {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(..n)`or `.get_mut(..n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/small_batch_optimizer.rs:419:32
|
|
|
|
|
419 | let notional = order.price * order.quantity;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/small_batch_optimizer.rs:424:17
|
|
|
|
|
424 | total_notional += notional;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/small_batch_optimizer.rs:425:17
|
|
|
|
|
425 | orders_processed += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: slicing may panic
|
|
--> trading_engine/src/small_batch_optimizer.rs:439:27
|
|
|
|
|
439 | for order in &mut self.orders[..self.batch_size] {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(..n)`or `.get_mut(..n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/small_batch_optimizer.rs:494:5
|
|
|
|
|
494 | /// SmallBatchResult
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
494 - /// SmallBatchResult
|
|
494 + /// `SmallBatchResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/small_batch_optimizer.rs:518:5
|
|
|
|
|
518 | /// SmallBatchStats
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
518 - /// SmallBatchStats
|
|
518 + /// `SmallBatchStats`
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/small_batch_optimizer.rs:543:13
|
|
|
|
|
543 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/small_batch_optimizer.rs:538:27
|
|
|
|
|
538 | let total_cache = metrics.cache_hits.load(Ordering::Relaxed)
|
|
| ___________________________^
|
|
539 | | + metrics.cache_misses.load(Ordering::Relaxed);
|
|
| |__________________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/small_batch_optimizer.rs:541:13
|
|
|
|
|
541 | metrics.cache_hits.load(Ordering::Relaxed) as f64 / total_cache as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/small_batch_optimizer.rs:541:13
|
|
|
|
|
541 | metrics.cache_hits.load(Ordering::Relaxed) as f64 / total_cache as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/small_batch_optimizer.rs:541:65
|
|
|
|
|
541 | metrics.cache_hits.load(Ordering::Relaxed) as f64 / total_cache as f64
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/event_types.rs:342:18
|
|
|
|
|
342 | } => 100 + order_id.len() + symbol.len(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/event_types.rs:345:18
|
|
|
|
|
345 | } => 100 + trade_id.len() + symbol.len(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/event_types.rs:351:18
|
|
|
|
|
351 | } => 100 + order_id.len() + symbol.len() + reason.len(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/event_types.rs:352:61
|
|
|
|
|
352 | TradingEvent::PositionUpdated { symbol, .. } => 150 + symbol.len(),
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/event_types.rs:355:18
|
|
|
|
|
355 | } => 120 + message.len() + symbol.as_ref().map(|s| s.len()).unwrap_or(0),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/event_types.rs:356:58
|
|
|
|
|
356 | TradingEvent::SystemEvent { message, .. } => 80 + message.len(),
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/event_types.rs:494:28
|
|
|
|
|
494 | created_at_ns: std::time::SystemTime::now()
|
|
| ____________________________^
|
|
495 | | .duration_since(std::time::UNIX_EPOCH)
|
|
496 | | .unwrap_or_default()
|
|
497 | | .as_nanos() as u64,
|
|
| |__________________________________^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/events/postgres_writer.rs:28:5
|
|
|
|
|
28 | /// WriterConfig
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
28 - /// WriterConfig
|
|
28 + /// `WriterConfig`
|
|
|
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/postgres_writer.rs:100:13
|
|
|
|
|
100 | metrics.clone(),
|
|
| ^^^^^^^^^^^^^^^ help: try: `Arc::<events::EventMetrics>::clone(&metrics)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
= note: requested on the command line with `-W clippy::clone-on-ref-ptr`
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/postgres_writer.rs:101:13
|
|
|
|
|
101 | stats.clone(),
|
|
| ^^^^^^^^^^^^^ help: try: `Arc::<tokio::sync::RwLock<events::postgres_writer::WriterStats>>::clone(&stats)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/postgres_writer.rs:142:24
|
|
|
|
|
142 | let shutdown = self.shutdown.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `Arc::<std::sync::atomic::AtomicBool>::clone(&self.shutdown)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/postgres_writer.rs:143:30
|
|
|
|
|
143 | let batch_receiver = self.batch_receiver.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Arc::<tokio::sync::RwLock<std::option::Option<tokio::sync::mpsc::Receiver<events::postgres_writer::EventBatch>>>>::clone(&self.batch_receiver)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/postgres_writer.rs:144:31
|
|
|
|
|
144 | let batch_processor = self.batch_processor.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Arc::<events::postgres_writer::BatchProcessor>::clone(&self.batch_processor)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/postgres_writer.rs:145:36
|
|
|
|
|
145 | let processing_semaphore = self.processing_semaphore.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Arc::<tokio::sync::Semaphore>::clone(&self.processing_semaphore)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/postgres_writer.rs:146:23
|
|
|
|
|
146 | let metrics = self.metrics.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `Arc::<events::EventMetrics>::clone(&self.metrics)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: this could be rewritten as `let...else`
|
|
--> trading_engine/src/events/postgres_writer.rs:149:13
|
|
|
|
|
149 | / let mut receiver = match batch_receiver.write().await.take() {
|
|
150 | | Some(r) => r,
|
|
151 | | None => {
|
|
152 | | tracing::error!("Batch receiver not available - processing task cannot start");
|
|
... |
|
|
156 | | };
|
|
| |______________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
|
|
= note: requested on the command line with `-W clippy::manual-let-else`
|
|
help: consider writing
|
|
|
|
|
149 ~ let Some(mut receiver) = batch_receiver.write().await.take() else {
|
|
150 + tracing::error!("Batch receiver not available - processing task cannot start");
|
|
151 + metrics.increment_failed_writes();
|
|
152 + return;
|
|
153 + };
|
|
|
|
|
|
|
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
|
|
--> trading_engine/src/events/postgres_writer.rs:149:32
|
|
|
|
|
149 | let mut receiver = match batch_receiver.write().await.take() {
|
|
| ________________________________^
|
|
150 | | Some(r) => r,
|
|
151 | | None => {
|
|
152 | | tracing::error!("Batch receiver not available - processing task cannot start");
|
|
... |
|
|
156 | | };
|
|
| |_____________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else
|
|
= note: requested on the command line with `-W clippy::single-match-else`
|
|
help: try
|
|
|
|
|
149 ~ let mut receiver = if let Some(r) = batch_receiver.write().await.take() { r } else {
|
|
150 + tracing::error!("Batch receiver not available - processing task cannot start");
|
|
151 + metrics.increment_failed_writes();
|
|
152 + return;
|
|
153 ~ };
|
|
|
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/postgres_writer.rs:161:41
|
|
|
|
|
161 | let processor = batch_processor.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Arc::<events::postgres_writer::BatchProcessor>::clone(&batch_processor)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/postgres_writer.rs:162:45
|
|
|
|
|
162 | let metrics_clone = metrics.clone();
|
|
| ^^^^^^^^^^^^^^^ help: try: `Arc::<events::EventMetrics>::clone(&metrics)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/postgres_writer.rs:163:47
|
|
|
|
|
163 | let semaphore_clone = processing_semaphore.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Arc::<tokio::sync::Semaphore>::clone(&processing_semaphore)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/events/postgres_writer.rs:216:18
|
|
|
|
|
216 | for _ in 0..300 {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/events/postgres_writer.rs:216:21
|
|
|
|
|
216 | for _ in 0..300 {
|
|
| ^^^ help: consider adding suffix: `300_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/events/postgres_writer.rs:233:5
|
|
|
|
|
233 | /// EventBatch
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
233 - /// EventBatch
|
|
233 + /// `EventBatch`
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:270:9
|
|
|
|
|
270 | self.retry_count += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/postgres_writer.rs:309:59
|
|
|
|
|
309 | self.metrics.increment_events_written(batch.size() as u64);
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:327:25
|
|
|
|
|
327 | attempt + 1,
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:342:29
|
|
|
|
|
342 | ... attempt + 1,
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/postgres_writer.rs:392:29
|
|
|
|
|
392 | let write_latency = start_time.elapsed().as_millis() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: this could be simplified with `bool::then`
|
|
--> trading_engine/src/events/postgres_writer.rs:429:13
|
|
|
|
|
429 | / if self.config.enable_compression && event_data.to_string().len() > 1024 {
|
|
430 | | Some(self.compress_data(&event_data.to_string()).await?)
|
|
431 | | } else {
|
|
... |
|
|
434 | | };
|
|
| |_____________^ help: try: `(self.config.enable_compression && event_data.to_string().len() > 1024).then(|| self.compress_data(&event_data.to_string()).await?)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_some_else_none
|
|
= note: requested on the command line with `-D clippy::if-then-some-else-none`
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/postgres_writer.rs:510:30
|
|
|
|
|
510 | sequence_number: event.sequence_number().unwrap_or(0) as i64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/postgres_writer.rs:513:27
|
|
|
|
|
513 | timestamp_ns: event.timestamp().nanos as i64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/postgres_writer.rs:516:27
|
|
|
|
|
516 | .map(|ts| ts.nanos as i64)
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:560:28
|
|
|
|
|
560 | let base = i * 13; // 13 parameters per event (excluding processing_timestamp_ns)
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:563:21
|
|
|
|
|
563 | base + 1, base + 2, base + 3, base + 4, base + 5, base + 6, base + 7,
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:563:31
|
|
|
|
|
563 | base + 1, base + 2, base + 3, base + 4, base + 5, base + 6, base + 7,
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:563:41
|
|
|
|
|
563 | base + 1, base + 2, base + 3, base + 4, base + 5, base + 6, base + 7,
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:563:51
|
|
|
|
|
563 | base + 1, base + 2, base + 3, base + 4, base + 5, base + 6, base + 7,
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:563:61
|
|
|
|
|
563 | base + 1, base + 2, base + 3, base + 4, base + 5, base + 6, base + 7,
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:563:71
|
|
|
|
|
563 | base + 1, base + 2, base + 3, base + 4, base + 5, base + 6, base + 7,
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:563:81
|
|
|
|
|
563 | base + 1, base + 2, base + 3, base + 4, base + 5, base + 6, base + 7,
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:564:21
|
|
|
|
|
564 | base + 8, base + 9, base + 10, base + 11, base + 12, base + 13
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:564:31
|
|
|
|
|
564 | base + 8, base + 9, base + 10, base + 11, base + 12, base + 13
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:564:41
|
|
|
|
|
564 | base + 8, base + 9, base + 10, base + 11, base + 12, base + 13
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:564:52
|
|
|
|
|
564 | base + 8, base + 9, base + 10, base + 11, base + 12, base + 13
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:564:63
|
|
|
|
|
564 | base + 8, base + 9, base + 10, base + 11, base + 12, base + 13
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:564:74
|
|
|
|
|
564 | base + 8, base + 9, base + 10, base + 11, base + 12, base + 13
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:579:9
|
|
|
|
|
579 | stats.batches_processed += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:580:9
|
|
|
|
|
580 | stats.events_written += batch_size as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/postgres_writer.rs:580:33
|
|
|
|
|
580 | stats.events_written += batch_size as u64;
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:581:9
|
|
|
|
|
581 | stats.total_processing_time += batch_age;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/postgres_writer.rs:588:9
|
|
|
|
|
588 | stats.batches_failed += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/events/postgres_writer.rs:614:5
|
|
|
|
|
614 | /// WriterStats
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
614 - /// WriterStats
|
|
614 + /// `WriterStats`
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/events/postgres_writer.rs:659:35
|
|
|
|
|
659 | self.avg_batch_size = self.events_written as f64 / self.batches_processed as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/postgres_writer.rs:659:35
|
|
|
|
|
659 | self.avg_batch_size = self.events_written as f64 / self.batches_processed as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/postgres_writer.rs:659:64
|
|
|
|
|
659 | self.avg_batch_size = self.events_written as f64 / self.batches_processed as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/events/postgres_writer.rs:667:17
|
|
|
|
|
667 | self.total_processing_time.as_millis() as f64 / self.batches_processed as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/postgres_writer.rs:667:17
|
|
|
|
|
667 | self.total_processing_time.as_millis() as f64 / self.batches_processed as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/postgres_writer.rs:667:65
|
|
|
|
|
667 | self.total_processing_time.as_millis() as f64 / self.batches_processed as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/ring_buffer.rs:86:21
|
|
|
|
|
86 | popped += 1;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: this could be simplified with `bool::then`
|
|
--> trading_engine/src/events/ring_buffer.rs:92:9
|
|
|
|
|
92 | / if !events.is_empty() {
|
|
93 | | self.update_stats_pop_success(events.len()).await;
|
|
94 | | // Some variant
|
|
95 | | Some(events)
|
|
... |
|
|
98 | | None
|
|
99 | | }
|
|
| |_________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_some_else_none
|
|
help: try
|
|
|
|
|
92 ~ (!events.is_empty()).then(|| { self.update_stats_pop_success(events.len()).await;
|
|
93 + // Some variant
|
|
94 + Some(; events })
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/ring_buffer.rs:145:9
|
|
|
|
|
145 | stats.push_success_count += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/ring_buffer.rs:146:9
|
|
|
|
|
146 | stats.total_push_latency_ns += latency_ns;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/ring_buffer.rs:154:9
|
|
|
|
|
154 | stats.push_failure_count += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/ring_buffer.rs:162:9
|
|
|
|
|
162 | stats.pop_success_count += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/ring_buffer.rs:163:9
|
|
|
|
|
163 | stats.total_events_popped += count as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/ring_buffer.rs:163:38
|
|
|
|
|
163 | stats.total_events_popped += count as u64;
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/events/ring_buffer.rs:171:5
|
|
|
|
|
171 | /// BufferStats
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
171 - /// BufferStats
|
|
171 + /// `BufferStats`
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/events/ring_buffer.rs:217:17
|
|
|
|
|
217 | self.total_push_latency_ns as f64 / self.push_success_count as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/ring_buffer.rs:217:17
|
|
|
|
|
217 | self.total_push_latency_ns as f64 / self.push_success_count as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/ring_buffer.rs:217:53
|
|
|
|
|
217 | self.total_push_latency_ns as f64 / self.push_success_count as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/ring_buffer.rs:254:17
|
|
|
|
|
254 | self.current_buffer.fetch_add(1, Ordering::Relaxed) % self.buffers.len()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/ring_buffer.rs:261:17
|
|
|
|
|
261 | hash % self.buffers.len()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/events/ring_buffer.rs:279:9
|
|
|
|
|
279 | self.buffers[buffer_index].try_push(event).await
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/lib.rs:51:5
|
|
|
|
|
51 | clippy::indexing_slicing
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/events/ring_buffer.rs:292:9
|
|
|
|
|
292 | self.buffers[buffer_index].try_pop_batch(max_events).await
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/events/ring_buffer.rs:331:9
|
|
|
|
|
331 | total_utilization / self.buffers.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/ring_buffer.rs:331:29
|
|
|
|
|
331 | total_utilization / self.buffers.len() as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/ring_buffer.rs:356:55
|
|
|
|
|
356 | hash = hash.wrapping_mul(31).wrapping_add(byte as usize);
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/events/ring_buffer.rs:374:5
|
|
|
|
|
374 | /// LoadBalancingStrategy
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
374 - /// LoadBalancingStrategy
|
|
374 + /// `LoadBalancingStrategy`
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/ring_buffer.rs:419:21
|
|
|
|
|
419 | let index = (sequence % self.capacity as u64) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/ring_buffer.rs:419:21
|
|
|
|
|
419 | let index = (sequence % self.capacity as u64) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/ring_buffer.rs:419:33
|
|
|
|
|
419 | let index = (sequence % self.capacity as u64) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/events/ring_buffer.rs:422:12
|
|
|
|
|
422 | if self.events[index].is_some() {
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/events/ring_buffer.rs:428:9
|
|
|
|
|
428 | self.events[index] = Some(event);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/ring_buffer.rs:443:25
|
|
|
|
|
443 | let index = (current_seq % self.capacity as u64) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/ring_buffer.rs:443:25
|
|
|
|
|
443 | let index = (current_seq % self.capacity as u64) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/ring_buffer.rs:443:40
|
|
|
|
|
443 | let index = (current_seq % self.capacity as u64) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/events/ring_buffer.rs:445:34
|
|
|
|
|
445 | if let Some(event) = self.events[index].take() {
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/ring_buffer.rs:448:21
|
|
|
|
|
448 | current_seq += 1;
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/events/ring_buffer.rs:451:21
|
|
|
|
|
451 | self.events[index] = Some(event);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/events/mod.rs:90:5
|
|
|
|
|
90 | /// EventProcessorConfig
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
90 - /// EventProcessorConfig
|
|
90 + /// `EventProcessorConfig`
|
|
|
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/mod.rs:201:69
|
|
|
|
|
201 | PostgresWriter::new(writer_config, db_pool.clone(), metrics.clone()).await?,
|
|
| ^^^^^^^^^^^^^^^ help: try: `Arc::<events::EventMetrics>::clone(&metrics)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/mod.rs:368:24
|
|
|
|
|
368 | let shutdown = self.shutdown.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `Arc::<std::sync::atomic::AtomicBool>::clone(&self.shutdown)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/mod.rs:369:30
|
|
|
|
|
369 | let buffer_manager = self.buffer_manager.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Arc::<events::ring_buffer::BufferManager>::clone(&self.buffer_manager)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/mod.rs:371:23
|
|
|
|
|
371 | let metrics = self.metrics.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `Arc::<events::EventMetrics>::clone(&self.metrics)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/mod.rs:372:31
|
|
|
|
|
372 | let _health_monitor = self.health_monitor.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Arc::<events::HealthMonitor>::clone(&self.health_monitor)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/mod.rs:380:32
|
|
|
|
|
380 | let shutdown_monitor = self.shutdown.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `Arc::<std::sync::atomic::AtomicBool>::clone(&self.shutdown)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/mod.rs:381:36
|
|
|
|
|
381 | let health_monitor_clone = self.health_monitor.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Arc::<events::HealthMonitor>::clone(&self.health_monitor)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/mod.rs:382:29
|
|
|
|
|
382 | let metrics_clone = self.metrics.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `Arc::<events::EventMetrics>::clone(&self.metrics)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/mod.rs:388:32
|
|
|
|
|
388 | let shutdown_metrics = self.shutdown.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `Arc::<std::sync::atomic::AtomicBool>::clone(&self.shutdown)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/events/mod.rs:389:33
|
|
|
|
|
389 | let metrics_reporting = self.metrics.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `Arc::<events::EventMetrics>::clone(&self.metrics)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/events/mod.rs:409:37
|
|
|
|
|
409 | let mut events_routed = 0;
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/events/mod.rs:427:46
|
|
|
|
|
427 | ... events_routed += 1;
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/events/mod.rs:436:33
|
|
|
|
|
436 | if events_routed == 0 {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/events/mod.rs:416:39
|
|
|
|
|
416 | let writer = &writers[writer_index % writers.len()];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/mod.rs:416:47
|
|
|
|
|
416 | let writer = &writers[writer_index % writers.len()];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/mod.rs:427:29
|
|
|
|
|
427 | ... events_routed += 1;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/mod.rs:430:40
|
|
|
|
|
430 | writer_index = (writer_index + 1) % writers.len();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/mod.rs:489:15
|
|
|
|
|
489 | .bind(snapshot.events_per_second as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/mod.rs:490:15
|
|
|
|
|
490 | .bind(snapshot.avg_capture_latency_ns as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/mod.rs:493:15
|
|
|
|
|
493 | .bind(snapshot.failed_writes as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/mod.rs:494:15
|
|
|
|
|
494 | .bind(snapshot.retried_writes as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/events/mod.rs:542:5
|
|
|
|
|
542 | /// EventMetrics
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
542 - /// EventMetrics
|
|
542 + /// `EventMetrics`
|
|
|
|
|
|
|
warning: you should consider adding a `Default` implementation for `EventMetrics`
|
|
--> trading_engine/src/events/mod.rs:560:5
|
|
|
|
|
560 | / pub fn new() -> Self {
|
|
561 | | Self {
|
|
562 | | events_captured: AtomicU64::new(0),
|
|
563 | | events_dropped: AtomicU64::new(0),
|
|
... |
|
|
574 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
= note: `-W clippy::new-without-default` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::new_without_default)]`
|
|
help: try adding this
|
|
|
|
|
559 + impl Default for EventMetrics {
|
|
560 + fn default() -> Self {
|
|
561 + Self::new()
|
|
562 + }
|
|
563 + }
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/events/mod.rs:599:40
|
|
|
|
|
599 | let latency_us = (latency_ms * 1000.0) as u64;
|
|
| ^^^^^^ help: consider adding suffix: `1_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/mod.rs:599:26
|
|
|
|
|
599 | let latency_us = (latency_ms * 1000.0) as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/events/mod.rs:599:26
|
|
|
|
|
599 | let latency_us = (latency_ms * 1000.0) as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/events/mod.rs:616:51
|
|
|
|
|
616 | let events_per_second = if elapsed_secs > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/events/mod.rs:631:85
|
|
|
|
|
631 | (self.write_latency_sum.load(Ordering::Relaxed) / write_count) as f64 / 1000.0
|
|
| ^^^^^^ help: consider adding suffix: `1_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/events/mod.rs:633:13
|
|
|
|
|
633 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/mod.rs:617:13
|
|
|
|
|
617 | (events_captured as f64 / elapsed_secs) as u64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/events/mod.rs:617:13
|
|
|
|
|
617 | (events_captured as f64 / elapsed_secs) as u64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/mod.rs:617:14
|
|
|
|
|
617 | (events_captured as f64 / elapsed_secs) as u64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/mod.rs:624:13
|
|
|
|
|
624 | self.capture_latency_sum.load(Ordering::Relaxed) / capture_count
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/events/mod.rs:624:13
|
|
|
|
|
624 | self.capture_latency_sum.load(Ordering::Relaxed) / capture_count
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/events/mod.rs:631:13
|
|
|
|
|
631 | (self.write_latency_sum.load(Ordering::Relaxed) / write_count) as f64 / 1000.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/events/mod.rs:631:13
|
|
|
|
|
631 | (self.write_latency_sum.load(Ordering::Relaxed) / write_count) as f64 / 1000.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/events/mod.rs:631:13
|
|
|
|
|
631 | (self.write_latency_sum.load(Ordering::Relaxed) / write_count) as f64 / 1000.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/events/mod.rs:631:13
|
|
|
|
|
631 | (self.write_latency_sum.load(Ordering::Relaxed) / write_count) as f64 / 1000.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/events/mod.rs:653:5
|
|
|
|
|
653 | /// EventMetricsSnapshot
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
653 - /// EventMetricsSnapshot
|
|
653 + /// `EventMetricsSnapshot`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/events/mod.rs:681:5
|
|
|
|
|
681 | /// HealthMonitor
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
681 - /// HealthMonitor
|
|
681 + /// `HealthMonitor`
|
|
|
|
|
|
|
warning: you should consider adding a `Default` implementation for `HealthMonitor`
|
|
--> trading_engine/src/events/mod.rs:689:5
|
|
|
|
|
689 | / pub fn new() -> Self {
|
|
690 | | Self {
|
|
691 | | status: RwLock::new(HealthStatus::Healthy),
|
|
692 | | }
|
|
693 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
688 + impl Default for HealthMonitor {
|
|
689 + fn default() -> Self {
|
|
690 + Self::new()
|
|
691 + }
|
|
692 + }
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/events/mod.rs:703:50
|
|
|
|
|
703 | } else if metrics.avg_write_latency_ms > 100.0 {
|
|
| ^^^^^ help: consider adding suffix: `100.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/events/mod.rs:699:47
|
|
|
|
|
699 | *status = if metrics.events_dropped > metrics.events_captured / 10 {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/events/mod.rs:719:5
|
|
|
|
|
719 | /// HealthStatus
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
719 - /// HealthStatus
|
|
719 + /// `HealthStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/events/mod.rs:735:5
|
|
|
|
|
735 | /// EventProcessingError
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
735 - /// EventProcessingError
|
|
735 + /// `EventProcessingError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/backup.rs:17:5
|
|
|
|
|
17 | /// BackupError
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
17 - /// BackupError
|
|
17 + /// `BackupError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/backup.rs:40:5
|
|
|
|
|
40 | /// BackupConfig
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
40 - /// BackupConfig
|
|
40 + /// `BackupConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/backup.rs:79:5
|
|
|
|
|
79 | /// BackupInfo
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
79 - /// BackupInfo
|
|
79 + /// `BackupInfo`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/backup.rs:103:5
|
|
|
|
|
103 | /// BackupComponent
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
103 - /// BackupComponent
|
|
103 + /// `BackupComponent`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/backup.rs:121:5
|
|
|
|
|
121 | /// ComponentType
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
121 - /// ComponentType
|
|
121 + /// `ComponentType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/backup.rs:141:5
|
|
|
|
|
141 | /// BackupVerificationStatus
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
141 - /// BackupVerificationStatus
|
|
141 + /// `BackupVerificationStatus`
|
|
|
|
|
|
|
warning: this can be `std::io::Error::other(_)`
|
|
--> trading_engine/src/persistence/backup.rs:174:42
|
|
|
|
|
174 | .map_err(|e| BackupError::Io(std::io::Error::new(
|
|
| __________________________________________^
|
|
175 | | std::io::ErrorKind::Other,
|
|
176 | | format!("Failed to get system time: {}", e)
|
|
177 | | )))?
|
|
| |_____________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error
|
|
= note: `-W clippy::io-other-error` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::io_other_error)]`
|
|
help: use `std::io::Error::other`
|
|
|
|
|
174 ~ .map_err(|e| BackupError::Io(std::io::Error::other(
|
|
175 ~ format!("Failed to get system time: {}", e)
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/backup.rs:189:13
|
|
|
|
|
189 | total_size += pg_backup.size_bytes;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/backup.rs:196:17
|
|
|
|
|
196 | total_size += influx_backup.size_bytes;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/backup.rs:203:13
|
|
|
|
|
203 | total_size += redis_backup.size_bytes;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/backup.rs:210:17
|
|
|
|
|
210 | total_size += ch_backup.size_bytes;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/backup.rs:217:13
|
|
|
|
|
217 | total_size += config_backup.size_bytes;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: the borrowed expression implements the required traits
|
|
--> trading_engine/src/persistence/backup.rs:293:18
|
|
|
|
|
293 | .arg(&format!(
|
|
| __________________^
|
|
294 | | "{}:8088",
|
|
295 | | self.extract_host_from_url(&self.persistence_config.influx.url)
|
|
296 | | ))
|
|
| |_____________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
= note: `-W clippy::needless-borrows-for-generic-args` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::needless_borrows_for_generic_args)]`
|
|
help: change this to
|
|
|
|
|
293 ~ .arg(format!(
|
|
294 + "{}:8088",
|
|
295 + self.extract_host_from_url(&self.persistence_config.influx.url)
|
|
296 ~ ))
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/backup.rs:474:33
|
|
|
|
|
474 | let retention_seconds = self.config.retention_days as u64 * 24 * 3600;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/backup.rs:474:33
|
|
|
|
|
474 | let retention_seconds = self.config.retention_days as u64 * 24 * 3600;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: this can be `std::io::Error::other(_)`
|
|
--> trading_engine/src/persistence/backup.rs:477:42
|
|
|
|
|
477 | .map_err(|e| BackupError::Io(std::io::Error::new(
|
|
| __________________________________________^
|
|
478 | | std::io::ErrorKind::Other,
|
|
479 | | format!("Failed to get system time: {}", e)
|
|
480 | | )))?
|
|
| |_____________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error
|
|
help: use `std::io::Error::other`
|
|
|
|
|
477 ~ .map_err(|e| BackupError::Io(std::io::Error::other(
|
|
478 ~ format!("Failed to get system time: {}", e)
|
|
|
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/persistence/backup.rs:495:29
|
|
|
|
|
495 | ... println!("Removing old backup: {}", backup_info.backup_id);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/clickhouse.rs:16:5
|
|
|
|
|
16 | /// ClickHouseError
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
16 - /// ClickHouseError
|
|
16 + /// `ClickHouseError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/clickhouse.rs:44:5
|
|
|
|
|
44 | /// ClickHouseConfig
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
44 - /// ClickHouseConfig
|
|
44 + /// `ClickHouseConfig`
|
|
|
|
|
|
|
warning: the borrowed expression implements the required traits
|
|
--> trading_engine/src/persistence/clickhouse.rs:142:23
|
|
|
|
|
142 | .post(&self.base_url.to_string())
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.base_url.to_string()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/clickhouse.rs:195:32
|
|
|
|
|
195 | actual_ms: elapsed.as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: the borrowed expression implements the required traits
|
|
--> trading_engine/src/persistence/clickhouse.rs:216:23
|
|
|
|
|
216 | .post(&self.base_url.to_string())
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.base_url.to_string()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/clickhouse.rs:253:32
|
|
|
|
|
253 | actual_ms: elapsed.as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: the borrowed expression implements the required traits
|
|
--> trading_engine/src/persistence/clickhouse.rs:285:23
|
|
|
|
|
285 | .post(&self.base_url.to_string())
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.base_url.to_string()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/clickhouse.rs:321:32
|
|
|
|
|
321 | actual_ms: elapsed.as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: the borrowed expression implements the required traits
|
|
--> trading_engine/src/persistence/clickhouse.rs:332:29
|
|
|
|
|
332 | self.client.get(&format!("{}/ping", self.base_url)).send(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}/ping", self.base_url)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/clickhouse.rs:358:9
|
|
|
|
|
358 | metrics.total_queries += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/clickhouse.rs:359:9
|
|
|
|
|
359 | metrics.total_query_duration_ms += duration.as_millis() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/clickhouse.rs:359:44
|
|
|
|
|
359 | metrics.total_query_duration_ms += duration.as_millis() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/clickhouse.rs:362:13
|
|
|
|
|
362 | metrics.successful_queries += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/clickhouse.rs:364:13
|
|
|
|
|
364 | metrics.failed_queries += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/clickhouse.rs:371:9
|
|
|
|
|
371 | metrics.total_inserts += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/clickhouse.rs:372:9
|
|
|
|
|
372 | metrics.total_insert_duration_ms += duration.as_millis() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/clickhouse.rs:372:45
|
|
|
|
|
372 | metrics.total_insert_duration_ms += duration.as_millis() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/clickhouse.rs:375:13
|
|
|
|
|
375 | metrics.successful_inserts += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/clickhouse.rs:377:13
|
|
|
|
|
377 | metrics.failed_inserts += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/clickhouse.rs:384:9
|
|
|
|
|
384 | metrics.total_ddl_operations += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/clickhouse.rs:385:9
|
|
|
|
|
385 | metrics.total_ddl_duration_ms += duration.as_millis() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/clickhouse.rs:385:42
|
|
|
|
|
385 | metrics.total_ddl_duration_ms += duration.as_millis() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/clickhouse.rs:388:13
|
|
|
|
|
388 | metrics.successful_ddl_operations += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/clickhouse.rs:390:13
|
|
|
|
|
390 | metrics.failed_ddl_operations += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/clickhouse.rs:397:5
|
|
|
|
|
397 | /// QueryResult
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
397 - /// QueryResult
|
|
397 + /// `QueryResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/clickhouse.rs:411:5
|
|
|
|
|
411 | /// InsertResult
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
411 - /// InsertResult
|
|
411 + /// `InsertResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/clickhouse.rs:423:5
|
|
|
|
|
423 | /// ClickHouseMetrics
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
423 - /// ClickHouseMetrics
|
|
423 + /// `ClickHouseMetrics`
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/persistence/clickhouse.rs:476:13
|
|
|
|
|
476 | self.total_query_duration_ms as f64 / self.total_queries as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/clickhouse.rs:476:13
|
|
|
|
|
476 | self.total_query_duration_ms as f64 / self.total_queries as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/clickhouse.rs:476:51
|
|
|
|
|
476 | self.total_query_duration_ms as f64 / self.total_queries as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/persistence/clickhouse.rs:485:13
|
|
|
|
|
485 | self.total_insert_duration_ms as f64 / self.total_inserts as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/clickhouse.rs:485:13
|
|
|
|
|
485 | self.total_insert_duration_ms as f64 / self.total_inserts as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/clickhouse.rs:485:52
|
|
|
|
|
485 | self.total_insert_duration_ms as f64 / self.total_inserts as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/persistence/clickhouse.rs:494:13
|
|
|
|
|
494 | (self.successful_queries as f64 / self.total_queries as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/clickhouse.rs:494:14
|
|
|
|
|
494 | (self.successful_queries as f64 / self.total_queries as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/clickhouse.rs:494:47
|
|
|
|
|
494 | (self.successful_queries as f64 / self.total_queries as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/persistence/clickhouse.rs:503:13
|
|
|
|
|
503 | (self.successful_inserts as f64 / self.total_inserts as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/clickhouse.rs:503:14
|
|
|
|
|
503 | (self.successful_inserts as f64 / self.total_inserts as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/clickhouse.rs:503:47
|
|
|
|
|
503 | (self.successful_inserts as f64 / self.total_inserts as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/clickhouse.rs:509:25
|
|
|
|
|
509 | let total_ops = self.total_queries + self.total_inserts + self.total_ddl_operations;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/clickhouse.rs:514:17
|
|
|
|
|
514 | self.successful_queries + self.successful_inserts + self.successful_ddl_operations;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/persistence/clickhouse.rs:515:13
|
|
|
|
|
515 | (successful_ops as f64 / total_ops as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/clickhouse.rs:515:14
|
|
|
|
|
515 | (successful_ops as f64 / total_ops as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/clickhouse.rs:515:38
|
|
|
|
|
515 | (successful_ops as f64 / total_ops as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/health.rs:17:5
|
|
|
|
|
17 | /// HealthError
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
17 - /// HealthError
|
|
17 + /// `HealthError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/health.rs:40:5
|
|
|
|
|
40 | /// HealthStatus
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
40 - /// HealthStatus
|
|
40 + /// `HealthStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/health.rs:62:5
|
|
|
|
|
62 | /// ComponentHealth
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
62 - /// ComponentHealth
|
|
62 + /// `ComponentHealth`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/health.rs:80:5
|
|
|
|
|
80 | /// SystemStatus
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
80 - /// SystemStatus
|
|
80 + /// `SystemStatus`
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:132:34
|
|
|
|
|
132 | check_timestamp: chrono::Utc::now().timestamp() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:175:30
|
|
|
|
|
175 | check_timestamp: chrono::Utc::now().timestamp() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:176:32
|
|
|
|
|
176 | check_duration_ms: check_duration.as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:195:29
|
|
|
|
|
195 | latency_ms: latency.as_millis() as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:197:45
|
|
|
|
|
197 | last_successful_check: Some(chrono::Utc::now().timestamp() as u64),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:202:29
|
|
|
|
|
202 | latency_ms: latency.as_millis() as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:209:29
|
|
|
|
|
209 | latency_ms: self.timeout_duration.as_millis() as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:232:29
|
|
|
|
|
232 | latency_ms: latency.as_millis() as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:234:45
|
|
|
|
|
234 | last_successful_check: Some(chrono::Utc::now().timestamp() as u64),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:239:29
|
|
|
|
|
239 | latency_ms: latency.as_millis() as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:246:29
|
|
|
|
|
246 | latency_ms: self.timeout_duration.as_millis() as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:269:29
|
|
|
|
|
269 | latency_ms: latency.as_millis() as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:271:45
|
|
|
|
|
271 | last_successful_check: Some(chrono::Utc::now().timestamp() as u64),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:276:29
|
|
|
|
|
276 | latency_ms: latency.as_millis() as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:283:29
|
|
|
|
|
283 | latency_ms: self.timeout_duration.as_millis() as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:306:29
|
|
|
|
|
306 | latency_ms: latency.as_millis() as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:308:45
|
|
|
|
|
308 | last_successful_check: Some(chrono::Utc::now().timestamp() as u64),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:313:29
|
|
|
|
|
313 | latency_ms: latency.as_millis() as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:320:29
|
|
|
|
|
320 | latency_ms: self.timeout_duration.as_millis() as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using `contains()` instead of `iter().any()` is more efficient
|
|
--> trading_engine/src/persistence/health.rs:332:19
|
|
|
|
|
332 | } else if statuses.iter().any(|s| *s == SystemStatus::Unhealthy) {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `statuses.contains(&SystemStatus::Unhealthy)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains
|
|
= note: `-W clippy::manual-contains` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::manual_contains)]`
|
|
|
|
warning: using `contains()` instead of `iter().any()` is more efficient
|
|
--> trading_engine/src/persistence/health.rs:334:19
|
|
|
|
|
334 | } else if statuses.iter().any(|s| *s == SystemStatus::Degraded) {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `statuses.contains(&SystemStatus::Degraded)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/health.rs:392:9
|
|
|
|
|
392 | total_components += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/health.rs:394:13
|
|
|
|
|
394 | operational_components += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/health.rs:399:9
|
|
|
|
|
399 | total_components += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/health.rs:401:13
|
|
|
|
|
401 | operational_components += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/health.rs:406:9
|
|
|
|
|
406 | total_components += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/health.rs:408:13
|
|
|
|
|
408 | operational_components += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/health.rs:414:13
|
|
|
|
|
414 | total_components += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/health.rs:416:17
|
|
|
|
|
416 | operational_components += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/persistence/health.rs:424:37
|
|
|
|
|
424 | operational_percentage: (operational_components as f64 / total_components as f64)
|
|
| _____________________________________^
|
|
425 | | * 100.0,
|
|
| |_______________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:424:38
|
|
|
|
|
424 | operational_percentage: (operational_components as f64 / total_components as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/health.rs:424:70
|
|
|
|
|
424 | operational_percentage: (operational_components as f64 / total_components as f64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/health.rs:434:5
|
|
|
|
|
434 | /// HealthSummary
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
434 - /// HealthSummary
|
|
434 + /// `HealthSummary`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/influxdb.rs:16:5
|
|
|
|
|
16 | /// InfluxError
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
16 - /// InfluxError
|
|
16 + /// `InfluxError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/influxdb.rs:44:5
|
|
|
|
|
44 | /// InfluxConfig
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
44 - /// InfluxConfig
|
|
44 + /// `InfluxConfig`
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/influxdb.rs:202:32
|
|
|
|
|
202 | actual_ms: elapsed.as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/influxdb.rs:260:32
|
|
|
|
|
260 | actual_ms: elapsed.as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/influxdb.rs:298:9
|
|
|
|
|
298 | metrics.total_writes += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/influxdb.rs:299:9
|
|
|
|
|
299 | metrics.total_points_written += points_written as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/influxdb.rs:299:41
|
|
|
|
|
299 | metrics.total_points_written += points_written as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/influxdb.rs:300:9
|
|
|
|
|
300 | metrics.total_write_duration_ms += duration.as_millis() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/influxdb.rs:300:44
|
|
|
|
|
300 | metrics.total_write_duration_ms += duration.as_millis() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/influxdb.rs:303:13
|
|
|
|
|
303 | metrics.successful_writes += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/influxdb.rs:305:13
|
|
|
|
|
305 | metrics.failed_writes += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/influxdb.rs:312:9
|
|
|
|
|
312 | metrics.total_queries += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/influxdb.rs:313:9
|
|
|
|
|
313 | metrics.total_query_duration_ms += duration.as_millis() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/influxdb.rs:313:44
|
|
|
|
|
313 | metrics.total_query_duration_ms += duration.as_millis() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/influxdb.rs:316:13
|
|
|
|
|
316 | metrics.successful_queries += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/influxdb.rs:318:13
|
|
|
|
|
318 | metrics.failed_queries += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/influxdb.rs:325:5
|
|
|
|
|
325 | /// DataPoint
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
325 - /// DataPoint
|
|
325 + /// `DataPoint`
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/influxdb.rs:344:22
|
|
|
|
|
344 | .map(|d| d.as_nanos() as u64)
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `format!(..)` appended to existing `String`
|
|
--> trading_engine/src/persistence/influxdb.rs:379:13
|
|
|
|
|
379 | line.push_str(&format!(",{}={}", key, value));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `write!` to avoid the extra allocation
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string
|
|
= note: requested on the command line with `-D clippy::format-push-string`
|
|
|
|
error: `format!(..)` appended to existing `String`
|
|
--> trading_engine/src/persistence/influxdb.rs:394:13
|
|
|
|
|
394 | line.push_str(&format!(" {}", ts));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `write!` to avoid the extra allocation
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/influxdb.rs:403:5
|
|
|
|
|
403 | /// FieldValue
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
403 - /// FieldValue
|
|
403 + /// `FieldValue`
|
|
|
|
|
|
|
warning: implementation of inherent method `to_string(&self) -> String` for type `persistence::influxdb::FieldValue`
|
|
--> trading_engine/src/persistence/influxdb.rs:418:5
|
|
|
|
|
418 | / fn to_string(&self) -> String {
|
|
419 | | match self {
|
|
420 | | FieldValue::Float(f) => f.to_string(),
|
|
421 | | FieldValue::Integer(i) => format!("{}i", i),
|
|
... |
|
|
425 | | }
|
|
| |_____^
|
|
|
|
|
= help: implement trait `Display` for type `persistence::influxdb::FieldValue` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string
|
|
= note: `-W clippy::inherent-to-string` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::inherent_to_string)]`
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/influxdb.rs:430:5
|
|
|
|
|
430 | /// QueryResult
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
430 - /// QueryResult
|
|
430 + /// `QueryResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/influxdb.rs:442:5
|
|
|
|
|
442 | /// InfluxMetrics
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
442 - /// InfluxMetrics
|
|
442 + /// `InfluxMetrics`
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/persistence/influxdb.rs:486:13
|
|
|
|
|
486 | self.total_write_duration_ms as f64 / self.total_writes as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/influxdb.rs:486:13
|
|
|
|
|
486 | self.total_write_duration_ms as f64 / self.total_writes as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/influxdb.rs:486:51
|
|
|
|
|
486 | self.total_write_duration_ms as f64 / self.total_writes as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/persistence/influxdb.rs:495:13
|
|
|
|
|
495 | self.total_query_duration_ms as f64 / self.total_queries as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/influxdb.rs:495:13
|
|
|
|
|
495 | self.total_query_duration_ms as f64 / self.total_queries as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/influxdb.rs:495:51
|
|
|
|
|
495 | self.total_query_duration_ms as f64 / self.total_queries as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/persistence/influxdb.rs:504:13
|
|
|
|
|
504 | (self.successful_writes as f64 / self.total_writes as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/influxdb.rs:504:14
|
|
|
|
|
504 | (self.successful_writes as f64 / self.total_writes as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/influxdb.rs:504:46
|
|
|
|
|
504 | (self.successful_writes as f64 / self.total_writes as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/persistence/influxdb.rs:513:13
|
|
|
|
|
513 | (self.successful_queries as f64 / self.total_queries as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/influxdb.rs:513:14
|
|
|
|
|
513 | (self.successful_queries as f64 / self.total_queries as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/influxdb.rs:513:47
|
|
|
|
|
513 | (self.successful_queries as f64 / self.total_queries as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/migrations.rs:17:5
|
|
|
|
|
17 | /// MigrationError
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
17 - /// MigrationError
|
|
17 + /// `MigrationError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/migrations.rs:65:5
|
|
|
|
|
65 | /// MigrationResult
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
65 - /// MigrationResult
|
|
65 + /// `MigrationResult`
|
|
|
|
|
|
|
warning: this loop could be written as a `for` loop
|
|
--> trading_engine/src/persistence/migrations.rs:137:9
|
|
|
|
|
137 | while let Some(entry) = entries.next() {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for entry in entries`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator
|
|
= note: `-W clippy::while-let-on-iterator` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::while_let_on_iterator)]`
|
|
|
|
error: `entry` is shadowed
|
|
--> trading_engine/src/persistence/migrations.rs:138:17
|
|
|
|
|
138 | let entry = entry?;
|
|
| ^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/persistence/migrations.rs:137:24
|
|
|
|
|
137 | while let Some(entry) = entries.next() {
|
|
| ^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_reuse
|
|
|
|
error: this could be simplified with `bool::then`
|
|
--> trading_engine/src/persistence/migrations.rs:171:24
|
|
|
|
|
171 | let down_sql = if down_path.exists() {
|
|
| ________________________^
|
|
172 | | Some(fs::read_to_string(down_path)?)
|
|
173 | | } else {
|
|
... |
|
|
176 | | };
|
|
| |_________^ help: try: `down_path.exists().then(|| fs::read_to_string(down_path)?)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_some_else_none
|
|
|
|
warning: this `if` has identical blocks
|
|
--> trading_engine/src/persistence/migrations.rs:180:58
|
|
|
|
|
180 | let id = if parts.len() >= 2 && parts[1] == "up" {
|
|
| __________________________________________________________^
|
|
181 | | parts[0].to_owned()
|
|
182 | | } else {
|
|
| |_________^
|
|
|
|
|
note: same as this
|
|
--> trading_engine/src/persistence/migrations.rs:182:16
|
|
|
|
|
182 | } else {
|
|
| ________________^
|
|
183 | | parts[0].to_owned()
|
|
184 | | };
|
|
| |_________^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
|
|
= note: `-W clippy::if-same-then-else` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::if_same_then_else)]`
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/persistence/migrations.rs:180:41
|
|
|
|
|
180 | let id = if parts.len() >= 2 && parts[1] == "up" {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/persistence/migrations.rs:181:13
|
|
|
|
|
181 | parts[0].to_owned()
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/persistence/migrations.rs:183:13
|
|
|
|
|
183 | parts[0].to_owned()
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: slicing may panic
|
|
--> trading_engine/src/persistence/migrations.rs:187:13
|
|
|
|
|
187 | parts[2..].join("_")
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n..)` or .get_mut(n..)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/migrations.rs:227:41
|
|
|
|
|
227 | execution_time_ms: Some(row.get::<i64, _>("execution_time_ms") as u64),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/persistence/migrations.rs:248:17
|
|
|
|
|
248 | println!("Running migration: {} - {}", migration.id, migration.name);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/migrations.rs:292:38
|
|
|
|
|
292 | let execution_time = start.elapsed().as_millis() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/migrations.rs:298:27
|
|
|
|
|
298 | .bind(execution_time as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/migrations.rs:320:40
|
|
|
|
|
320 | execution_time_ms: start.elapsed().as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/migrations.rs:371:40
|
|
|
|
|
371 | execution_time_ms: start.elapsed().as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/migrations.rs:383:40
|
|
|
|
|
383 | execution_time_ms: start.elapsed().as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/postgres.rs:16:5
|
|
|
|
|
16 | /// PostgresError
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
16 - /// PostgresError
|
|
16 + /// `PostgresError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/postgres.rs:38:5
|
|
|
|
|
38 | /// PostgresConfig
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
38 - /// PostgresConfig
|
|
38 + /// `PostgresConfig`
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/postgres.rs:208:34
|
|
|
|
|
208 | if elapsed.as_micros() > self.config.query_timeout_micros as u128 {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/postgres.rs:210:28
|
|
|
|
|
210 | actual_ms: elapsed.as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/persistence/postgres.rs:211:25
|
|
|
|
|
211 | max_ms: self.config.query_timeout_micros / 1000,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/postgres.rs:219:28
|
|
|
|
|
219 | actual_ms: elapsed.as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/persistence/postgres.rs:220:25
|
|
|
|
|
220 | max_ms: self.config.query_timeout_micros / 1000,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/postgres.rs:244:34
|
|
|
|
|
244 | if elapsed.as_micros() > self.config.query_timeout_micros as u128 {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/postgres.rs:246:28
|
|
|
|
|
246 | actual_ms: elapsed.as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/persistence/postgres.rs:247:25
|
|
|
|
|
247 | max_ms: self.config.query_timeout_micros / 1000,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/postgres.rs:255:28
|
|
|
|
|
255 | actual_ms: elapsed.as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/persistence/postgres.rs:256:25
|
|
|
|
|
256 | max_ms: self.config.query_timeout_micros / 1000,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/postgres.rs:282:28
|
|
|
|
|
282 | actual_ms: elapsed.as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/postgres.rs:297:19
|
|
|
|
|
297 | idle: self.pool.num_idle() as u32,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/postgres.rs:298:21
|
|
|
|
|
298 | active: self.pool.size() - self.pool.num_idle() as u32,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/postgres.rs:298:40
|
|
|
|
|
298 | active: self.pool.size() - self.pool.num_idle() as u32,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/postgres.rs:306:9
|
|
|
|
|
306 | metrics.total_queries += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/postgres.rs:307:9
|
|
|
|
|
307 | metrics.total_duration_micros += duration.as_micros() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/postgres.rs:307:42
|
|
|
|
|
307 | metrics.total_duration_micros += duration.as_micros() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/postgres.rs:310:13
|
|
|
|
|
310 | metrics.successful_queries += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/postgres.rs:312:13
|
|
|
|
|
312 | metrics.failed_queries += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/postgres.rs:315:35
|
|
|
|
|
315 | if duration.as_micros() > self.config.query_timeout_micros as u128 {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/postgres.rs:316:13
|
|
|
|
|
316 | metrics.slow_queries += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/postgres.rs:321:13
|
|
|
|
|
321 | metrics.sub_500_micros += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/postgres.rs:323:13
|
|
|
|
|
323 | metrics.sub_1ms += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/postgres.rs:325:13
|
|
|
|
|
325 | metrics.over_1ms += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/postgres.rs:332:5
|
|
|
|
|
332 | /// PostgresMetrics
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
332 - /// PostgresMetrics
|
|
332 + /// `PostgresMetrics`
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/persistence/postgres.rs:373:13
|
|
|
|
|
373 | self.total_duration_micros as f64 / self.total_queries as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/postgres.rs:373:13
|
|
|
|
|
373 | self.total_duration_micros as f64 / self.total_queries as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/postgres.rs:373:49
|
|
|
|
|
373 | self.total_duration_micros as f64 / self.total_queries as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/persistence/postgres.rs:382:13
|
|
|
|
|
382 | (self.successful_queries as f64 / self.total_queries as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/postgres.rs:382:14
|
|
|
|
|
382 | (self.successful_queries as f64 / self.total_queries as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/postgres.rs:382:47
|
|
|
|
|
382 | (self.successful_queries as f64 / self.total_queries as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/persistence/postgres.rs:391:13
|
|
|
|
|
391 | ((self.sub_500_micros + self.sub_1ms) as f64 / self.total_queries as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/postgres.rs:391:14
|
|
|
|
|
391 | ((self.sub_500_micros + self.sub_1ms) as f64 / self.total_queries as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/postgres.rs:391:14
|
|
|
|
|
391 | ((self.sub_500_micros + self.sub_1ms) as f64 / self.total_queries as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/postgres.rs:391:60
|
|
|
|
|
391 | ((self.sub_500_micros + self.sub_1ms) as f64 / self.total_queries as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/postgres.rs:398:5
|
|
|
|
|
398 | /// PoolStats
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
398 - /// PoolStats
|
|
398 + /// `PoolStats`
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/persistence/postgres.rs:415:9
|
|
|
|
|
415 | (self.active as f64 / self.max_size as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/postgres.rs:415:10
|
|
|
|
|
415 | (self.active as f64 / self.max_size as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/postgres.rs:415:31
|
|
|
|
|
415 | (self.active as f64 / self.max_size as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/redis.rs:20:5
|
|
|
|
|
20 | /// RedisError
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
20 - /// RedisError
|
|
20 + /// `RedisError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/redis.rs:52:5
|
|
|
|
|
52 | /// RedisConfig
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
52 - /// RedisConfig
|
|
52 + /// `RedisConfig`
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/redis.rs:141:60
|
|
|
|
|
141 | let connection_semaphore = Arc::new(Semaphore::new(config.max_connections as usize));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: used underscore-prefixed binding
|
|
--> trading_engine/src/persistence/redis.rs:151:13
|
|
|
|
|
151 | _warm_connections,
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: binding is defined here
|
|
--> trading_engine/src/persistence/redis.rs:144:13
|
|
|
|
|
144 | let _warm_connections = Arc::new(RwLock::new(VecDeque::new()));
|
|
| ^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding
|
|
= note: requested on the command line with `-W clippy::used-underscore-binding`
|
|
|
|
warning: this let-binding has unit value
|
|
--> trading_engine/src/persistence/redis.rs:172:9
|
|
|
|
|
172 | / let _permit = tokio::time::timeout(
|
|
173 | | Duration::from_millis(self.config.acquire_timeout_ms),
|
|
174 | | self.connection_semaphore.acquire(),
|
|
... |
|
|
177 | | .map_err(|_| RedisError::PoolExhausted)??
|
|
178 | | .forget();
|
|
| |__________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
|
|
= note: `-W clippy::let-unit-value` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::let_unit_value)]`
|
|
help: omit the `let` binding
|
|
|
|
|
172 ~ tokio::time::timeout(
|
|
173 + Duration::from_millis(self.config.acquire_timeout_ms),
|
|
174 + self.connection_semaphore.acquire(),
|
|
175 + )
|
|
176 + .await
|
|
177 + .map_err(|_| RedisError::PoolExhausted)??
|
|
178 + .forget();
|
|
|
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/persistence/redis.rs:177:18
|
|
|
|
|
177 | .map_err(|_| RedisError::PoolExhausted)??
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/persistence/redis.rs:187:18
|
|
|
|
|
187 | .map_err(|_| RedisError::Timeout {
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/redis.rs:188:24
|
|
|
|
|
188 | actual_ms: start.elapsed().as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/persistence/redis.rs:189:21
|
|
|
|
|
189 | max_ms: self.config.command_timeout_micros / 1000,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: this let-binding has unit value
|
|
--> trading_engine/src/persistence/redis.rs:226:9
|
|
|
|
|
226 | / let _permit = tokio::time::timeout(
|
|
227 | | Duration::from_millis(self.config.acquire_timeout_ms),
|
|
228 | | self.connection_semaphore.acquire(),
|
|
... |
|
|
231 | | .map_err(|_| RedisError::PoolExhausted)??
|
|
232 | | .forget();
|
|
| |__________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
|
|
help: omit the `let` binding
|
|
|
|
|
226 ~ tokio::time::timeout(
|
|
227 + Duration::from_millis(self.config.acquire_timeout_ms),
|
|
228 + self.connection_semaphore.acquire(),
|
|
229 + )
|
|
230 + .await
|
|
231 + .map_err(|_| RedisError::PoolExhausted)??
|
|
232 + .forget();
|
|
|
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/persistence/redis.rs:231:18
|
|
|
|
|
231 | .map_err(|_| RedisError::PoolExhausted)??
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
error: `ttl` is shadowed
|
|
--> trading_engine/src/persistence/redis.rs:239:34
|
|
|
|
|
239 | let result = if let Some(ttl) = ttl {
|
|
| ^^^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/persistence/redis.rs:218:9
|
|
|
|
|
218 | ttl: Option<Duration>,
|
|
| ^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_reuse
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/redis.rs:267:32
|
|
|
|
|
267 | actual_ms: elapsed.as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/persistence/redis.rs:268:29
|
|
|
|
|
268 | max_ms: self.config.command_timeout_micros / 1000,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/persistence/redis.rs:305:36
|
|
|
|
|
305 | Ok(deleted_count > 0)
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: this let-binding has unit value
|
|
--> trading_engine/src/persistence/redis.rs:279:9
|
|
|
|
|
279 | / let _permit = tokio::time::timeout(
|
|
280 | | Duration::from_millis(self.config.acquire_timeout_ms),
|
|
281 | | self.connection_semaphore.acquire(),
|
|
... |
|
|
284 | | .map_err(|_| RedisError::PoolExhausted)??
|
|
285 | | .forget();
|
|
| |__________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
|
|
help: omit the `let` binding
|
|
|
|
|
279 ~ tokio::time::timeout(
|
|
280 + Duration::from_millis(self.config.acquire_timeout_ms),
|
|
281 + self.connection_semaphore.acquire(),
|
|
282 + )
|
|
283 + .await
|
|
284 + .map_err(|_| RedisError::PoolExhausted)??
|
|
285 + .forget();
|
|
|
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/persistence/redis.rs:284:18
|
|
|
|
|
284 | .map_err(|_| RedisError::PoolExhausted)??
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/persistence/redis.rs:294:18
|
|
|
|
|
294 | .map_err(|_| RedisError::Timeout {
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/redis.rs:295:24
|
|
|
|
|
295 | actual_ms: start.elapsed().as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/persistence/redis.rs:296:21
|
|
|
|
|
296 | max_ms: self.config.command_timeout_micros / 1000,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: this let-binding has unit value
|
|
--> trading_engine/src/persistence/redis.rs:319:9
|
|
|
|
|
319 | / let _permit = tokio::time::timeout(
|
|
320 | | Duration::from_millis(self.config.acquire_timeout_ms),
|
|
321 | | self.connection_semaphore.acquire(),
|
|
... |
|
|
324 | | .map_err(|_| RedisError::PoolExhausted)??
|
|
325 | | .forget();
|
|
| |__________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
|
|
help: omit the `let` binding
|
|
|
|
|
319 ~ tokio::time::timeout(
|
|
320 + Duration::from_millis(self.config.acquire_timeout_ms),
|
|
321 + self.connection_semaphore.acquire(),
|
|
322 + )
|
|
323 + .await
|
|
324 + .map_err(|_| RedisError::PoolExhausted)??
|
|
325 + .forget();
|
|
|
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/persistence/redis.rs:324:18
|
|
|
|
|
324 | .map_err(|_| RedisError::PoolExhausted)??
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/persistence/redis.rs:334:18
|
|
|
|
|
334 | .map_err(|_| RedisError::Timeout {
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/redis.rs:335:24
|
|
|
|
|
335 | actual_ms: start.elapsed().as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/persistence/redis.rs:336:21
|
|
|
|
|
336 | max_ms: self.config.command_timeout_micros / 1000,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: this let-binding has unit value
|
|
--> trading_engine/src/persistence/redis.rs:362:9
|
|
|
|
|
362 | / let _permit = tokio::time::timeout(
|
|
363 | | Duration::from_millis(self.config.acquire_timeout_ms),
|
|
364 | | self.connection_semaphore.acquire(),
|
|
... |
|
|
367 | | .map_err(|_| RedisError::PoolExhausted)??
|
|
368 | | .forget();
|
|
| |__________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
|
|
help: omit the `let` binding
|
|
|
|
|
362 ~ tokio::time::timeout(
|
|
363 + Duration::from_millis(self.config.acquire_timeout_ms),
|
|
364 + self.connection_semaphore.acquire(),
|
|
365 + )
|
|
366 + .await
|
|
367 + .map_err(|_| RedisError::PoolExhausted)??
|
|
368 + .forget();
|
|
|
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/persistence/redis.rs:367:18
|
|
|
|
|
367 | .map_err(|_| RedisError::PoolExhausted)??
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:376:35
|
|
|
|
|
376 | Duration::from_micros(self.config.command_timeout_micros * 10), // More time for pipelines
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/redis.rs:396:32
|
|
|
|
|
396 | actual_ms: elapsed.as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/persistence/redis.rs:397:29
|
|
|
|
|
397 | max_ms: (self.config.command_timeout_micros * 10) / 1000,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:397:29
|
|
|
|
|
397 | max_ms: (self.config.command_timeout_micros * 10) / 1000,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/persistence/redis.rs:426:18
|
|
|
|
|
426 | .map_err(|_| RedisError::Timeout {
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/redis.rs:427:24
|
|
|
|
|
427 | actual_ms: start.elapsed().as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/persistence/redis.rs:474:18
|
|
|
|
|
474 | .map_err(|_| RedisError::Timeout {
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:470:35
|
|
|
|
|
470 | Duration::from_micros(self.config.command_timeout_micros * keys.len() as u64),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/redis.rs:470:72
|
|
|
|
|
470 | Duration::from_micros(self.config.command_timeout_micros * keys.len() as u64),
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/redis.rs:475:24
|
|
|
|
|
475 | actual_ms: start.elapsed().as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/persistence/redis.rs:476:21
|
|
|
|
|
476 | max_ms: self.config.command_timeout_micros * keys.len() as u64 / 1000,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:476:21
|
|
|
|
|
476 | max_ms: self.config.command_timeout_micros * keys.len() as u64 / 1000,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/redis.rs:476:58
|
|
|
|
|
476 | max_ms: self.config.command_timeout_micros * keys.len() as u64 / 1000,
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:516:17
|
|
|
|
|
516 | metrics.total_gets += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:518:21
|
|
|
|
|
518 | metrics.successful_gets += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:520:21
|
|
|
|
|
520 | metrics.failed_gets += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:524:17
|
|
|
|
|
524 | metrics.total_sets += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:526:21
|
|
|
|
|
526 | metrics.successful_sets += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:528:21
|
|
|
|
|
528 | metrics.failed_sets += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:532:17
|
|
|
|
|
532 | metrics.total_deletes += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:534:21
|
|
|
|
|
534 | metrics.successful_deletes += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:536:21
|
|
|
|
|
536 | metrics.failed_deletes += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:540:17
|
|
|
|
|
540 | metrics.total_exists += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:542:21
|
|
|
|
|
542 | metrics.successful_exists += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:544:21
|
|
|
|
|
544 | metrics.failed_exists += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:548:17
|
|
|
|
|
548 | metrics.total_pipelines += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:550:21
|
|
|
|
|
550 | metrics.successful_pipelines += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:552:21
|
|
|
|
|
552 | metrics.failed_pipelines += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:558:9
|
|
|
|
|
558 | metrics.total_operations += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:559:9
|
|
|
|
|
559 | metrics.total_duration_micros += duration.as_micros() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/redis.rs:559:42
|
|
|
|
|
559 | metrics.total_duration_micros += duration.as_micros() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:562:13
|
|
|
|
|
562 | metrics.successful_operations += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:564:13
|
|
|
|
|
564 | metrics.failed_operations += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:569:13
|
|
|
|
|
569 | metrics.sub_500_micros += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:571:13
|
|
|
|
|
571 | metrics.sub_1ms += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:573:13
|
|
|
|
|
573 | metrics.over_1ms += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/redis.rs:580:5
|
|
|
|
|
580 | /// RedisMetrics
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
580 - /// RedisMetrics
|
|
580 + /// `RedisMetrics`
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/persistence/redis.rs:663:13
|
|
|
|
|
663 | self.total_duration_micros as f64 / self.total_operations as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/redis.rs:663:13
|
|
|
|
|
663 | self.total_duration_micros as f64 / self.total_operations as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/redis.rs:663:49
|
|
|
|
|
663 | self.total_duration_micros as f64 / self.total_operations as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/persistence/redis.rs:672:13
|
|
|
|
|
672 | (self.successful_operations as f64 / self.total_operations as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/redis.rs:672:14
|
|
|
|
|
672 | (self.successful_operations as f64 / self.total_operations as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/redis.rs:672:50
|
|
|
|
|
672 | (self.successful_operations as f64 / self.total_operations as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/persistence/redis.rs:681:13
|
|
|
|
|
681 | ((self.sub_500_micros + self.sub_1ms) as f64 / self.total_operations as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/redis.rs:681:14
|
|
|
|
|
681 | ((self.sub_500_micros + self.sub_1ms) as f64 / self.total_operations as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/persistence/redis.rs:681:14
|
|
|
|
|
681 | ((self.sub_500_micros + self.sub_1ms) as f64 / self.total_operations as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/redis.rs:681:60
|
|
|
|
|
681 | ((self.sub_500_micros + self.sub_1ms) as f64 / self.total_operations as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/persistence/redis.rs:690:13
|
|
|
|
|
690 | (self.successful_gets as f64 / self.total_gets as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/redis.rs:690:14
|
|
|
|
|
690 | (self.successful_gets as f64 / self.total_gets as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/persistence/redis.rs:690:44
|
|
|
|
|
690 | (self.successful_gets as f64 / self.total_gets as f64) * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/mod.rs:50:5
|
|
|
|
|
50 | /// PersistenceConfig
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
50 - /// PersistenceConfig
|
|
50 + /// `PersistenceConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/mod.rs:68:5
|
|
|
|
|
68 | /// GlobalPersistenceConfig
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
68 - /// GlobalPersistenceConfig
|
|
68 + /// `GlobalPersistenceConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/mod.rs:101:5
|
|
|
|
|
101 | /// PersistenceError
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
101 - /// PersistenceError
|
|
101 + /// `PersistenceError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/persistence/mod.rs:252:5
|
|
|
|
|
252 | /// PersistenceMetrics
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
252 - /// PersistenceMetrics
|
|
252 + /// `PersistenceMetrics`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/compliance_repository.rs:45:5
|
|
|
|
|
45 | /// ComplianceRepositoryResult
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
45 - /// ComplianceRepositoryResult
|
|
45 + /// `ComplianceRepositoryResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/compliance_repository.rs:266:29
|
|
|
|
|
266 | /// reporting including all MiFID II and similar regulatory requirements.
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
266 - /// reporting including all MiFID II and similar regulatory requirements.
|
|
266 + /// reporting including all `MiFID` II and similar regulatory requirements.
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/compliance_repository.rs:432:17
|
|
|
|
|
432 | "Mock failure".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock failure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/compliance_repository.rs:441:17
|
|
|
|
|
441 | "Mock failure".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock failure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/compliance_repository.rs:451:17
|
|
|
|
|
451 | "Mock failure".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock failure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/compliance_repository.rs:468:17
|
|
|
|
|
468 | "Mock failure".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock failure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `limit` is shadowed
|
|
--> trading_engine/src/repositories/compliance_repository.rs:491:21
|
|
|
|
|
491 | if let Some(limit) = limit {
|
|
| ^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/repositories/compliance_repository.rs:464:9
|
|
|
|
|
464 | limit: Option<u32>,
|
|
| ^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_reuse
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/repositories/compliance_repository.rs:492:31
|
|
|
|
|
492 | filtered.truncate(limit as usize);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/compliance_repository.rs:505:17
|
|
|
|
|
505 | "Mock failure".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock failure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/compliance_repository.rs:521:29
|
|
|
|
|
521 | time_range: "Mock range".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock range".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/compliance_repository.rs:523:29
|
|
|
|
|
523 | file_path: Some("/tmp/mock_report.json".to_string()),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"/tmp/mock_report.json".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/compliance_repository.rs:537:17
|
|
|
|
|
537 | "Mock failure".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock failure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/compliance_repository.rs:549:17
|
|
|
|
|
549 | "Mock failure".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock failure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/repositories/compliance_repository.rs:560:27
|
|
|
|
|
560 | let event_count = self.events.read().await.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/repositories/compliance_repository.rs:568:33
|
|
|
|
|
568 | storage_size_bytes: event_count * 1024,
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/repositories/compliance_repository.rs:573:21
|
|
|
|
|
573 | let count = self.events.read().await.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/repositories/compliance_repository.rs:582:28
|
|
|
|
|
582 | total_records: self.events.read().await.len() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/compliance_repository.rs:592:17
|
|
|
|
|
592 | "Mock failure".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock failure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/event_repository.rs:4:14
|
|
|
|
|
4 | //! from the EventProcessor and related components.
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
4 - //! from the EventProcessor and related components.
|
|
4 + //! from the `EventProcessor` and related components.
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/event_repository.rs:17:5
|
|
|
|
|
17 | /// EventRepositoryError
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
17 - /// EventRepositoryError
|
|
17 + /// `EventRepositoryError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/event_repository.rs:41:5
|
|
|
|
|
41 | /// EventRepositoryResult
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
41 - /// EventRepositoryResult
|
|
41 + /// `EventRepositoryResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/event_repository.rs:46:5
|
|
|
|
|
46 | /// EventRepositoryConfig
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
46 - /// EventRepositoryConfig
|
|
46 + /// `EventRepositoryConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/event_repository.rs:76:5
|
|
|
|
|
76 | /// EventBatch
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
76 - /// EventBatch
|
|
76 + /// `EventBatch`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/event_repository.rs:108:5
|
|
|
|
|
108 | /// EventQuery
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
108 - /// EventQuery
|
|
108 + /// `EventQuery`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/event_repository.rs:141:5
|
|
|
|
|
141 | /// EventRepository
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
141 - /// EventRepository
|
|
141 + /// `EventRepository`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/event_repository.rs:195:5
|
|
|
|
|
195 | /// EventStorageStats
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
195 - /// EventStorageStats
|
|
195 + /// `EventStorageStats`
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/event_repository.rs:248:57
|
|
|
|
|
248 | return Err(EventRepositoryError::SchemaInit("Mock failure".to_string()));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock failure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/event_repository.rs:256:17
|
|
|
|
|
256 | "Mock failure".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock failure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/event_repository.rs:266:17
|
|
|
|
|
266 | "Mock failure".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock failure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/event_repository.rs:276:17
|
|
|
|
|
276 | "Mock failure".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock failure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: derefed type is same as origin
|
|
--> trading_engine/src/repositories/event_repository.rs:285:24
|
|
|
|
|
285 | if event.symbol().as_deref() != Some(symbol) {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `event.symbol()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_option_as_deref
|
|
= note: `-W clippy::needless-option-as-deref` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::needless_option_as_deref)]`
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/repositories/event_repository.rs:308:12
|
|
|
|
|
308 | Ok(self.events.read().await.len() as u64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/repositories/event_repository.rs:329:30
|
|
|
|
|
329 | events_captured: self.events.read().await.len() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/repositories/event_repository.rs:331:29
|
|
|
|
|
331 | events_written: self.events.read().await.len() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/event_repository.rs:351:57
|
|
|
|
|
351 | return Err(EventRepositoryError::Connection("Mock failure".to_string()));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock failure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/repositories/event_repository.rs:357:21
|
|
|
|
|
357 | let count = self.events.read().await.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/repositories/event_repository.rs:369:37
|
|
|
|
|
369 | compression_ratio: Some(0.7),
|
|
| ^^^ help: consider adding suffix: `0.7_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/repositories/event_repository.rs:364:27
|
|
|
|
|
364 | let event_count = self.events.read().await.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/repositories/event_repository.rs:367:33
|
|
|
|
|
367 | storage_size_bytes: event_count * 1024, // Mock size
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/repositories/event_repository.rs:370:32
|
|
|
|
|
370 | oldest_event: Some(Utc::now() - Duration::hours(1)),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/migration_repository.rs:14:5
|
|
|
|
|
14 | /// MigrationRepositoryError
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
14 - /// MigrationRepositoryError
|
|
14 + /// `MigrationRepositoryError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/migration_repository.rs:41:5
|
|
|
|
|
41 | /// MigrationRepositoryResult
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
41 - /// MigrationRepositoryResult
|
|
41 + /// `MigrationRepositoryResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/migration_repository.rs:123:5
|
|
|
|
|
123 | /// MigrationResult
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
123 - /// MigrationResult
|
|
123 + /// `MigrationResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/migration_repository.rs:143:5
|
|
|
|
|
143 | /// MigrationStatus
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
143 - /// MigrationStatus
|
|
143 + /// `MigrationStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/migration_repository.rs:159:5
|
|
|
|
|
159 | /// AppliedMigration
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
159 - /// AppliedMigration
|
|
159 + /// `AppliedMigration`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/migration_repository.rs:181:5
|
|
|
|
|
181 | /// MigrationPlan
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
181 - /// MigrationPlan
|
|
181 + /// `MigrationPlan`
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/repositories/migration_repository.rs:198:37
|
|
|
|
|
198 | let estimated_duration_ms = migrations.len() as u64 * 1000; // Rough estimate
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/repositories/migration_repository.rs:198:37
|
|
|
|
|
198 | let estimated_duration_ms = migrations.len() as u64 * 1000; // Rough estimate
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/migration_repository.rs:219:5
|
|
|
|
|
219 | /// ValidationResult
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
219 - /// ValidationResult
|
|
219 + /// `ValidationResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/migration_repository.rs:235:5
|
|
|
|
|
235 | /// MigrationRepository
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
235 - /// MigrationRepository
|
|
235 + /// `MigrationRepository`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/migration_repository.rs:312:5
|
|
|
|
|
312 | /// MigrationStats
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
312 - /// MigrationStats
|
|
312 + /// `MigrationStats`
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/migration_repository.rs:374:57
|
|
|
|
|
374 | return Err(MigrationRepositoryError::Schema("Mock failure".to_string()));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock failure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/migration_repository.rs:387:17
|
|
|
|
|
387 | "Mock failure".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock failure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/repositories/migration_repository.rs:396:33
|
|
|
|
|
396 | let execution_time_ms = start_time.elapsed().as_millis() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/migration_repository.rs:426:17
|
|
|
|
|
426 | "Mock failure".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock failure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/migration_repository.rs:445:17
|
|
|
|
|
445 | "Mock failure".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock failure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/migration_repository.rs:491:30
|
|
|
|
|
491 | errors: vec!["Mock validation error".to_string()],
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock validation error".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `limit` is shadowed
|
|
--> trading_engine/src/repositories/migration_repository.rs:552:21
|
|
|
|
|
552 | if let Some(limit) = limit {
|
|
| ^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/repositories/migration_repository.rs:546:9
|
|
|
|
|
546 | limit: Option<u32>,
|
|
| ^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_reuse
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/repositories/migration_repository.rs:553:30
|
|
|
|
|
553 | history.truncate(limit as usize);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/migration_repository.rs:562:28
|
|
|
|
|
562 | return Ok(vec!["Mock integrity violation".to_string()]);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock integrity violation".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/repositories/migration_repository.rs:578:13
|
|
|
|
|
578 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/repositories/migration_repository.rs:569:21
|
|
|
|
|
569 | let total = applied.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/repositories/migration_repository.rs:576:13
|
|
|
|
|
576 | total_execution_time as f64 / total as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/repositories/migration_repository.rs:576:13
|
|
|
|
|
576 | total_execution_time as f64 / total as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/repositories/migration_repository.rs:576:43
|
|
|
|
|
576 | total_execution_time as f64 / total as f64
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/repositories/migration_repository.rs:595:17
|
|
|
|
|
595 | "Mock failure".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Mock failure".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/repositories/mod.rs:48:5
|
|
|
|
|
48 | /// HealthCheck
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
48 - /// HealthCheck
|
|
48 + /// `HealthCheck`
|
|
|
|
|
|
|
error: `panic` should not be present in production code
|
|
--> trading_engine/src/trading_operations.rs:42:41
|
|
|
|
|
42 | .unwrap_or_else(|_| panic!("FATAL: Prometheus core counter creation failed - this should be impossible"))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/lib.rs:48:5
|
|
|
|
|
48 | clippy::panic,
|
|
| ^^^^^^^^^^^^^
|
|
|
|
error: `e` shadows a previous, unrelated binding
|
|
--> trading_engine/src/trading_operations.rs:53:26
|
|
|
|
|
53 | .unwrap_or_else(|e| {
|
|
| ^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/trading_operations.rs:50:19
|
|
|
|
|
50 | ).unwrap_or_else(|e| {
|
|
| ^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
|
|
|
|
error: `panic` should not be present in production code
|
|
--> trading_engine/src/trading_operations.rs:61:17
|
|
|
|
|
61 | panic!("Critical error: Cannot initialize Prometheus metrics system")
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
|
|
|
|
error: `e` shadows a previous, unrelated binding
|
|
--> trading_engine/src/trading_operations.rs:71:26
|
|
|
|
|
71 | .unwrap_or_else(|e| {
|
|
| ^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/trading_operations.rs:68:19
|
|
|
|
|
68 | ).unwrap_or_else(|e| {
|
|
| ^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
|
|
|
|
error: `panic` should not be present in production code
|
|
--> trading_engine/src/trading_operations.rs:79:17
|
|
|
|
|
79 | panic!("Critical error: Cannot initialize Prometheus metrics system")
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
|
|
|
|
error: `e` shadows a previous, unrelated binding
|
|
--> trading_engine/src/trading_operations.rs:92:26
|
|
|
|
|
92 | .unwrap_or_else(|e| {
|
|
| ^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/trading_operations.rs:89:19
|
|
|
|
|
89 | ).unwrap_or_else(|e| {
|
|
| ^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
|
|
|
|
error: `panic` should not be present in production code
|
|
--> trading_engine/src/trading_operations.rs:99:21
|
|
|
|
|
99 | panic!("Critical error: Cannot initialize Prometheus metrics system")
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
|
|
|
|
error: `e` shadows a previous, unrelated binding
|
|
--> trading_engine/src/trading_operations.rs:112:26
|
|
|
|
|
112 | .unwrap_or_else(|e| {
|
|
| ^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/trading_operations.rs:109:19
|
|
|
|
|
109 | ).unwrap_or_else(|e| {
|
|
| ^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
|
|
|
|
error: `panic` should not be present in production code
|
|
--> trading_engine/src/trading_operations.rs:119:21
|
|
|
|
|
119 | panic!("Critical error: Cannot initialize Prometheus metrics system")
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
|
|
|
|
error: `e` shadows a previous, unrelated binding
|
|
--> trading_engine/src/trading_operations.rs:130:26
|
|
|
|
|
130 | .unwrap_or_else(|e| {
|
|
| ^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/trading_operations.rs:127:19
|
|
|
|
|
127 | ).unwrap_or_else(|e| {
|
|
| ^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
|
|
|
|
error: `panic` should not be present in production code
|
|
--> trading_engine/src/trading_operations.rs:137:21
|
|
|
|
|
137 | panic!("Critical error: Cannot initialize Prometheus metrics system")
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
|
|
|
|
error: `e` shadows a previous, unrelated binding
|
|
--> trading_engine/src/trading_operations.rs:148:26
|
|
|
|
|
148 | .unwrap_or_else(|e| {
|
|
| ^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/trading_operations.rs:145:19
|
|
|
|
|
145 | ).unwrap_or_else(|e| {
|
|
| ^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
|
|
|
|
error: `panic` should not be present in production code
|
|
--> trading_engine/src/trading_operations.rs:155:21
|
|
|
|
|
155 | panic!("Critical error: Cannot initialize Prometheus metrics system")
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
|
|
|
|
error: `e` shadows a previous, unrelated binding
|
|
--> trading_engine/src/trading_operations.rs:166:26
|
|
|
|
|
166 | .unwrap_or_else(|e| {
|
|
| ^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/trading_operations.rs:163:19
|
|
|
|
|
163 | ).unwrap_or_else(|e| {
|
|
| ^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
|
|
|
|
error: `panic` should not be present in production code
|
|
--> trading_engine/src/trading_operations.rs:173:21
|
|
|
|
|
173 | panic!("Critical error: Cannot initialize Prometheus metrics system")
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
|
|
|
|
error: `e` shadows a previous, unrelated binding
|
|
--> trading_engine/src/trading_operations.rs:184:26
|
|
|
|
|
184 | .unwrap_or_else(|e| {
|
|
| ^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/trading_operations.rs:181:19
|
|
|
|
|
181 | ).unwrap_or_else(|e| {
|
|
| ^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
|
|
|
|
error: `panic` should not be present in production code
|
|
--> trading_engine/src/trading_operations.rs:191:21
|
|
|
|
|
191 | panic!("Critical error: Cannot initialize Prometheus metrics system")
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
|
|
|
|
error: `e` shadows a previous, unrelated binding
|
|
--> trading_engine/src/trading_operations.rs:202:26
|
|
|
|
|
202 | .unwrap_or_else(|e| {
|
|
| ^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/trading_operations.rs:199:19
|
|
|
|
|
199 | ).unwrap_or_else(|e| {
|
|
| ^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
|
|
|
|
error: `panic` should not be present in production code
|
|
--> trading_engine/src/trading_operations.rs:209:21
|
|
|
|
|
209 | panic!("Critical error: Cannot initialize Prometheus metrics system")
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
|
|
|
|
error: `e` shadows a previous, unrelated binding
|
|
--> trading_engine/src/trading_operations.rs:220:26
|
|
|
|
|
220 | .unwrap_or_else(|e| {
|
|
| ^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/trading_operations.rs:217:19
|
|
|
|
|
217 | ).unwrap_or_else(|e| {
|
|
| ^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
|
|
|
|
error: `panic` should not be present in production code
|
|
--> trading_engine/src/trading_operations.rs:227:21
|
|
|
|
|
227 | panic!("Critical error: Cannot initialize Prometheus metrics system")
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
|
|
|
|
error: `e` shadows a previous, unrelated binding
|
|
--> trading_engine/src/trading_operations.rs:238:30
|
|
|
|
|
238 | .unwrap_or_else(|e| {
|
|
| ^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/trading_operations.rs:235:23
|
|
|
|
|
235 | ).unwrap_or_else(|e| {
|
|
| ^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
|
|
|
|
error: `panic` should not be present in production code
|
|
--> trading_engine/src/trading_operations.rs:245:25
|
|
|
|
|
245 | panic!("Critical error: Cannot initialize Prometheus metrics system")
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading_operations.rs:253:5
|
|
|
|
|
253 | /// TradingOrder
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
253 - /// TradingOrder
|
|
253 + /// `TradingOrder`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading_operations.rs:298:5
|
|
|
|
|
298 | /// ExecutionResult
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
298 - /// ExecutionResult
|
|
298 + /// `ExecutionResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading_operations.rs:319:5
|
|
|
|
|
319 | /// LiquidityFlag
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
319 - /// LiquidityFlag
|
|
319 + /// `LiquidityFlag`
|
|
|
|
|
|
|
warning: this `impl` can be derived
|
|
--> trading_engine/src/trading_operations.rs:341:1
|
|
|
|
|
341 | / impl Default for LiquidityFlag {
|
|
342 | | fn default() -> Self {
|
|
343 | | LiquidityFlag::Unknown
|
|
344 | | }
|
|
345 | | }
|
|
| |_^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
|
|
= note: `-W clippy::derivable-impls` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::derivable_impls)]`
|
|
help: replace the manual implementation with a derive attribute and mark the default variant
|
|
|
|
|
322 + #[derive(Default)]
|
|
323 ~ pub enum LiquidityFlag {
|
|
324 | // Maker variant
|
|
...
|
|
328 | // Unknown variant
|
|
329 ~ #[default]
|
|
330 ~ Unknown,
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading_operations.rs:349:5
|
|
|
|
|
349 | /// TradingOperations
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
349 - /// TradingOperations
|
|
349 + /// `TradingOperations`
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/trading_operations.rs:397:34
|
|
|
|
|
397 | let submission_latency = submission_start.elapsed().as_micros() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/trading_operations.rs:416:35
|
|
|
|
|
416 | OPEN_ORDERS_GAUGE.set(open_count as i64);
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading_operations.rs:424:32
|
|
|
|
|
424 | .unwrap_or_else(|| "MISSING_PRICE".to_string());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"MISSING_PRICE".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading_operations.rs:451:17
|
|
|
|
|
451 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading_operations.rs:496:74
|
|
|
|
|
496 | TRADING_VOLUME_GAUGE.set(total_volume.to_f64().unwrap_or(0.0));
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading_operations.rs:504:60
|
|
|
|
|
504 | PNL_GAUGE.set(total_pnl.to_f64().unwrap_or(0.0));
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/trading_operations.rs:445:17
|
|
|
|
|
445 | / execution
|
|
446 | | .execution_time
|
|
447 | | .signed_duration_since(submitted_at)
|
|
448 | | .num_microseconds()
|
|
449 | | .unwrap_or(0) as f64
|
|
| |________________________________________^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading_operations.rs:456:13
|
|
|
|
|
456 | order.fill_quantity += execution.executed_quantity;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading_operations.rs:461:45
|
|
|
|
|
461 | let quantity_diff_decimal = order.fill_quantity - execution.executed_quantity;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading_operations.rs:466:38
|
|
|
|
|
466 | let previous_value = avg_price_decimal * quantity_diff_decimal;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading_operations.rs:467:33
|
|
|
|
|
467 | let new_value = execution_price_decimal * executed_quantity_decimal;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading_operations.rs:468:50
|
|
|
|
|
468 | let total_filled_value_decimal = previous_value + new_value;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading_operations.rs:469:45
|
|
|
|
|
469 | let new_avg_price_decimal = total_filled_value_decimal / total_fill_decimal;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading_operations.rs:492:35
|
|
|
|
|
492 | let execution_value = quantity_decimal * price_decimal;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading_operations.rs:495:17
|
|
|
|
|
495 | *total_volume += execution_value;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading_operations.rs:503:17
|
|
|
|
|
503 | *total_pnl += pnl_impact;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/trading_operations.rs:517:35
|
|
|
|
|
517 | OPEN_ORDERS_GAUGE.set(open_count as i64);
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/trading_operations.rs:526:34
|
|
|
|
|
526 | let processing_latency = execution_start.elapsed().as_micros() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading_operations.rs:533:32
|
|
|
|
|
533 | .unwrap_or_else(|| "MISSING_EXEC_PRICE".to_string());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"MISSING_EXEC_PRICE".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading_operations.rs:556:65
|
|
|
|
|
556 | let mid_price = (bid_price + ask_price) / Decimal::from(2);
|
|
| ^ help: consider adding suffix: `2_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading_operations.rs:558:49
|
|
|
|
|
558 | (spread / mid_price * Decimal::from(10000))
|
|
| ^^^^^ help: consider adding suffix: `10_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading_operations.rs:560:28
|
|
|
|
|
560 | .unwrap_or(0.0)
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading_operations.rs:562:13
|
|
|
|
|
562 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading_operations.rs:555:22
|
|
|
|
|
555 | let spread = ask_price - bid_price;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading_operations.rs:556:25
|
|
|
|
|
556 | let mid_price = (bid_price + ask_price) / Decimal::from(2);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading_operations.rs:558:13
|
|
|
|
|
558 | (spread / mid_price * Decimal::from(10000))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/trading_operations.rs:571:30
|
|
|
|
|
571 | let update_latency = update_start.elapsed().as_micros() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading_operations.rs:577:32
|
|
|
|
|
577 | .unwrap_or_else(|| "MISSING_BID".to_string());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"MISSING_BID".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading_operations.rs:581:32
|
|
|
|
|
581 | .unwrap_or_else(|| "MISSING_ASK".to_string());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"MISSING_ASK".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading_operations.rs:605:77
|
|
|
|
|
605 | let avg_price = (exchange1_price + exchange2_price) / Decimal::from(2);
|
|
| ^ help: consider adding suffix: `2_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading_operations.rs:608:70
|
|
|
|
|
608 | let profit_bps = (price_diff / avg_price * Decimal::from(10000))
|
|
| ^^^^^ help: consider adding suffix: `10_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading_operations.rs:610:28
|
|
|
|
|
610 | .unwrap_or(0.0);
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading_operations.rs:604:26
|
|
|
|
|
604 | let price_diff = (exchange2_price - exchange1_price).abs();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading_operations.rs:605:25
|
|
|
|
|
605 | let avg_price = (exchange1_price + exchange2_price) / Decimal::from(2);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading_operations.rs:608:30
|
|
|
|
|
608 | let profit_bps = (price_diff / avg_price * Decimal::from(10000))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading_operations.rs:656:64
|
|
|
|
|
656 | (slippage / expected_price * Decimal::from(10000))
|
|
| ^^^^^ help: consider adding suffix: `10_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading_operations.rs:658:36
|
|
|
|
|
658 | .unwrap_or(0.0)
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading_operations.rs:660:21
|
|
|
|
|
660 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading_operations.rs:654:32
|
|
|
|
|
654 | let slippage = (avg_fill_price - expected_price).abs();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading_operations.rs:656:21
|
|
|
|
|
656 | (slippage / expected_price * Decimal::from(10000))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading_operations.rs:698:65
|
|
|
|
|
698 | execution.executed_quantity * Decimal::try_from(0.01).unwrap_or(Decimal::ZERO)
|
|
| ^^^^ help: consider adding suffix: `0.01_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading_operations.rs:701:66
|
|
|
|
|
701 | execution.executed_quantity * Decimal::try_from(-0.02).unwrap_or(Decimal::ZERO)
|
|
| ^^^^ help: consider adding suffix: `0.02_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading_operations.rs:698:17
|
|
|
|
|
698 | execution.executed_quantity * Decimal::try_from(0.01).unwrap_or(Decimal::ZERO)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading_operations.rs:701:17
|
|
|
|
|
701 | execution.executed_quantity * Decimal::try_from(-0.02).unwrap_or(Decimal::ZERO)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/trading_operations.rs:714:28
|
|
|
|
|
714 | let total_orders = orders.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/trading_operations.rs:715:29
|
|
|
|
|
715 | let filled_orders = orders
|
|
| _____________________________^
|
|
716 | | .iter()
|
|
717 | | .filter(|o| matches!(o.status, OrderStatus::Filled))
|
|
718 | | .count() as u64;
|
|
| |___________________________^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/trading_operations.rs:719:31
|
|
|
|
|
719 | let rejected_orders = orders
|
|
| _______________________________^
|
|
720 | | .iter()
|
|
721 | | .filter(|o| matches!(o.status, OrderStatus::Rejected))
|
|
722 | | .count() as u64;
|
|
| |___________________________^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/trading_operations.rs:728:31
|
|
|
|
|
728 | total_executions: executions.len() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/trading_operations.rs:732:17
|
|
|
|
|
732 | filled_orders as f64 / total_orders as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/trading_operations.rs:732:17
|
|
|
|
|
732 | filled_orders as f64 / total_orders as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/trading_operations.rs:732:40
|
|
|
|
|
732 | filled_orders as f64 / total_orders as f64
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading_operations.rs:742:5
|
|
|
|
|
742 | /// ArbitrageOpportunity
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
742 - /// ArbitrageOpportunity
|
|
742 + /// `ArbitrageOpportunity`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading_operations.rs:764:5
|
|
|
|
|
764 | /// TradingStats
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
764 - /// TradingStats
|
|
764 + /// `TradingStats`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading_operations.rs:789:5
|
|
|
|
|
789 | /// record_order_execution
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
789 - /// record_order_execution
|
|
789 + /// `record_order_execution`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading_operations.rs:796:5
|
|
|
|
|
796 | /// record_order_rejection
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
796 - /// record_order_rejection
|
|
796 + /// `record_order_rejection`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading_operations.rs:803:5
|
|
|
|
|
803 | /// record_order_latency
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
803 - /// record_order_latency
|
|
803 + /// `record_order_latency`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading_operations.rs:810:5
|
|
|
|
|
810 | /// record_execution_latency
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
810 - /// record_execution_latency
|
|
810 + /// `record_execution_latency`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading_operations.rs:817:5
|
|
|
|
|
817 | /// update_pnl
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
817 - /// update_pnl
|
|
817 + /// `update_pnl`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading_operations.rs:824:5
|
|
|
|
|
824 | /// update_open_orders_count
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
824 - /// update_open_orders_count
|
|
824 + /// `update_open_orders_count`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/account_manager.rs:18:5
|
|
|
|
|
18 | /// AccountManager
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
18 - /// AccountManager
|
|
18 + /// `AccountManager`
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading/account_manager.rs:34:40
|
|
|
|
|
34 | total_value: Decimal::from(100000), // $100k total
|
|
| ^^^^^^ help: consider adding suffix: `100_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading/account_manager.rs:35:41
|
|
|
|
|
35 | cash_balance: Decimal::from(50000), // $50k cash
|
|
| ^^^^^ help: consider adding suffix: `50_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading/account_manager.rs:36:41
|
|
|
|
|
36 | buying_power: Decimal::from(100000), // $100k buying power
|
|
| ^^^^^^ help: consider adding suffix: `100_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading/account_manager.rs:38:53
|
|
|
|
|
38 | day_trading_buying_power: Decimal::from(200000), // $200k day trading power
|
|
| ^^^^^^ help: consider adding suffix: `200_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/account_manager.rs:80:17
|
|
|
|
|
80 | order.quantity * order.price
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/account_manager.rs:116:32
|
|
|
|
|
116 | let _execution_value = quantity_decimal * price_decimal;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/account_manager.rs:124:9
|
|
|
|
|
124 | account.cash_balance -= commission; // Always subtract commission
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/account_manager.rs:128:9
|
|
|
|
|
128 | account.total_value -= commission;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading/account_manager.rs:158:54
|
|
|
|
|
158 | total_position_value * Decimal::try_from(0.05).unwrap_or(Decimal::ZERO); // 5% margin
|
|
| ^^^^ help: consider adding suffix: `0.05_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading/account_manager.rs:162:51
|
|
|
|
|
162 | let margin_multiplier = Decimal::try_from(2.0).unwrap_or(Decimal::from(1)); // 2:1 leverage
|
|
| ^^^ help: consider adding suffix: `2.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading/account_manager.rs:162:80
|
|
|
|
|
162 | let margin_multiplier = Decimal::try_from(2.0).unwrap_or(Decimal::from(1)); // 2:1 leverage
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/account_manager.rs:158:13
|
|
|
|
|
158 | total_position_value * Decimal::try_from(0.05).unwrap_or(Decimal::ZERO); // 5% margin
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/account_manager.rs:164:13
|
|
|
|
|
164 | total_position_value - maintenance_margin
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/account_manager.rs:169:32
|
|
|
|
|
169 | let new_buying_power = account.cash_balance + (excess_liquidity * margin_multiplier);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/account_manager.rs:174:31
|
|
|
|
|
174 | account.total_value = account.cash_balance + total_position_value;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading/account_manager.rs:217:28
|
|
|
|
|
217 | .unwrap_or(0.0)
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading/account_manager.rs:219:13
|
|
|
|
|
219 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading/account_manager.rs:225:28
|
|
|
|
|
225 | .unwrap_or(0.0)
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading/account_manager.rs:226:19
|
|
|
|
|
226 | * 100.0
|
|
| ^^^^^ help: consider adding suffix: `100.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading/account_manager.rs:228:13
|
|
|
|
|
228 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading/account_manager.rs:234:28
|
|
|
|
|
234 | .unwrap_or(0.0)
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading/account_manager.rs:235:19
|
|
|
|
|
235 | * 100.0
|
|
| ^^^^^ help: consider adding suffix: `100.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading/account_manager.rs:237:13
|
|
|
|
|
237 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/account_manager.rs:215:13
|
|
|
|
|
215 | (account.total_value / account.cash_balance)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/trading/account_manager.rs:223:13
|
|
|
|
|
223 | / ((account.buying_power - account.cash_balance) / account.buying_power)
|
|
224 | | .to_f64()
|
|
225 | | .unwrap_or(0.0)
|
|
226 | | * 100.0
|
|
| |_______________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/account_manager.rs:223:13
|
|
|
|
|
223 | ((account.buying_power - account.cash_balance) / account.buying_power)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/trading/account_manager.rs:232:13
|
|
|
|
|
232 | / (account.cash_balance / account.total_value)
|
|
233 | | .to_f64()
|
|
234 | | .unwrap_or(0.0)
|
|
235 | | * 100.0
|
|
| |_______________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/account_manager.rs:232:13
|
|
|
|
|
232 | (account.cash_balance / account.total_value)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/account_manager.rs:300:5
|
|
|
|
|
300 | /// AccountRiskMetrics
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
300 - /// AccountRiskMetrics
|
|
300 + /// `AccountRiskMetrics`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/broker_client.rs:4:42
|
|
|
|
|
4 | //! Supports Interactive Brokers TWS and ICMarkets FIX 4.4 protocols
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
4 - //! Supports Interactive Brokers TWS and ICMarkets FIX 4.4 protocols
|
|
4 + //! Supports Interactive Brokers TWS and `ICMarkets` FIX 4.4 protocols
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/broker_client.rs:33:5
|
|
|
|
|
33 | /// IBConfig
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
33 - /// IBConfig
|
|
33 + /// `IBConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/broker_client.rs:56:16
|
|
|
|
|
56 | /// Create IBConfig from environment variables with proper error handling
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
56 - /// Create IBConfig from environment variables with proper error handling
|
|
56 + /// Create `IBConfig` from environment variables with proper error handling
|
|
|
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/trading/broker_client.rs:60:22
|
|
|
|
|
60 | .map_err(|_| "CRITICAL: IB_TWS_HOST environment variable must be set - no default host allowed".to_string())?;
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:60:26
|
|
|
|
|
60 | .map_err(|_| "CRITICAL: IB_TWS_HOST environment variable must be set - no default host allowed".to_string())?;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"CRITICAL: IB_TWS_HOST environment variable must be set - no default host allowed".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/trading/broker_client.rs:63:22
|
|
|
|
|
63 | .map_err(|_| "CRITICAL: IB_TWS_PORT environment variable must be set".to_string())?
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:63:26
|
|
|
|
|
63 | .map_err(|_| "CRITICAL: IB_TWS_PORT environment variable must be set".to_string())?
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"CRITICAL: IB_TWS_PORT environment variable must be set".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/trading/broker_client.rs:68:22
|
|
|
|
|
68 | .map_err(|_| "CRITICAL: IB_CLIENT_ID environment variable must be set".to_string())?
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:68:26
|
|
|
|
|
68 | .map_err(|_| "CRITICAL: IB_CLIENT_ID environment variable must be set".to_string())?
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"CRITICAL: IB_CLIENT_ID environment variable must be set".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/trading/broker_client.rs:73:22
|
|
|
|
|
73 | .map_err(|_| "CRITICAL: IB_ACCOUNT_ID environment variable must be set - no default account allowed for safety".to_string())?;
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:73:26
|
|
|
|
|
73 | .map_err(|_| "CRITICAL: IB_ACCOUNT_ID environment variable must be set - no default account allowed for safety".to_string())?;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"CRITICAL: IB_ACCOUNT_ID environment variable must be set - no default account allowed for safety".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/broker_client.rs:94:5
|
|
|
|
|
94 | /// TwsMessageType
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
94 - /// TwsMessageType
|
|
94 + /// `TwsMessageType`
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/broker_client.rs:132:13
|
|
|
|
|
132 | total_len += field.len() + 1; // +1 for null terminator
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/trading/broker_client.rs:136:35
|
|
|
|
|
136 | buffer.extend_from_slice(&(total_len as u32).to_be_bytes());
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:150:24
|
|
|
|
|
150 | return Err("Message too short".to_string());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Message too short".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/trading/broker_client.rs:153:23
|
|
|
|
|
153 | let msg_len = u32::from_be_bytes([data[0], data[1], data[2], data[3]]) as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/trading/broker_client.rs:153:43
|
|
|
|
|
153 | let msg_len = u32::from_be_bytes([data[0], data[1], data[2], data[3]]) as usize;
|
|
| ^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/trading/broker_client.rs:153:52
|
|
|
|
|
153 | let msg_len = u32::from_be_bytes([data[0], data[1], data[2], data[3]]) as usize;
|
|
| ^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/trading/broker_client.rs:153:61
|
|
|
|
|
153 | let msg_len = u32::from_be_bytes([data[0], data[1], data[2], data[3]]) as usize;
|
|
| ^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/trading/broker_client.rs:153:70
|
|
|
|
|
153 | let msg_len = u32::from_be_bytes([data[0], data[1], data[2], data[3]]) as usize;
|
|
| ^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/broker_client.rs:155:25
|
|
|
|
|
155 | if data.len() < 4 + msg_len {
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:156:24
|
|
|
|
|
156 | return Err("Incomplete message".to_string());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Incomplete message".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: slicing may panic
|
|
--> trading_engine/src/trading/broker_client.rs:159:24
|
|
|
|
|
159 | let payload = &data[4..4 + msg_len];
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/broker_client.rs:159:32
|
|
|
|
|
159 | let payload = &data[4..4 + msg_len];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/broker_client.rs:187:5
|
|
|
|
|
187 | /// ConnectionState
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
187 - /// ConnectionState
|
|
187 + /// `ConnectionState`
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:241:27
|
|
|
|
|
241 | request_type: request_type.to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `request_type.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/broker_client.rs:261:5
|
|
|
|
|
261 | /// InteractiveBrokersAdapter
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
261 - /// InteractiveBrokersAdapter
|
|
261 + /// `InteractiveBrokersAdapter`
|
|
|
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/trading/broker_client.rs:299:18
|
|
|
|
|
299 | .map_err(|_| BrokerError::ConnectionFailed("Connection timeout".to_string()))?
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:299:52
|
|
|
|
|
299 | .map_err(|_| BrokerError::ConnectionFailed("Connection timeout".to_string()))?
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Connection timeout".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:323:13
|
|
|
|
|
323 | "71".to_string(), // Message type: START_API
|
|
| ^^^^^^^^^^^^^^^^ help: try: `"71".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:324:13
|
|
|
|
|
324 | "2".to_string(), // Version
|
|
| ^^^^^^^^^^^^^^^ help: try: `"2".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:326:13
|
|
|
|
|
326 | "".to_string(), // Optional capabilities
|
|
| ^^^^^^^^^^^^^^ help: try: `"".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:347:56
|
|
|
|
|
347 | return Err(BrokerError::BrokerNotAvailable("Not connected".to_string()));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Not connected".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using `clone` on type `OrderId` which implements the `Copy` trait
|
|
--> trading_engine/src/trading/broker_client.rs:361:21
|
|
|
|
|
361 | .insert(order.id.clone(), tws_order_id);
|
|
| ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `order.id`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
= note: `-W clippy::clone-on-copy` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::clone_on_copy)]`
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:364:13
|
|
|
|
|
364 | "3".to_string(), // PLACE_ORDER
|
|
| ^^^^^^^^^^^^^^^ help: try: `"3".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:366:13
|
|
|
|
|
366 | "0".to_string(), // contract id
|
|
| ^^^^^^^^^^^^^^^ help: try: `"0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:368:13
|
|
|
|
|
368 | "STK".to_string(), // security type
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"STK".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:369:13
|
|
|
|
|
369 | "".to_string(), // expiry
|
|
| ^^^^^^^^^^^^^^ help: try: `"".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:370:13
|
|
|
|
|
370 | "0".to_string(), // strike
|
|
| ^^^^^^^^^^^^^^^ help: try: `"0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:371:13
|
|
|
|
|
371 | "".to_string(), // right
|
|
| ^^^^^^^^^^^^^^ help: try: `"".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:372:13
|
|
|
|
|
372 | "".to_string(), // multiplier
|
|
| ^^^^^^^^^^^^^^ help: try: `"".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:373:13
|
|
|
|
|
373 | "SMART".to_string(), // exchange
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"SMART".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:374:13
|
|
|
|
|
374 | "USD".to_string(), // currency
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"USD".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:375:13
|
|
|
|
|
375 | "".to_string(), // local symbol
|
|
| ^^^^^^^^^^^^^^ help: try: `"".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:376:13
|
|
|
|
|
376 | "".to_string(), // trading class
|
|
| ^^^^^^^^^^^^^^ help: try: `"".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:378:35
|
|
|
|
|
378 | OrderSide::Buy => "BUY".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"BUY".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:379:36
|
|
|
|
|
379 | OrderSide::Sell => "SELL".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"SELL".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: wildcard matches known variants and will also match future added variants
|
|
--> trading_engine/src/trading/broker_client.rs:387:17
|
|
|
|
|
387 | _ => "MKT".to_string(),
|
|
| ^ help: try: `OrderType::Iceberg | OrderType::TrailingStop | OrderType::Hidden | _`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_enum_match_arm
|
|
= note: requested on the command line with `-D clippy::wildcard-enum-match-arm`
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:383:38
|
|
|
|
|
383 | OrderType::Market => "MKT".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"MKT".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:384:37
|
|
|
|
|
384 | OrderType::Limit => "LMT".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"LMT".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:385:36
|
|
|
|
|
385 | OrderType::Stop => "STP".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"STP".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:386:41
|
|
|
|
|
386 | OrderType::StopLimit => "STP LMT".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"STP LMT".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:387:22
|
|
|
|
|
387 | _ => "MKT".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"MKT".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:390:13
|
|
|
|
|
390 | "0".to_string(), // aux price
|
|
| ^^^^^^^^^^^^^^^ help: try: `"0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:391:13
|
|
|
|
|
391 | "DAY".to_string(), // time in force
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"DAY".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using `clone` on type `u32` which implements the `Copy` trait
|
|
--> trading_engine/src/trading/broker_client.rs:409:13
|
|
|
|
|
409 | / order_mapping
|
|
410 | | .get(order_id)
|
|
411 | | .ok_or_else(|| {
|
|
412 | | BrokerError::OrderNotFound(format!(
|
|
... |
|
|
416 | | })?
|
|
417 | | .clone()
|
|
| |________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
help: try dereferencing it
|
|
|
|
|
409 ~ *order_mapping
|
|
410 + .get(order_id)
|
|
411 + .ok_or_else(|| {
|
|
412 + BrokerError::OrderNotFound(format!(
|
|
413 + "Order {} not found in IB order mapping",
|
|
414 + order_id
|
|
415 + ))
|
|
416 + })?
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:421:13
|
|
|
|
|
421 | "4".to_string(), // CANCEL_ORDER
|
|
| ^^^^^^^^^^^^^^^ help: try: `"4".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:422:13
|
|
|
|
|
422 | "1".to_string(), // version
|
|
| ^^^^^^^^^^^^^^^ help: try: `"1".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:481:13
|
|
|
|
|
481 | "Order modification not yet implemented for TWS".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Order modification not yet implemented for TWS".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:487:13
|
|
|
|
|
487 | "Order status lookup not yet implemented for TWS".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Order status lookup not yet implemented for TWS".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:493:29
|
|
|
|
|
493 | account_info.insert("account_id".to_string(), self.config.account_id.clone());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"account_id".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:495:13
|
|
|
|
|
495 | "name".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"name".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:498:29
|
|
|
|
|
498 | account_info.insert("currency".to_string(), "USD".to_string());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `"currency".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:498:53
|
|
|
|
|
498 | account_info.insert("currency".to_string(), "USD".to_string());
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"USD".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:499:29
|
|
|
|
|
499 | account_info.insert("balance".to_string(), "0.0".to_string());
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"balance".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:499:52
|
|
|
|
|
499 | account_info.insert("balance".to_string(), "0.0".to_string());
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"0.0".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:532:13
|
|
|
|
|
532 | "Reconnection not yet implemented for TWS".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Reconnection not yet implemented for TWS".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/broker_client.rs:539:5
|
|
|
|
|
539 | /// BrokerClient
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
539 - /// BrokerClient
|
|
539 + /// `BrokerClient`
|
|
|
|
|
|
|
warning: you should consider adding a `Default` implementation for `BrokerClient`
|
|
--> trading_engine/src/trading/broker_client.rs:557:5
|
|
|
|
|
557 | / pub fn new() -> Self {
|
|
558 | | Self {
|
|
559 | | brokers: Arc::new(RwLock::new(HashMap::new())),
|
|
560 | | primary_broker: Arc::new(RwLock::new(None)),
|
|
... |
|
|
565 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
555 + impl Default for BrokerClient {
|
|
556 + fn default() -> Self {
|
|
557 + Self::new()
|
|
558 + }
|
|
559 + }
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/broker_client.rs:575:25
|
|
|
|
|
575 | self.add_broker("interactive_brokers".to_string(), Box::new(adapter))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"interactive_brokers".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: the function has a cognitive complexity of (51/30)
|
|
--> trading_engine/src/trading/broker_client.rs:610:18
|
|
|
|
|
610 | pub async fn connect_all_brokers(&self) -> Result<(), BrokerError> {
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cognitive_complexity
|
|
= note: requested on the command line with `-W clippy::cognitive-complexity`
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/trading/broker_client.rs:632:61
|
|
|
|
|
632 | ... let execution_subscribers = self.execution_subscribers.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Arc::<tokio::sync::RwLock<std::vec::Vec<tokio::sync::mpsc::Sender<common::Execution>>>>::clone(&self.execution_subscribers)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/trading/broker_client.rs:686:23
|
|
|
|
|
686 | let brokers = self.brokers.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `Arc::<tokio::sync::RwLock<std::collections::HashMap<std::string::String, std::boxed::Box<dyn trading::data_interface::BrokerInterface>>>>::clone(&self.brokers)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: using `.clone()` on a ref-counted pointer
|
|
--> trading_engine/src/trading/broker_client.rs:687:30
|
|
|
|
|
687 | let monitor_active = self.connection_monitor_active.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Arc::<tokio::sync::RwLock<bool>>::clone(&self.connection_monitor_active)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
|
|
|
|
warning: the function has a cognitive complexity of (36/30)
|
|
--> trading_engine/src/trading/broker_client.rs:875:18
|
|
|
|
|
875 | pub async fn disconnect_all_brokers(&self) -> Result<(), BrokerError> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cognitive_complexity
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/data_interface.rs:45:5
|
|
|
|
|
45 | /// DataType
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
45 - /// DataType
|
|
45 + /// `DataType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/data_interface.rs:61:5
|
|
|
|
|
61 | /// DataProvider
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
61 - /// DataProvider
|
|
61 + /// `DataProvider`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/data_interface.rs:77:5
|
|
|
|
|
77 | /// BrokerInterface
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
77 - /// BrokerInterface
|
|
77 + /// `BrokerInterface`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/data_interface.rs:136:5
|
|
|
|
|
136 | /// BrokerConnectionStatus
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
136 - /// BrokerConnectionStatus
|
|
136 + /// `BrokerConnectionStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/data_interface.rs:154:5
|
|
|
|
|
154 | /// BrokerError
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
154 - /// BrokerError
|
|
154 + /// `BrokerError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/engine.rs:29:5
|
|
|
|
|
29 | /// TradingEngine
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
29 - /// TradingEngine
|
|
29 + /// `TradingEngine`
|
|
|
|
|
|
|
warning: using `clone` on type `OrderSide` which implements the `Copy` trait
|
|
--> trading_engine/src/trading/engine.rs:88:19
|
|
|
|
|
88 | side: side.clone(),
|
|
| ^^^^^^^^^^^^ help: try removing the `clone` call: `side`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: using `clone` on type `OrderType` which implements the `Copy` trait
|
|
--> trading_engine/src/trading/engine.rs:89:25
|
|
|
|
|
89 | order_type: order_type.clone(),
|
|
| ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `order_type`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/engine.rs:285:5
|
|
|
|
|
285 | /// AccountInfo
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
285 - /// AccountInfo
|
|
285 + /// `AccountInfo`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/order_manager.rs:17:5
|
|
|
|
|
17 | /// OrderManager
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
17 - /// OrderManager
|
|
17 + /// `OrderManager`
|
|
|
|
|
|
|
warning: using `clone` on type `OrderStatus` which implements the `Copy` trait
|
|
--> trading_engine/src/trading/order_manager.rs:80:30
|
|
|
|
|
80 | let old_status = order.status.clone();
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `order.status`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/order_manager.rs:101:13
|
|
|
|
|
101 | order.fill_quantity += execution.executed_quantity;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/order_manager.rs:106:37
|
|
|
|
|
106 | let previous_fill = order.fill_quantity - execution.executed_quantity;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/order_manager.rs:107:35
|
|
|
|
|
107 | let total_value = avg_price * previous_fill
|
|
| ___________________________________^
|
|
108 | | + execution.execution_price * execution.executed_quantity;
|
|
| |_____________________________________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/order_manager.rs:109:49
|
|
|
|
|
109 | order.average_fill_price = Some(total_value / order.fill_quantity);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: `_status` shadows a previous, unrelated binding
|
|
--> trading_engine/src/trading/order_manager.rs:140:44
|
|
|
|
|
140 | matches!(order.status, _status)
|
|
| ^^^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/trading/order_manager.rs:139:29
|
|
|
|
|
139 | if let Some(ref _status) = status_filter {
|
|
| ^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/order_manager.rs:174:27
|
|
|
|
|
174 | let cutoff_time = Utc::now() - Duration::hours(max_age_hours);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: wildcard matches known variants and will also match future added variants
|
|
--> trading_engine/src/trading/order_manager.rs:181:17
|
|
|
|
|
181 | _ => true, // Keep active orders
|
|
| ^ help: try: `OrderStatus::Created | OrderStatus::Submitted | OrderStatus::PartiallyFilled | OrderStatus::New | OrderStatus::Expired | OrderStatus::Pending | OrderStatus::Working | OrderStatus::Unknown | OrderStatus::Suspended | OrderStatus::PendingCancel | OrderStatus::PendingReplace | _`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_enum_match_arm
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading/order_manager.rs:214:13
|
|
|
|
|
214 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/order_manager.rs:199:13
|
|
|
|
|
199 | stats.total_orders += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: wildcard matches known variants and will also match future added variants
|
|
--> trading_engine/src/trading/order_manager.rs:207:17
|
|
|
|
|
207 | _ => {},
|
|
| ^ help: try: `OrderStatus::Created | OrderStatus::New | OrderStatus::Expired | OrderStatus::Pending | OrderStatus::Working | OrderStatus::Unknown | OrderStatus::Suspended | OrderStatus::PendingCancel | OrderStatus::PendingReplace | _`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_enum_match_arm
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/order_manager.rs:202:43
|
|
|
|
|
202 | OrderStatus::Submitted => stats.submitted_orders += 1,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/order_manager.rs:203:49
|
|
|
|
|
203 | OrderStatus::PartiallyFilled => stats.partially_filled_orders += 1,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/order_manager.rs:204:40
|
|
|
|
|
204 | OrderStatus::Filled => stats.filled_orders += 1,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/order_manager.rs:205:43
|
|
|
|
|
205 | OrderStatus::Cancelled => stats.cancelled_orders += 1,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/order_manager.rs:206:42
|
|
|
|
|
206 | OrderStatus::Rejected => stats.rejected_orders += 1,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/trading/order_manager.rs:212:13
|
|
|
|
|
212 | (stats.filled_orders + stats.partially_filled_orders) as f64 / stats.total_orders as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/trading/order_manager.rs:212:13
|
|
|
|
|
212 | (stats.filled_orders + stats.partially_filled_orders) as f64 / stats.total_orders as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/order_manager.rs:212:13
|
|
|
|
|
212 | (stats.filled_orders + stats.partially_filled_orders) as f64 / stats.total_orders as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/trading/order_manager.rs:212:76
|
|
|
|
|
212 | (stats.filled_orders + stats.partially_filled_orders) as f64 / stats.total_orders as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/order_manager.rs:229:5
|
|
|
|
|
229 | /// OrderManagerStats
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
229 - /// OrderManagerStats
|
|
229 + /// `OrderManagerStats`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/position_manager.rs:17:5
|
|
|
|
|
17 | /// PositionManager
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
17 - /// PositionManager
|
|
17 + /// `PositionManager`
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/position_manager.rs:81:21
|
|
|
|
|
81 | old_qty_decimal * old_cost_decimal + exec_qty_decimal * exec_price_decimal;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/position_manager.rs:82:44
|
|
|
|
|
82 | let new_quantity_decimal = old_qty_decimal + exec_qty_decimal;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/position_manager.rs:86:21
|
|
|
|
|
86 | total_cost / new_quantity_decimal
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/position_manager.rs:98:36
|
|
|
|
|
98 | let realized_pnl = reduction * (old_cost_decimal - exec_price_decimal);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: manual implementation of an assign operation
|
|
--> trading_engine/src/trading/position_manager.rs:99:17
|
|
|
|
|
99 | position.realized_pnl = position.realized_pnl + realized_pnl;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `position.realized_pnl += realized_pnl`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern
|
|
= note: `-W clippy::assign-op-pattern` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::assign_op_pattern)]`
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/position_manager.rs:99:41
|
|
|
|
|
99 | position.realized_pnl = position.realized_pnl + realized_pnl;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/position_manager.rs:101:36
|
|
|
|
|
101 | let new_quantity = old_qty_decimal + exec_qty_decimal;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/position_manager.rs:119:36
|
|
|
|
|
119 | let realized_pnl = reduction * (exec_price_decimal - old_cost_decimal);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: manual implementation of an assign operation
|
|
--> trading_engine/src/trading/position_manager.rs:120:17
|
|
|
|
|
120 | position.realized_pnl = position.realized_pnl + realized_pnl;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `position.realized_pnl += realized_pnl`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/position_manager.rs:120:41
|
|
|
|
|
120 | position.realized_pnl = position.realized_pnl + realized_pnl;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/position_manager.rs:122:44
|
|
|
|
|
122 | let new_quantity_decimal = old_qty_decimal - exec_qty_decimal;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/position_manager.rs:131:34
|
|
|
|
|
131 | let total_cost = old_qty_decimal.abs() * old_cost_decimal
|
|
| __________________________________^
|
|
132 | | + exec_qty_decimal * exec_price_decimal;
|
|
| |___________________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/position_manager.rs:133:44
|
|
|
|
|
133 | let new_quantity_decimal = old_qty_decimal - exec_qty_decimal;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/position_manager.rs:137:21
|
|
|
|
|
137 | total_cost / new_quantity_decimal.abs()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/trading/position_manager.rs:185:23
|
|
|
|
|
185 | prices.insert(symbol.to_string(), market_price);
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `symbol.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/position_manager.rs:205:44
|
|
|
|
|
205 | let market_value_decimal = qty_decimal * market_price;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/position_manager.rs:211:25
|
|
|
|
|
211 | qty_decimal * (market_price - avg_cost_decimal)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/position_manager.rs:214:25
|
|
|
|
|
214 | qty_decimal.abs() * (avg_cost_decimal - market_price)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this could be rewritten as `let...else`
|
|
--> trading_engine/src/trading/position_manager.rs:235:9
|
|
|
|
|
235 | / let positions = match self.positions.read() {
|
|
236 | | Ok(pos) => pos,
|
|
237 | | Err(_) => return Decimal::ZERO,
|
|
238 | | };
|
|
| |__________^ help: consider writing: `let Ok(positions) = self.positions.read() else { return Decimal::ZERO };`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
|
|
|
|
warning: this could be rewritten as `let...else`
|
|
--> trading_engine/src/trading/position_manager.rs:248:9
|
|
|
|
|
248 | / let positions = match self.positions.read() {
|
|
249 | | Ok(pos) => pos,
|
|
250 | | Err(_) => return Decimal::ZERO,
|
|
251 | | };
|
|
| |__________^ help: consider writing: `let Ok(positions) = self.positions.read() else { return Decimal::ZERO };`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
|
|
|
|
warning: this could be rewritten as `let...else`
|
|
--> trading_engine/src/trading/position_manager.rs:258:9
|
|
|
|
|
258 | / let positions = match self.positions.read() {
|
|
259 | | Ok(pos) => pos,
|
|
260 | | Err(_) => return Decimal::ZERO,
|
|
261 | | };
|
|
| |__________^ help: consider writing: `let Ok(positions) = self.positions.read() else { return Decimal::ZERO };`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
|
|
|
|
warning: this could be rewritten as `let...else`
|
|
--> trading_engine/src/trading/position_manager.rs:288:9
|
|
|
|
|
288 | / let positions = match self.positions.read() {
|
|
289 | | Ok(pos) => pos,
|
|
290 | | Err(_) => return Vec::new(),
|
|
291 | | };
|
|
| |__________^ help: consider writing: `let Ok(positions) = self.positions.read() else { return Vec::new() };`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
|
|
|
|
warning: this could be rewritten as `let...else`
|
|
--> trading_engine/src/trading/position_manager.rs:302:9
|
|
|
|
|
302 | / let positions = match self.positions.read() {
|
|
303 | | Ok(pos) => pos,
|
|
304 | | Err(_) => return HashMap::new(),
|
|
305 | | };
|
|
| |__________^ help: consider writing: `let Ok(positions) = self.positions.read() else { return HashMap::new() };`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading/position_manager.rs:320:32
|
|
|
|
|
320 | .unwrap_or(0.0)
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/trading/position_manager.rs:321:23
|
|
|
|
|
321 | * 100.0;
|
|
| ^^^^^ help: consider adding suffix: `100.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/trading/position_manager.rs:318:37
|
|
|
|
|
318 | let concentration = (position.market_value.abs() / total_value)
|
|
| _____________________________________^
|
|
319 | | .to_f64()
|
|
320 | | .unwrap_or(0.0)
|
|
321 | | * 100.0;
|
|
| |___________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/trading/position_manager.rs:318:37
|
|
|
|
|
318 | let concentration = (position.market_value.abs() / total_value)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this could be rewritten as `let...else`
|
|
--> trading_engine/src/trading/position_manager.rs:329:9
|
|
|
|
|
329 | / let positions = match self.positions.read() {
|
|
330 | | Ok(pos) => pos,
|
|
331 | | Err(_) => return PositionStats::default(),
|
|
332 | | };
|
|
| |__________^ help: consider writing: `let Ok(positions) = self.positions.read() else { return PositionStats::default() };`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/trading/position_manager.rs:367:5
|
|
|
|
|
367 | /// PositionStats
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
367 - /// PositionStats
|
|
367 + /// `PositionStats`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/config.rs:8:5
|
|
|
|
|
8 | /// InteractiveBrokersConfig
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
8 - /// InteractiveBrokersConfig
|
|
8 + /// `InteractiveBrokersConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/config.rs:38:5
|
|
|
|
|
38 | /// ICMarketsConfig
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
38 - /// ICMarketsConfig
|
|
38 + /// `ICMarketsConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/config.rs:65:5
|
|
|
|
|
65 | /// BrokerConfigs
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
65 - /// BrokerConfigs
|
|
65 + /// `BrokerConfigs`
|
|
|
|
|
|
|
warning: this `impl` can be derived
|
|
--> trading_engine/src/brokers/config.rs:75:1
|
|
|
|
|
75 | / impl Default for BrokerConfigs {
|
|
76 | | fn default() -> Self {
|
|
77 | | Self {
|
|
78 | | interactive_brokers: InteractiveBrokersConfig::default(),
|
|
... |
|
|
82 | | }
|
|
| |_^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
|
|
help: replace the manual implementation with a derive attribute
|
|
|
|
|
68 + #[derive(Default)]
|
|
69 ~ pub struct BrokerConfigs {
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/config.rs:86:5
|
|
|
|
|
86 | /// RoutingConfig
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
86 - /// RoutingConfig
|
|
86 + /// `RoutingConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/config.rs:109:5
|
|
|
|
|
109 | /// BrokerConnectorConfig
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
109 - /// BrokerConnectorConfig
|
|
109 + /// `BrokerConnectorConfig`
|
|
|
|
|
|
|
warning: this `impl` can be derived
|
|
--> trading_engine/src/brokers/config.rs:121:1
|
|
|
|
|
121 | / impl Default for BrokerConnectorConfig {
|
|
122 | | fn default() -> Self {
|
|
123 | | Self {
|
|
124 | | brokers: BrokerConfigs::default(),
|
|
... |
|
|
129 | | }
|
|
| |_^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
|
|
help: replace the manual implementation with a derive attribute
|
|
|
|
|
112 + #[derive(Default)]
|
|
113 ~ pub struct BrokerConnectorConfig {
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/error.rs:7:5
|
|
|
|
|
7 | /// BrokerError
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
7 - /// BrokerError
|
|
7 + /// `BrokerError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/fix.rs:8:5
|
|
|
|
|
8 | /// FixMessage
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
8 - /// FixMessage
|
|
8 + /// `FixMessage`
|
|
|
|
|
|
|
warning: direct implementation of `ToString`
|
|
--> trading_engine/src/brokers/fix.rs:39:1
|
|
|
|
|
39 | / impl ToString for FixMessage {
|
|
40 | | fn to_string(&self) -> String {
|
|
41 | | let mut result = format!("35={}\u{0001}", self.msg_type);
|
|
42 | | for (tag, value) in &self.fields {
|
|
... |
|
|
47 | | }
|
|
| |_^
|
|
|
|
|
= help: prefer implementing `Display` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
|
|
= note: `-W clippy::to-string-trait-impl` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::to_string_trait_impl)]`
|
|
|
|
error: `format!(..)` appended to existing `String`
|
|
--> trading_engine/src/brokers/fix.rs:43:13
|
|
|
|
|
43 | result.push_str(&format!("{}={}\u{0001}", tag, value));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `write!` to avoid the extra allocation
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/icmarkets.rs:17:5
|
|
|
|
|
17 | /// ICMarketsConfig
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
17 - /// ICMarketsConfig
|
|
17 + /// `ICMarketsConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/icmarkets.rs:56:5
|
|
|
|
|
56 | /// ICMarketsClient
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
56 - /// ICMarketsClient
|
|
56 + /// `ICMarketsClient`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/icmarkets.rs:65:23
|
|
|
|
|
65 | /// Creates a new ICMarkets FIX client
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
65 - /// Creates a new ICMarkets FIX client
|
|
65 + /// Creates a new `ICMarkets` FIX client
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/icmarkets.rs:69:22
|
|
|
|
|
69 | /// * `config` - ICMarkets connection configuration
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
69 - /// * `config` - ICMarkets connection configuration
|
|
69 + /// * `config` - `ICMarkets` connection configuration
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/icmarkets.rs:73:15
|
|
|
|
|
73 | /// A new ICMarketsClient instance in disconnected state
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
73 - /// A new ICMarketsClient instance in disconnected state
|
|
73 + /// A new `ICMarketsClient` instance in disconnected state
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/icmarkets.rs:160:27
|
|
|
|
|
160 | /// FIX message types for ICMarkets FIX 4.4 protocol
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
160 - /// FIX message types for ICMarkets FIX 4.4 protocol
|
|
160 + /// FIX message types for `ICMarkets` FIX 4.4 protocol
|
|
|
|
|
|
|
warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
|
|
--> trading_engine/src/brokers/icmarkets.rs:206:5
|
|
|
|
|
206 | / pub fn from_str(s: &str) -> Option<Self> {
|
|
207 | | match s {
|
|
208 | | "A" => Some(Self::Logon),
|
|
209 | | "5" => Some(Self::Logout),
|
|
... |
|
|
221 | | }
|
|
| |_____^
|
|
|
|
|
= help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
|
|
= note: `-W clippy::should-implement-trait` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::should_implement_trait)]`
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/icmarkets.rs:242:16
|
|
|
|
|
242 | /// Parsed FixMessage or error if invalid
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
242 - /// Parsed FixMessage or error if invalid
|
|
242 + /// Parsed `FixMessage` or error if invalid
|
|
|
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/brokers/icmarkets.rs:258:30
|
|
|
|
|
258 | if let Ok(tag) = parts[0].parse::<u32>() {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/brokers/icmarkets.rs:259:29
|
|
|
|
|
259 | let value = parts[1].to_string();
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `parts[1].to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/brokers/icmarkets.rs:259:29
|
|
|
|
|
259 | let value = parts[1].to_string();
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/brokers/icmarkets.rs:309:31
|
|
|
|
|
309 | self.sender_comp_id = sender.to_string();
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `sender.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/brokers/icmarkets.rs:310:31
|
|
|
|
|
310 | self.target_comp_id = target.to_string();
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `target.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/brokers/icmarkets.rs:317:33
|
|
|
|
|
317 | self.fields.insert(tag, value.to_string());
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `value.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `format!(..)` appended to existing `String`
|
|
--> trading_engine/src/brokers/icmarkets.rs:327:9
|
|
|
|
|
327 | msg.push_str(&format!("35={}\u{0001}", self.msg_type.as_str())); // MsgType
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `write!` to avoid the extra allocation
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string
|
|
|
|
error: `format!(..)` appended to existing `String`
|
|
--> trading_engine/src/brokers/icmarkets.rs:328:9
|
|
|
|
|
328 | msg.push_str(&format!("49={}\u{0001}", self.sender_comp_id)); // SenderCompID
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `write!` to avoid the extra allocation
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string
|
|
|
|
error: `format!(..)` appended to existing `String`
|
|
--> trading_engine/src/brokers/icmarkets.rs:329:9
|
|
|
|
|
329 | msg.push_str(&format!("56={}\u{0001}", self.target_comp_id)); // TargetCompID
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `write!` to avoid the extra allocation
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string
|
|
|
|
error: `format!(..)` appended to existing `String`
|
|
--> trading_engine/src/brokers/icmarkets.rs:330:9
|
|
|
|
|
330 | msg.push_str(&format!("34={}\u{0001}", self.msg_seq_num)); // MsgSeqNum
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `write!` to avoid the extra allocation
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string
|
|
|
|
error: `format!(..)` appended to existing `String`
|
|
--> trading_engine/src/brokers/icmarkets.rs:331:9
|
|
|
|
|
331 | msg.push_str(&format!("52={}\u{0001}", Utc::now().format("%Y%m%d-%H:%M:%S"))); // SendingTime
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `write!` to avoid the extra allocation
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string
|
|
|
|
error: `format!(..)` appended to existing `String`
|
|
--> trading_engine/src/brokers/icmarkets.rs:335:13
|
|
|
|
|
335 | msg.push_str(&format!("{}={}\u{0001}", tag, value));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `write!` to avoid the extra allocation
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string
|
|
|
|
warning: this could be a `const fn`
|
|
--> trading_engine/src/brokers/icmarkets.rs:354:5
|
|
|
|
|
354 | / pub fn new() -> Self {
|
|
355 | | Self {
|
|
356 | | outgoing_seq: AtomicU64::new(1),
|
|
357 | | incoming_seq: AtomicU64::new(1),
|
|
358 | | }
|
|
359 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
= note: requested on the command line with `-W clippy::missing-const-for-fn`
|
|
help: make the function `const`
|
|
|
|
|
354 | pub const fn new() -> Self {
|
|
| +++++
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/interactive_brokers.rs:15:5
|
|
|
|
|
15 | /// InteractiveBrokersConfig
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
15 - /// InteractiveBrokersConfig
|
|
15 + /// `InteractiveBrokersConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/interactive_brokers.rs:45:5
|
|
|
|
|
45 | /// InteractiveBrokersClient
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
45 - /// InteractiveBrokersClient
|
|
45 + /// `InteractiveBrokersClient`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/interactive_brokers.rs:62:15
|
|
|
|
|
62 | /// A new InteractiveBrokersClient instance in disconnected state
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
62 - /// A new InteractiveBrokersClient instance in disconnected state
|
|
62 + /// A new `InteractiveBrokersClient` instance in disconnected state
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/monitoring.rs:24:5
|
|
|
|
|
24 | /// BrokerMetrics
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
24 - /// BrokerMetrics
|
|
24 + /// `BrokerMetrics`
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/brokers/monitoring.rs:57:32
|
|
|
|
|
57 | self.latency_ms = Some(latency.as_millis() as u64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/brokers/monitoring.rs:62:9
|
|
|
|
|
62 | self.error_count += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/routing.rs:9:5
|
|
|
|
|
9 | /// RoutingDecision
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
9 - /// RoutingDecision
|
|
9 + /// `RoutingDecision`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/routing.rs:21:5
|
|
|
|
|
21 | /// OrderRouter
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
21 - /// OrderRouter
|
|
21 + /// `OrderRouter`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/security.rs:10:5
|
|
|
|
|
10 | /// SecurityConfig
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
10 - /// SecurityConfig
|
|
10 + /// `SecurityConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/brokers/mod.rs:27:5
|
|
|
|
|
27 | /// BrokerConnector
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
27 - /// BrokerConnector
|
|
27 + /// `BrokerConnector`
|
|
|
|
|
|
|
error: found empty brackets on struct declaration
|
|
--> trading_engine/src/brokers/mod.rs:30:27
|
|
|
|
|
30 | pub struct BrokerConnector {}
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_structs_with_brackets
|
|
= note: requested on the command line with `-D clippy::empty-structs-with-brackets`
|
|
= help: remove the brackets
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:35:5
|
|
|
|
|
35 | /// BenchmarkConfig
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
35 - /// BenchmarkConfig
|
|
35 + /// `BenchmarkConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:68:5
|
|
|
|
|
68 | /// BenchmarkResult
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
68 - /// BenchmarkResult
|
|
68 + /// `BenchmarkResult`
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:138:46
|
|
|
|
|
138 | let passed_target = success_rate >= (1.0 - config.failure_threshold);
|
|
| ^^^ help: consider adding suffix: `1.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:111:22
|
|
|
|
|
111 | let min_ns = sorted[0];
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:112:22
|
|
|
|
|
112 | let max_ns = sorted[len - 1];
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:112:29
|
|
|
|
|
112 | let max_ns = sorted[len - 1];
|
|
| ^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:114:22
|
|
|
|
|
114 | let avg_ns = sum / len as u64;
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:114:22
|
|
|
|
|
114 | let avg_ns = sum / len as u64;
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:114:28
|
|
|
|
|
114 | let avg_ns = sum / len as u64;
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:116:22
|
|
|
|
|
116 | let p50_ns = sorted[len / 2];
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:116:29
|
|
|
|
|
116 | let p50_ns = sorted[len / 2];
|
|
| ^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:117:22
|
|
|
|
|
117 | let p95_ns = sorted[(len * 95) / 100];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:117:29
|
|
|
|
|
117 | let p95_ns = sorted[(len * 95) / 100];
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:117:29
|
|
|
|
|
117 | let p95_ns = sorted[(len * 95) / 100];
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:118:22
|
|
|
|
|
118 | let p99_ns = sorted[(len * 99) / 100];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:118:29
|
|
|
|
|
118 | let p99_ns = sorted[(len * 99) / 100];
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:118:29
|
|
|
|
|
118 | let p99_ns = sorted[(len * 99) / 100];
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:119:23
|
|
|
|
|
119 | let p999_ns = sorted[(len * 999) / 1000];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:119:30
|
|
|
|
|
119 | let p999_ns = sorted[(len * 999) / 1000];
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:119:30
|
|
|
|
|
119 | let p999_ns = sorted[(len * 999) / 1000];
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:122:24
|
|
|
|
|
122 | let variance = measurements
|
|
| ________________________^
|
|
123 | | .iter()
|
|
124 | | .map(|&x| {
|
|
125 | | let diff = x as f64 - avg_ns as f64;
|
|
... |
|
|
128 | | .sum::<f64>()
|
|
129 | | / len as f64;
|
|
| |________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:125:28
|
|
|
|
|
125 | let diff = x as f64 - avg_ns as f64;
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:125:39
|
|
|
|
|
125 | let diff = x as f64 - avg_ns as f64;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:129:15
|
|
|
|
|
129 | / len as f64;
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:137:28
|
|
|
|
|
137 | let success_rate = successes as f64 / len as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:137:28
|
|
|
|
|
137 | let success_rate = successes as f64 / len as f64;
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:137:47
|
|
|
|
|
137 | let success_rate = successes as f64 / len as f64;
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:138:45
|
|
|
|
|
138 | let passed_target = success_rate >= (1.0 - config.failure_threshold);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:142:13
|
|
|
|
|
142 | 1_000_000_000 / avg_ns
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:142:13
|
|
|
|
|
142 | 1_000_000_000 / avg_ns
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:221:26
|
|
|
|
|
221 | let mut passed = 0;
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:222:25
|
|
|
|
|
222 | let mut total = 0;
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:225:22
|
|
|
|
|
225 | total += 1;
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:227:27
|
|
|
|
|
227 | passed += 1;
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:241:23
|
|
|
|
|
241 | (passed * 100) / total
|
|
| ^^^ help: consider adding suffix: `100_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:200:9
|
|
|
|
|
200 | println!("\u{1f680} Starting Comprehensive Performance Benchmarks");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:201:9
|
|
|
|
|
201 | println!("Target: <{}ns latency", self.config.target_latency_ns);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:205:13
|
|
|
|
|
205 | / println!(
|
|
206 | | "\u{26a0}\u{fe0f} TSC calibration failed: {}, using system clock fallback",
|
|
207 | | e
|
|
208 | | );
|
|
| |_____________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:218:9
|
|
|
|
|
218 | println!("\n\u{1f3af} PERFORMANCE BENCHMARK SUMMARY");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:219:9
|
|
|
|
|
219 | println!("=================================");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:225:13
|
|
|
|
|
225 | total += 1;
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:227:17
|
|
|
|
|
227 | passed += 1;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:228:17
|
|
|
|
|
228 | println!("\u{2705} {}: {:.1}ns avg", result.test_name, result.avg_ns);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:230:17
|
|
|
|
|
230 | / println!(
|
|
231 | | "\u{274c} {}: {:.1}ns avg (target: {}ns)",
|
|
232 | | result.test_name, result.avg_ns, self.config.target_latency_ns
|
|
233 | | );
|
|
| |_________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:237:9
|
|
|
|
|
237 | / println!(
|
|
238 | | "\nOverall: {}/{} tests passed ({}%)",
|
|
239 | | passed,
|
|
240 | | total,
|
|
241 | | (passed * 100) / total
|
|
242 | | );
|
|
| |_________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:241:13
|
|
|
|
|
241 | (passed * 100) / total
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:241:13
|
|
|
|
|
241 | (passed * 100) / total
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:250:9
|
|
|
|
|
250 | println!("\n\u{1f4ca} SIMD Performance Benchmarks");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:253:13
|
|
|
|
|
253 | println!("\u{26a0}\u{fe0f} AVX2 not available, using scalar fallback");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:265:5
|
|
|
|
|
265 | fn benchmark_simd_vwap_calculation(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
= note: requested on the command line with `-W clippy::unnecessary-wraps`
|
|
help: remove the return type...
|
|
|
|
|
265 - fn benchmark_simd_vwap_calculation(&mut self) -> Result<(), String> {
|
|
265 + fn benchmark_simd_vwap_calculation(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
316 - Ok(())
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:266:30
|
|
|
|
|
266 | let test_data_size = 10000;
|
|
| ^^^^^ help: consider adding suffix: `10_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:267:33
|
|
|
|
|
267 | let prices: Vec<f64> = (0..test_data_size)
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:270:34
|
|
|
|
|
270 | let volumes: Vec<f64> = (0..test_data_size).map(|i| 1000.0 + i as f64).collect();
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:268:22
|
|
|
|
|
268 | .map(|i| 100.0 + i as f64 * 0.01)
|
|
| ^^^^^ help: consider adding suffix: `100.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:268:41
|
|
|
|
|
268 | .map(|i| 100.0 + i as f64 * 0.01)
|
|
| ^^^^ help: consider adding suffix: `0.01_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:268:22
|
|
|
|
|
268 | .map(|i| 100.0 + i as f64 * 0.01)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:268:30
|
|
|
|
|
268 | .map(|i| 100.0 + i as f64 * 0.01)
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:270:61
|
|
|
|
|
270 | let volumes: Vec<f64> = (0..test_data_size).map(|i| 1000.0 + i as f64).collect();
|
|
| ^^^^^^ help: consider adding suffix: `1_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:270:61
|
|
|
|
|
270 | let volumes: Vec<f64> = (0..test_data_size).map(|i| 1000.0 + i as f64).collect();
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:270:70
|
|
|
|
|
270 | let volumes: Vec<f64> = (0..test_data_size).map(|i| 1000.0 + i as f64).collect();
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:279:13
|
|
|
|
|
279 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:279:13
|
|
|
|
|
279 | / unsafe {
|
|
280 | | let simd_ops = SimdPriceOps::new();
|
|
281 | | for _ in 0..self.config.warmup_iterations {
|
|
282 | | let _vwap = simd_ops.calculate_vwap_aligned(&aligned_prices, &aligned_volumes);
|
|
283 | | }
|
|
284 | | }
|
|
| |_____________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:280:32
|
|
|
|
|
280 | let simd_ops = SimdPriceOps::new();
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:282:33
|
|
|
|
|
282 | let _vwap = simd_ops.calculate_vwap_aligned(&aligned_prices, &aligned_volumes);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:289:25
|
|
|
|
|
289 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:292:17
|
|
|
|
|
292 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:292:17
|
|
|
|
|
292 | / unsafe {
|
|
293 | | let simd_ops = SimdPriceOps::new();
|
|
294 | | let _vwap = simd_ops.calculate_vwap_aligned(&aligned_prices, &aligned_volumes);
|
|
295 | | }
|
|
| |_________________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:293:36
|
|
|
|
|
293 | let simd_ops = SimdPriceOps::new();
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:294:33
|
|
|
|
|
294 | let _vwap = simd_ops.calculate_vwap_aligned(&aligned_prices, &aligned_volumes);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:298:84
|
|
|
|
|
298 | let total_pv: f64 = prices.iter().zip(volumes.iter()).map(|(p, v)| p * v).sum();
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:300:29
|
|
|
|
|
300 | let _vwap = total_pv / total_volume;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:303:23
|
|
|
|
|
303 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:304:26
|
|
|
|
|
304 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:306:22
|
|
|
|
|
306 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:306:22
|
|
|
|
|
306 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:319:5
|
|
|
|
|
319 | fn benchmark_simd_price_sorting(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
319 - fn benchmark_simd_price_sorting(&mut self) -> Result<(), String> {
|
|
319 + fn benchmark_simd_price_sorting(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
358 - Ok(())
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:327:39
|
|
|
|
|
327 | let mut prices = [150.0, 100.0, 200.0, 50.0];
|
|
| ^^^^^ help: consider adding suffix: `150.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:327:46
|
|
|
|
|
327 | let mut prices = [150.0, 100.0, 200.0, 50.0];
|
|
| ^^^^^ help: consider adding suffix: `100.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:327:53
|
|
|
|
|
327 | let mut prices = [150.0, 100.0, 200.0, 50.0];
|
|
| ^^^^^ help: consider adding suffix: `200.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:327:60
|
|
|
|
|
327 | let mut prices = [150.0, 100.0, 200.0, 50.0];
|
|
| ^^^^ help: consider adding suffix: `50.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:340:39
|
|
|
|
|
340 | let mut prices = [150.0, 100.0, 200.0, 50.0];
|
|
| ^^^^^ help: consider adding suffix: `150.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:340:46
|
|
|
|
|
340 | let mut prices = [150.0, 100.0, 200.0, 50.0];
|
|
| ^^^^^ help: consider adding suffix: `100.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:340:53
|
|
|
|
|
340 | let mut prices = [150.0, 100.0, 200.0, 50.0];
|
|
| ^^^^^ help: consider adding suffix: `200.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:340:60
|
|
|
|
|
340 | let mut prices = [150.0, 100.0, 200.0, 50.0];
|
|
| ^^^^ help: consider adding suffix: `50.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:345:35
|
|
|
|
|
345 | let mut prices = [150.0, 100.0, 200.0, 50.0];
|
|
| ^^^^^ help: consider adding suffix: `150.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:345:42
|
|
|
|
|
345 | let mut prices = [150.0, 100.0, 200.0, 50.0];
|
|
| ^^^^^ help: consider adding suffix: `100.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:345:49
|
|
|
|
|
345 | let mut prices = [150.0, 100.0, 200.0, 50.0];
|
|
| ^^^^^ help: consider adding suffix: `200.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:345:56
|
|
|
|
|
345 | let mut prices = [150.0, 100.0, 200.0, 50.0];
|
|
| ^^^^ help: consider adding suffix: `50.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:324:13
|
|
|
|
|
324 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:324:13
|
|
|
|
|
324 | / unsafe {
|
|
325 | | let simd_ops = SimdPriceOps::new();
|
|
326 | | for _ in 0..self.config.warmup_iterations {
|
|
327 | | let mut prices = [150.0, 100.0, 200.0, 50.0];
|
|
... |
|
|
330 | | }
|
|
| |_____________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:325:32
|
|
|
|
|
325 | let simd_ops = SimdPriceOps::new();
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:328:21
|
|
|
|
|
328 | simd_ops.simd_sort_4_prices(&mut prices);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:335:25
|
|
|
|
|
335 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:338:17
|
|
|
|
|
338 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:338:17
|
|
|
|
|
338 | / unsafe {
|
|
339 | | let simd_ops = SimdPriceOps::new();
|
|
340 | | let mut prices = [150.0, 100.0, 200.0, 50.0];
|
|
341 | | simd_ops.simd_sort_4_prices(&mut prices);
|
|
342 | | }
|
|
| |_________________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:339:36
|
|
|
|
|
339 | let simd_ops = SimdPriceOps::new();
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:341:21
|
|
|
|
|
341 | simd_ops.simd_sort_4_prices(&mut prices);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:349:23
|
|
|
|
|
349 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:350:26
|
|
|
|
|
350 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:351:22
|
|
|
|
|
351 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:351:22
|
|
|
|
|
351 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:361:5
|
|
|
|
|
361 | fn benchmark_simd_risk_var_calculation(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
361 - fn benchmark_simd_risk_var_calculation(&mut self) -> Result<(), String> {
|
|
361 + fn benchmark_simd_risk_var_calculation(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
420 - Ok(())
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:362:30
|
|
|
|
|
362 | let positions = vec![1000.0, -500.0, 750.0, 200.0, 300.0, -800.0, 400.0, 600.0];
|
|
| ^^^^^^ help: consider adding suffix: `1_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:362:39
|
|
|
|
|
362 | let positions = vec![1000.0, -500.0, 750.0, 200.0, 300.0, -800.0, 400.0, 600.0];
|
|
| ^^^^^ help: consider adding suffix: `500.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:362:46
|
|
|
|
|
362 | let positions = vec![1000.0, -500.0, 750.0, 200.0, 300.0, -800.0, 400.0, 600.0];
|
|
| ^^^^^ help: consider adding suffix: `750.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:362:53
|
|
|
|
|
362 | let positions = vec![1000.0, -500.0, 750.0, 200.0, 300.0, -800.0, 400.0, 600.0];
|
|
| ^^^^^ help: consider adding suffix: `200.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:362:60
|
|
|
|
|
362 | let positions = vec![1000.0, -500.0, 750.0, 200.0, 300.0, -800.0, 400.0, 600.0];
|
|
| ^^^^^ help: consider adding suffix: `300.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:362:68
|
|
|
|
|
362 | let positions = vec![1000.0, -500.0, 750.0, 200.0, 300.0, -800.0, 400.0, 600.0];
|
|
| ^^^^^ help: consider adding suffix: `800.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:362:75
|
|
|
|
|
362 | let positions = vec![1000.0, -500.0, 750.0, 200.0, 300.0, -800.0, 400.0, 600.0];
|
|
| ^^^^^ help: consider adding suffix: `400.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:362:82
|
|
|
|
|
362 | let positions = vec![1000.0, -500.0, 750.0, 200.0, 300.0, -800.0, 400.0, 600.0];
|
|
| ^^^^^ help: consider adding suffix: `600.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:363:27
|
|
|
|
|
363 | let prices = vec![100.0, 200.0, 50.0, 300.0, 150.0, 80.0, 250.0, 120.0];
|
|
| ^^^^^ help: consider adding suffix: `100.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:363:34
|
|
|
|
|
363 | let prices = vec![100.0, 200.0, 50.0, 300.0, 150.0, 80.0, 250.0, 120.0];
|
|
| ^^^^^ help: consider adding suffix: `200.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:363:41
|
|
|
|
|
363 | let prices = vec![100.0, 200.0, 50.0, 300.0, 150.0, 80.0, 250.0, 120.0];
|
|
| ^^^^ help: consider adding suffix: `50.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:363:47
|
|
|
|
|
363 | let prices = vec![100.0, 200.0, 50.0, 300.0, 150.0, 80.0, 250.0, 120.0];
|
|
| ^^^^^ help: consider adding suffix: `300.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:363:54
|
|
|
|
|
363 | let prices = vec![100.0, 200.0, 50.0, 300.0, 150.0, 80.0, 250.0, 120.0];
|
|
| ^^^^^ help: consider adding suffix: `150.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:363:61
|
|
|
|
|
363 | let prices = vec![100.0, 200.0, 50.0, 300.0, 150.0, 80.0, 250.0, 120.0];
|
|
| ^^^^ help: consider adding suffix: `80.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:363:67
|
|
|
|
|
363 | let prices = vec![100.0, 200.0, 50.0, 300.0, 150.0, 80.0, 250.0, 120.0];
|
|
| ^^^^^ help: consider adding suffix: `250.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:363:74
|
|
|
|
|
363 | let prices = vec![100.0, 200.0, 50.0, 300.0, 150.0, 80.0, 250.0, 120.0];
|
|
| ^^^^^ help: consider adding suffix: `120.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:364:33
|
|
|
|
|
364 | let volatilities = vec![0.15, 0.20, 0.10, 0.25, 0.18, 0.12, 0.22, 0.16];
|
|
| ^^^^ help: consider adding suffix: `0.15_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:364:39
|
|
|
|
|
364 | let volatilities = vec![0.15, 0.20, 0.10, 0.25, 0.18, 0.12, 0.22, 0.16];
|
|
| ^^^^ help: consider adding suffix: `0.20_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:364:45
|
|
|
|
|
364 | let volatilities = vec![0.15, 0.20, 0.10, 0.25, 0.18, 0.12, 0.22, 0.16];
|
|
| ^^^^ help: consider adding suffix: `0.10_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:364:51
|
|
|
|
|
364 | let volatilities = vec![0.15, 0.20, 0.10, 0.25, 0.18, 0.12, 0.22, 0.16];
|
|
| ^^^^ help: consider adding suffix: `0.25_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:364:57
|
|
|
|
|
364 | let volatilities = vec![0.15, 0.20, 0.10, 0.25, 0.18, 0.12, 0.22, 0.16];
|
|
| ^^^^ help: consider adding suffix: `0.18_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:364:63
|
|
|
|
|
364 | let volatilities = vec![0.15, 0.20, 0.10, 0.25, 0.18, 0.12, 0.22, 0.16];
|
|
| ^^^^ help: consider adding suffix: `0.12_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:364:69
|
|
|
|
|
364 | let volatilities = vec![0.15, 0.20, 0.10, 0.25, 0.18, 0.12, 0.22, 0.16];
|
|
| ^^^^ help: consider adding suffix: `0.22_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:364:75
|
|
|
|
|
364 | let volatilities = vec![0.15, 0.20, 0.10, 0.25, 0.18, 0.12, 0.22, 0.16];
|
|
| ^^^^ help: consider adding suffix: `0.16_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:399:46
|
|
|
|
|
399 | let mut portfolio_variance = 0.0;
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:402:76
|
|
|
|
|
402 | let var_component = position_value * volatilities[i] * 1.96;
|
|
| ^^^^ help: consider adding suffix: `1.96_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:370:13
|
|
|
|
|
370 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:370:13
|
|
|
|
|
370 | / unsafe {
|
|
371 | | let risk_engine = SimdRiskEngine::new();
|
|
372 | | for _ in 0..self.config.warmup_iterations {
|
|
373 | | let _var = risk_engine.calculate_portfolio_var(
|
|
... |
|
|
380 | | }
|
|
| |_____________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:371:35
|
|
|
|
|
371 | let risk_engine = SimdRiskEngine::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:373:32
|
|
|
|
|
373 | let _var = risk_engine.calculate_portfolio_var(
|
|
| ________________________________^
|
|
374 | | &positions,
|
|
375 | | &prices,
|
|
376 | | &volatilities,
|
|
377 | | 1.96,
|
|
378 | | );
|
|
| |_____________________^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:385:25
|
|
|
|
|
385 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:388:17
|
|
|
|
|
388 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:388:17
|
|
|
|
|
388 | / unsafe {
|
|
389 | | let risk_engine = SimdRiskEngine::new();
|
|
390 | | let _var = risk_engine.calculate_portfolio_var(
|
|
391 | | &positions,
|
|
... |
|
|
395 | | );
|
|
396 | | }
|
|
| |_________________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:389:39
|
|
|
|
|
389 | let risk_engine = SimdRiskEngine::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:390:32
|
|
|
|
|
390 | let _var = risk_engine.calculate_portfolio_var(
|
|
| ________________________________^
|
|
391 | | &positions,
|
|
392 | | &prices,
|
|
393 | | &volatilities,
|
|
394 | | 1.96,
|
|
395 | | );
|
|
| |_____________________^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:401:42
|
|
|
|
|
401 | let position_value = positions[i] * prices[i];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:401:42
|
|
|
|
|
401 | let position_value = positions[i] * prices[i];
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:401:57
|
|
|
|
|
401 | let position_value = positions[i] * prices[i];
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:402:41
|
|
|
|
|
402 | let var_component = position_value * volatilities[i] * 1.96;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:402:58
|
|
|
|
|
402 | let var_component = position_value * volatilities[i] * 1.96;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:403:21
|
|
|
|
|
403 | portfolio_variance += var_component * var_component;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:408:23
|
|
|
|
|
408 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:409:26
|
|
|
|
|
409 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:410:22
|
|
|
|
|
410 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:410:22
|
|
|
|
|
410 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:423:5
|
|
|
|
|
423 | fn benchmark_simd_market_data_processing(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
423 - fn benchmark_simd_market_data_processing(&mut self) -> Result<(), String> {
|
|
423 + fn benchmark_simd_market_data_processing(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
476 - Ok(())
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:424:30
|
|
|
|
|
424 | let test_data_size = 1000;
|
|
| ^^^^ help: consider adding suffix: `1_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:425:33
|
|
|
|
|
425 | let prices: Vec<f64> = (0..test_data_size)
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:428:34
|
|
|
|
|
428 | let volumes: Vec<f64> = (0..test_data_size)
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:457:47
|
|
|
|
|
457 | let _vwap = if total_volume > 0.0 {
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:460:21
|
|
|
|
|
460 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:426:22
|
|
|
|
|
426 | .map(|i| 100.0 + (i as f64 % 100.0) * 0.01)
|
|
| ^^^^^ help: consider adding suffix: `100.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:426:42
|
|
|
|
|
426 | .map(|i| 100.0 + (i as f64 % 100.0) * 0.01)
|
|
| ^^^^^ help: consider adding suffix: `100.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:426:51
|
|
|
|
|
426 | .map(|i| 100.0 + (i as f64 % 100.0) * 0.01)
|
|
| ^^^^ help: consider adding suffix: `0.01_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:426:22
|
|
|
|
|
426 | .map(|i| 100.0 + (i as f64 % 100.0) * 0.01)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: you are using modulo operator on types that might have different signs
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:426:30
|
|
|
|
|
426 | .map(|i| 100.0 + (i as f64 % 100.0) * 0.01)
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: double check for expected result especially when interoperating with different languages
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#modulo_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:426:31
|
|
|
|
|
426 | .map(|i| 100.0 + (i as f64 % 100.0) * 0.01)
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:429:22
|
|
|
|
|
429 | .map(|i| 1000.0 + (i as f64 % 500.0))
|
|
| ^^^^^^ help: consider adding suffix: `1_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:429:43
|
|
|
|
|
429 | .map(|i| 1000.0 + (i as f64 % 500.0))
|
|
| ^^^^^ help: consider adding suffix: `500.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:429:22
|
|
|
|
|
429 | .map(|i| 1000.0 + (i as f64 % 500.0))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: you are using modulo operator on types that might have different signs
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:429:31
|
|
|
|
|
429 | .map(|i| 1000.0 + (i as f64 % 500.0))
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: double check for expected result especially when interoperating with different languages
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#modulo_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:429:32
|
|
|
|
|
429 | .map(|i| 1000.0 + (i as f64 % 500.0))
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:436:13
|
|
|
|
|
436 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:436:13
|
|
|
|
|
436 | / unsafe {
|
|
437 | | let market_ops = SimdMarketDataOps::new();
|
|
438 | | for _ in 0..self.config.warmup_iterations {
|
|
439 | | let _vwap = market_ops.calculate_vwap(&prices, &volumes);
|
|
440 | | }
|
|
441 | | }
|
|
| |_____________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:437:34
|
|
|
|
|
437 | let market_ops = SimdMarketDataOps::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:439:33
|
|
|
|
|
439 | let _vwap = market_ops.calculate_vwap(&prices, &volumes);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:446:25
|
|
|
|
|
446 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:449:17
|
|
|
|
|
449 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:449:17
|
|
|
|
|
449 | / unsafe {
|
|
450 | | let market_ops = SimdMarketDataOps::new();
|
|
451 | | let _vwap = market_ops.calculate_vwap(&prices, &volumes);
|
|
452 | | }
|
|
| |_________________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:450:38
|
|
|
|
|
450 | let market_ops = SimdMarketDataOps::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:451:33
|
|
|
|
|
451 | let _vwap = market_ops.calculate_vwap(&prices, &volumes);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:455:84
|
|
|
|
|
455 | let total_pv: f64 = prices.iter().zip(volumes.iter()).map(|(p, v)| p * v).sum();
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:458:21
|
|
|
|
|
458 | total_pv / total_volume
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:464:23
|
|
|
|
|
464 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:465:26
|
|
|
|
|
465 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:466:22
|
|
|
|
|
466 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:466:22
|
|
|
|
|
466 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:479:5
|
|
|
|
|
479 | fn benchmark_simd_vs_scalar_speedup(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
479 - fn benchmark_simd_vs_scalar_speedup(&mut self) -> Result<(), String> {
|
|
479 + fn benchmark_simd_vs_scalar_speedup(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
556 - Ok(())
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:480:30
|
|
|
|
|
480 | let test_data_size = 10000;
|
|
| ^^^^^ help: consider adding suffix: `10_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:481:31
|
|
|
|
|
481 | let data: Vec<f64> = (0..test_data_size).map(|i| i as f64).collect();
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:481:58
|
|
|
|
|
481 | let data: Vec<f64> = (0..test_data_size).map(|i| i as f64).collect();
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:487:29
|
|
|
|
|
487 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:489:17
|
|
|
|
|
489 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 8 unsafe operations, expected only one
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:489:17
|
|
|
|
|
489 | / unsafe {
|
|
490 | | use std::arch::x86_64::{
|
|
491 | | _mm256_add_pd, _mm256_castpd256_pd128, _mm256_extractf128_pd,
|
|
492 | | _mm256_hadd_pd, _mm256_loadu_pd, _mm256_setzero_pd, _mm_add_pd,
|
|
... |
|
|
507 | | let _result = _mm_cvtsd_f64(sum_64);
|
|
508 | | }
|
|
| |_________________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:495:39
|
|
|
|
|
495 | let mut sum_vec = _mm256_setzero_pd();
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:499:40
|
|
|
|
|
499 | let data_vec = _mm256_loadu_pd(&data[i]);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:500:35
|
|
|
|
|
500 | sum_vec = _mm256_add_pd(sum_vec, data_vec);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:504:40
|
|
|
|
|
504 | let sum_high_low = _mm256_hadd_pd(sum_vec, sum_vec);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:505:35
|
|
|
|
|
505 | let sum_128 = _mm256_extractf128_pd(sum_high_low, 1);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:506:34
|
|
|
|
|
506 | let sum_64 = _mm_add_pd(_mm256_castpd256_pd128(sum_high_low), sum_128);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:506:45
|
|
|
|
|
506 | let sum_64 = _mm_add_pd(_mm256_castpd256_pd128(sum_high_low), sum_128);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:507:35
|
|
|
|
|
507 | let _result = _mm_cvtsd_f64(sum_64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:498:27
|
|
|
|
|
498 | while i + 4 <= data.len() {
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:499:57
|
|
|
|
|
499 | let data_vec = _mm256_loadu_pd(&data[i]);
|
|
| ^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:501:25
|
|
|
|
|
501 | i += 4;
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:510:27
|
|
|
|
|
510 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:511:30
|
|
|
|
|
511 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:512:26
|
|
|
|
|
512 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:512:26
|
|
|
|
|
512 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:520:25
|
|
|
|
|
520 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:522:23
|
|
|
|
|
522 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:523:26
|
|
|
|
|
523 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:524:22
|
|
|
|
|
524 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:524:22
|
|
|
|
|
524 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:530:13
|
|
|
|
|
530 | simd_measurements.iter().sum::<u64>() / simd_measurements.len() as u64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:530:13
|
|
|
|
|
530 | simd_measurements.iter().sum::<u64>() / simd_measurements.len() as u64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:530:53
|
|
|
|
|
530 | simd_measurements.iter().sum::<u64>() / simd_measurements.len() as u64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:534:26
|
|
|
|
|
534 | let scalar_avg = scalar_measurements.iter().sum::<u64>() / scalar_measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:534:26
|
|
|
|
|
534 | let scalar_avg = scalar_measurements.iter().sum::<u64>() / scalar_measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:534:68
|
|
|
|
|
534 | let scalar_avg = scalar_measurements.iter().sum::<u64>() / scalar_measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:536:9
|
|
|
|
|
536 | / println!(
|
|
537 | | " SIMD vs Scalar Speedup: {:.2}x (SIMD: {}ns, Scalar: {}ns)",
|
|
538 | | scalar_avg as f64 / simd_avg as f64,
|
|
539 | | simd_avg,
|
|
540 | | scalar_avg
|
|
541 | | );
|
|
| |_________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:538:13
|
|
|
|
|
538 | scalar_avg as f64 / simd_avg as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:538:13
|
|
|
|
|
538 | scalar_avg as f64 / simd_avg as f64,
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:538:33
|
|
|
|
|
538 | scalar_avg as f64 / simd_avg as f64,
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:562:9
|
|
|
|
|
562 | println!("\n\u{1f512} Lock-Free Structure Benchmarks");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
error: non-binding `let` on an expression with `#[must_use]` type
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:581:13
|
|
|
|
|
581 | let _ = buffer.try_push(i as u64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider explicitly using expression value
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:581:37
|
|
|
|
|
581 | let _ = buffer.try_push(i as u64);
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:587:25
|
|
|
|
|
587 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
error: non-binding `let` on an expression with `#[must_use]` type
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:589:13
|
|
|
|
|
589 | let _ = buffer.try_push(i as u64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider explicitly using expression value
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:589:37
|
|
|
|
|
589 | let _ = buffer.try_push(i as u64);
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:592:23
|
|
|
|
|
592 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:593:26
|
|
|
|
|
593 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:594:22
|
|
|
|
|
594 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:594:22
|
|
|
|
|
594 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:604:5
|
|
|
|
|
604 | fn benchmark_mpsc_queue(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
604 - fn benchmark_mpsc_queue(&mut self) -> Result<(), String> {
|
|
604 + fn benchmark_mpsc_queue(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
630 - Ok(())
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:611:24
|
|
|
|
|
611 | queue.push(i as u64);
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:617:25
|
|
|
|
|
617 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:619:24
|
|
|
|
|
619 | queue.push(i as u64);
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:622:23
|
|
|
|
|
622 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:623:26
|
|
|
|
|
623 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:624:22
|
|
|
|
|
624 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:624:22
|
|
|
|
|
624 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:641:66
|
|
|
|
|
641 | let msg = HftMessage::new(message_types::HEARTBEAT, [i as u64; 8]);
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: non-binding `let` on an expression with `#[must_use]` type
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:642:13
|
|
|
|
|
642 | let _ = channel.send(msg);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider explicitly using expression value
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
|
|
|
|
error: non-binding `let` on a result of a `#[must_use]` function
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:643:13
|
|
|
|
|
643 | let _ = channel.try_receive();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider explicitly using function result
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:648:70
|
|
|
|
|
648 | let msg = HftMessage::new(message_types::ORDER_REQUEST, [i as u64; 8]);
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:650:25
|
|
|
|
|
650 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
error: non-binding `let` on an expression with `#[must_use]` type
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:652:13
|
|
|
|
|
652 | let _ = channel.send(msg);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider explicitly using expression value
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:655:23
|
|
|
|
|
655 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:656:26
|
|
|
|
|
656 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:657:22
|
|
|
|
|
657 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:657:22
|
|
|
|
|
657 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:679:30
|
|
|
|
|
679 | let order_data = i as u64;
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: non-binding `let` on an expression with `#[must_use]` type
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:680:13
|
|
|
|
|
680 | let _ = ring.try_push(order_data);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider explicitly using expression value
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:686:30
|
|
|
|
|
686 | let order_data = i as u64;
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:688:25
|
|
|
|
|
688 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
error: non-binding `let` on an expression with `#[must_use]` type
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:690:13
|
|
|
|
|
690 | let _ = ring.try_push(order_data);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider explicitly using expression value
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:694:23
|
|
|
|
|
694 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:695:26
|
|
|
|
|
695 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:696:22
|
|
|
|
|
696 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:696:22
|
|
|
|
|
696 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:705:5
|
|
|
|
|
705 | fn benchmark_atomic_operations(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
705 - fn benchmark_atomic_operations(&mut self) -> Result<(), String> {
|
|
705 + fn benchmark_atomic_operations(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
730 - Ok(())
|
|
|
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:716:25
|
|
|
|
|
716 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:721:23
|
|
|
|
|
721 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:722:26
|
|
|
|
|
722 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:723:22
|
|
|
|
|
723 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:723:22
|
|
|
|
|
723 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:736:9
|
|
|
|
|
736 | println!("\n\u{23f1}\u{fe0f} RDTSC Timing Accuracy Tests");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:747:5
|
|
|
|
|
747 | fn benchmark_rdtsc_overhead(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
747 - fn benchmark_rdtsc_overhead(&mut self) -> Result<(), String> {
|
|
747 + fn benchmark_rdtsc_overhead(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
761 - Ok(())
|
|
|
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:752:25
|
|
|
|
|
752 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:753:23
|
|
|
|
|
753 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:754:26
|
|
|
|
|
754 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:755:22
|
|
|
|
|
755 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:755:22
|
|
|
|
|
755 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:764:5
|
|
|
|
|
764 | fn benchmark_rdtsc_vs_system_clock(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
764 - fn benchmark_rdtsc_vs_system_clock(&mut self) -> Result<(), String> {
|
|
764 + fn benchmark_rdtsc_vs_system_clock(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
810 - Ok(())
|
|
|
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:770:25
|
|
|
|
|
770 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:773:23
|
|
|
|
|
773 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:774:26
|
|
|
|
|
774 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:775:22
|
|
|
|
|
775 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:775:22
|
|
|
|
|
775 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:785:22
|
|
|
|
|
785 | let ns = end.duration_since(start).as_nanos() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:789:25
|
|
|
|
|
789 | let rdtsc_avg = rdtsc_measurements.iter().sum::<u64>() / rdtsc_measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:789:25
|
|
|
|
|
789 | let rdtsc_avg = rdtsc_measurements.iter().sum::<u64>() / rdtsc_measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:789:66
|
|
|
|
|
789 | let rdtsc_avg = rdtsc_measurements.iter().sum::<u64>() / rdtsc_measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:790:26
|
|
|
|
|
790 | let system_avg = system_measurements.iter().sum::<u64>() / system_measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:790:26
|
|
|
|
|
790 | let system_avg = system_measurements.iter().sum::<u64>() / system_measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:790:68
|
|
|
|
|
790 | let system_avg = system_measurements.iter().sum::<u64>() / system_measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:792:9
|
|
|
|
|
792 | / println!(
|
|
793 | | " RDTSC vs System Clock: RDTSC {}ns, System {}ns",
|
|
794 | | rdtsc_avg, system_avg
|
|
795 | | );
|
|
| |_________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:813:5
|
|
|
|
|
813 | fn benchmark_hardware_timestamp(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
813 - fn benchmark_hardware_timestamp(&mut self) -> Result<(), String> {
|
|
813 + fn benchmark_hardware_timestamp(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
839 - Ok(())
|
|
|
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:823:25
|
|
|
|
|
823 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:827:23
|
|
|
|
|
827 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:828:26
|
|
|
|
|
828 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:829:22
|
|
|
|
|
829 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:829:22
|
|
|
|
|
829 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:842:5
|
|
|
|
|
842 | fn benchmark_latency_measurement(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
842 - fn benchmark_latency_measurement(&mut self) -> Result<(), String> {
|
|
842 + fn benchmark_latency_measurement(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
867 - Ok(())
|
|
|
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:853:25
|
|
|
|
|
853 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:858:23
|
|
|
|
|
858 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:859:26
|
|
|
|
|
859 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:860:22
|
|
|
|
|
860 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:860:22
|
|
|
|
|
860 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:870:5
|
|
|
|
|
870 | fn benchmark_timing_consistency(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
870 - fn benchmark_timing_consistency(&mut self) -> Result<(), String> {
|
|
870 + fn benchmark_timing_consistency(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
887 - Ok(())
|
|
|
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:893:9
|
|
|
|
|
893 | println!("\n\u{1f4cb} Order Processing Latency Benchmarks");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:919:25
|
|
|
|
|
919 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:928:23
|
|
|
|
|
928 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:929:26
|
|
|
|
|
929 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:930:22
|
|
|
|
|
930 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:930:22
|
|
|
|
|
930 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:962:25
|
|
|
|
|
962 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:964:23
|
|
|
|
|
964 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:966:26
|
|
|
|
|
966 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:967:22
|
|
|
|
|
967 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:967:22
|
|
|
|
|
967 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1000:25
|
|
|
|
|
1000 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1002:23
|
|
|
|
|
1002 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1004:26
|
|
|
|
|
1004 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1005:22
|
|
|
|
|
1005 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1005:22
|
|
|
|
|
1005 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1014:5
|
|
|
|
|
1014 | fn benchmark_execution_processing(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
1014 - fn benchmark_execution_processing(&mut self) -> Result<(), String> {
|
|
1014 + fn benchmark_execution_processing(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
1076 - Ok(())
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1023:41
|
|
|
|
|
1023 | quantity: Decimal::from(100),
|
|
| ^^^ help: consider adding suffix: `100_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1024:38
|
|
|
|
|
1024 | price: Decimal::from(50000),
|
|
| ^^^^^ help: consider adding suffix: `50_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1034:44
|
|
|
|
|
1034 | gross_value: Decimal::from(5000000),
|
|
| ^^^^^^^ help: consider adding suffix: `5_000_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1035:42
|
|
|
|
|
1035 | net_value: Decimal::from(5000000),
|
|
| ^^^^^^^ help: consider adding suffix: `5_000_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1046:41
|
|
|
|
|
1046 | quantity: Decimal::from(100),
|
|
| ^^^ help: consider adding suffix: `100_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1047:38
|
|
|
|
|
1047 | price: Decimal::from(50000),
|
|
| ^^^^^ help: consider adding suffix: `50_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1057:44
|
|
|
|
|
1057 | gross_value: Decimal::from(5000000),
|
|
| ^^^^^^^ help: consider adding suffix: `5_000_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1058:42
|
|
|
|
|
1058 | net_value: Decimal::from(5000000),
|
|
| ^^^^^^^ help: consider adding suffix: `5_000_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1022:25
|
|
|
|
|
1022 | symbol: "BTCUSD".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `"BTCUSD".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1027:31
|
|
|
|
|
1027 | fee_currency: "USD".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"USD".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1045:25
|
|
|
|
|
1045 | symbol: "BTCUSD".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `"BTCUSD".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1050:31
|
|
|
|
|
1050 | fee_currency: "USD".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"USD".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1061:25
|
|
|
|
|
1061 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1063:23
|
|
|
|
|
1063 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1065:26
|
|
|
|
|
1065 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1066:22
|
|
|
|
|
1066 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1066:22
|
|
|
|
|
1066 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1084:25
|
|
|
|
|
1084 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1112:31
|
|
|
|
|
1112 | fee_currency: "USD".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"USD".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1119:30
|
|
|
|
|
1119 | gross_value: order.quantity.to_decimal().unwrap_or(Decimal::ZERO)
|
|
| ______________________________^
|
|
1120 | | * order
|
|
1121 | | .price
|
|
1122 | | .map(|p| p.to_decimal().unwrap_or(Decimal::ZERO))
|
|
1123 | | .unwrap_or(Decimal::ZERO),
|
|
| |_________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1124:28
|
|
|
|
|
1124 | net_value: order.quantity.to_decimal().unwrap_or(Decimal::ZERO)
|
|
| ____________________________^
|
|
1125 | | * order
|
|
1126 | | .price
|
|
1127 | | .map(|p| p.to_decimal().unwrap_or(Decimal::ZERO))
|
|
1128 | | .unwrap_or(Decimal::ZERO),
|
|
| |_________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1132:23
|
|
|
|
|
1132 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1133:26
|
|
|
|
|
1133 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1134:22
|
|
|
|
|
1134 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1134:22
|
|
|
|
|
1134 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1150:9
|
|
|
|
|
1150 | println!("\n\u{1f4be} Memory Allocation Pattern Tests");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1163:5
|
|
|
|
|
1163 | fn benchmark_stack_allocation(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
1163 - fn benchmark_stack_allocation(&mut self) -> Result<(), String> {
|
|
1163 + fn benchmark_stack_allocation(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
1183 - Ok(())
|
|
|
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1168:25
|
|
|
|
|
1168 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: used underscore-prefixed binding
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1172:35
|
|
|
|
|
1172 | std::hint::black_box(&_buffer);
|
|
| ^^^^^^^
|
|
|
|
|
note: binding is defined here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1171:17
|
|
|
|
|
1171 | let _buffer: [u64; 128] = [0; 128];
|
|
| ^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1174:23
|
|
|
|
|
1174 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1175:26
|
|
|
|
|
1175 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1176:22
|
|
|
|
|
1176 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1176:22
|
|
|
|
|
1176 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1186:5
|
|
|
|
|
1186 | fn benchmark_heap_allocation(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
1186 - fn benchmark_heap_allocation(&mut self) -> Result<(), String> {
|
|
1186 + fn benchmark_heap_allocation(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
1206 - Ok(())
|
|
|
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1191:25
|
|
|
|
|
1191 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1198:23
|
|
|
|
|
1198 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1199:26
|
|
|
|
|
1199 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1200:22
|
|
|
|
|
1200 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1200:22
|
|
|
|
|
1200 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1209:5
|
|
|
|
|
1209 | fn benchmark_pool_allocation(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
1209 - fn benchmark_pool_allocation(&mut self) -> Result<(), String> {
|
|
1209 + fn benchmark_pool_allocation(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
1243 - Ok(())
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1214:18
|
|
|
|
|
1214 | for _ in 0..100 {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1214:21
|
|
|
|
|
1214 | for _ in 0..100 {
|
|
| ^^^ help: consider adding suffix: `100_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1222:25
|
|
|
|
|
1222 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1235:23
|
|
|
|
|
1235 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1236:26
|
|
|
|
|
1236 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1237:22
|
|
|
|
|
1237 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1237:22
|
|
|
|
|
1237 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1251:25
|
|
|
|
|
1251 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1256:23
|
|
|
|
|
1256 | let ptr = unsafe { alloc(layout) };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1260:17
|
|
|
|
|
1260 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1266:17
|
|
|
|
|
1266 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1271:23
|
|
|
|
|
1271 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1272:26
|
|
|
|
|
1272 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1273:22
|
|
|
|
|
1273 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1273:22
|
|
|
|
|
1273 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1283:5
|
|
|
|
|
1283 | fn benchmark_zero_copy_operations(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
1283 - fn benchmark_zero_copy_operations(&mut self) -> Result<(), String> {
|
|
1283 + fn benchmark_zero_copy_operations(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
1307 - Ok(())
|
|
|
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1289:25
|
|
|
|
|
1289 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1295:23
|
|
|
|
|
1295 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1296:26
|
|
|
|
|
1296 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1297:22
|
|
|
|
|
1297 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1297:22
|
|
|
|
|
1297 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1310:5
|
|
|
|
|
1310 | fn benchmark_memory_prefetching(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
1310 - fn benchmark_memory_prefetching(&mut self) -> Result<(), String> {
|
|
1310 + fn benchmark_memory_prefetching(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
1340 - Ok(())
|
|
|
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1316:25
|
|
|
|
|
1316 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1319:13
|
|
|
|
|
1319 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1319:13
|
|
|
|
|
1319 | / unsafe {
|
|
1320 | | use std::arch::x86_64::_mm_prefetch;
|
|
1321 | | use std::arch::x86_64::_MM_HINT_T0;
|
|
... |
|
|
1329 | | }
|
|
| |_____________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1325:25
|
|
|
|
|
1325 | _mm_prefetch(data.as_ptr().add(i + 64) as *const i8, _MM_HINT_T0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1325:38
|
|
|
|
|
1325 | _mm_prefetch(data.as_ptr().add(i + 64) as *const i8, _MM_HINT_T0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1324:24
|
|
|
|
|
1324 | if i + 64 < data.len() {
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1325:38
|
|
|
|
|
1325 | _mm_prefetch(data.as_ptr().add(i + 64) as *const i8, _MM_HINT_T0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1325:56
|
|
|
|
|
1325 | _mm_prefetch(data.as_ptr().add(i + 64) as *const i8, _MM_HINT_T0);
|
|
| ^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1327:42
|
|
|
|
|
1327 | std::hint::black_box(data[i]);
|
|
| ^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1331:23
|
|
|
|
|
1331 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1332:26
|
|
|
|
|
1332 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1333:22
|
|
|
|
|
1333 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1333:22
|
|
|
|
|
1333 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1343:5
|
|
|
|
|
1343 | fn benchmark_cache_locality(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
1343 - fn benchmark_cache_locality(&mut self) -> Result<(), String> {
|
|
1343 + fn benchmark_cache_locality(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
1366 - Ok(())
|
|
|
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1349:25
|
|
|
|
|
1349 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1358:23
|
|
|
|
|
1358 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1359:26
|
|
|
|
|
1359 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1360:22
|
|
|
|
|
1360 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/comprehensive_performance_benchmarks.rs:1360:22
|
|
|
|
|
1360 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this could be a `const fn`
|
|
--> trading_engine/src/metrics.rs:35:1
|
|
|
|
|
35 | / fn likely(b: bool) -> bool {
|
|
36 | | b
|
|
37 | | }
|
|
| |_^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
35 | const fn likely(b: bool) -> bool {
|
|
| +++++
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/metrics.rs:45:5
|
|
|
|
|
45 | /// MetricType
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
45 - /// MetricType
|
|
45 + /// `MetricType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/metrics.rs:61:5
|
|
|
|
|
61 | /// LatencyMetric
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
61 - /// LatencyMetric
|
|
61 + /// `LatencyMetric`
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:89:19
|
|
|
|
|
89 | name: name.to_string(),
|
|
| ^^^^^^^^^^^^^^^^ help: try: `name.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/metrics.rs:102:26
|
|
|
|
|
102 | .map(|d| d.as_nanos() as u64)
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:104:19
|
|
|
|
|
104 | name: name.to_string(),
|
|
| ^^^^^^^^^^^^^^^^ help: try: `name.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/metrics.rs:116:26
|
|
|
|
|
116 | .map(|d| d.as_nanos() as u64)
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:118:19
|
|
|
|
|
118 | name: name.to_string(),
|
|
| ^^^^^^^^^^^^^^^^ help: try: `name.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/metrics.rs:130:26
|
|
|
|
|
130 | .map(|d| d.as_nanos() as u64)
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:132:19
|
|
|
|
|
132 | name: name.to_string(),
|
|
| ^^^^^^^^^^^^^^^^ help: try: `name.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:141:21
|
|
|
|
|
141 | self.help = help.to_string();
|
|
| ^^^^^^^^^^^^^^^^ help: try: `help.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: this could be a `const fn`
|
|
--> trading_engine/src/metrics.rs:173:5
|
|
|
|
|
173 | / pub fn new() -> Self {
|
|
174 | | // Initialize buffer with zeros
|
|
175 | | const INIT: CachePadded<AtomicU64> = CachePadded::new(AtomicU64::new(0));
|
|
176 | | let buffer = [INIT; RING_BUFFER_SIZE];
|
|
... |
|
|
185 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
173 | pub const fn new() -> Self {
|
|
| +++++
|
|
|
|
warning: named constant with interior mutability
|
|
--> trading_engine/src/metrics.rs:175:15
|
|
|
|
|
175 | const INIT: CachePadded<AtomicU64> = CachePadded::new(AtomicU64::new(0));
|
|
| ^^^^
|
|
|
|
|
= help: did you mean to make this a `static` item
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
|
|
= note: `-W clippy::declare-interior-mutable-const` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::declare_interior_mutable_const)]`
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/metrics.rs:194:25
|
|
|
|
|
194 | let next_head = (head + 1) & RING_BUFFER_MASK;
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/metrics.rs:200:13
|
|
|
|
|
200 | self.buffer[head].store(value, Ordering::Release);
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/metrics.rs:232:22
|
|
|
|
|
232 | .map(|d| d.as_nanos() as u64)
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/metrics.rs:244:25
|
|
|
|
|
244 | let value = self.buffer[tail].load(Ordering::Acquire);
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/metrics.rs:245:29
|
|
|
|
|
245 | let next_tail = (tail + 1) & RING_BUFFER_MASK;
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/metrics.rs:251:17
|
|
|
|
|
251 | value as f64,
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:253:23
|
|
|
|
|
253 | vec![("source".to_string(), "ring_buffer".to_string())],
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `"source".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:253:45
|
|
|
|
|
253 | vec![("source".to_string(), "ring_buffer".to_string())],
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"ring_buffer".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/metrics.rs:256:13
|
|
|
|
|
256 | drained += 1;
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/metrics.rs:262:36
|
|
|
|
|
262 | let additional_count = (max_count - drained).min(storage.len());
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/metrics.rs:274:13
|
|
|
|
|
274 | head - tail
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/metrics.rs:276:13
|
|
|
|
|
276 | RING_BUFFER_SIZE - tail + head
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/metrics.rs:283:30
|
|
|
|
|
283 | utilization_pct: (used as f64 / RING_BUFFER_SIZE as f64) * 100.0,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/metrics.rs:283:31
|
|
|
|
|
283 | utilization_pct: (used as f64 / RING_BUFFER_SIZE as f64) * 100.0,
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/metrics.rs:283:45
|
|
|
|
|
283 | utilization_pct: (used as f64 / RING_BUFFER_SIZE as f64) * 100.0,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/metrics.rs:290:5
|
|
|
|
|
290 | /// RingBufferStats
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
290 - /// RingBufferStats
|
|
290 + /// `RingBufferStats`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/metrics.rs:306:31
|
|
|
|
|
306 | /// This extends the existing HftLatencyTracker with metrics collection
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
306 - /// This extends the existing HftLatencyTracker with metrics collection
|
|
306 + /// This extends the existing `HftLatencyTracker` with metrics collection
|
|
|
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/metrics.rs:356:17
|
|
|
|
|
356 | latency_ns as f64 / 1_000_000_000.0,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/metrics.rs:356:17
|
|
|
|
|
356 | latency_ns as f64 / 1_000_000_000.0,
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:357:23
|
|
|
|
|
357 | vec![("service".to_string(), "trading".to_string())],
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"service".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:357:46
|
|
|
|
|
357 | vec![("service".to_string(), "trading".to_string())],
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"trading".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/metrics.rs:384:13
|
|
|
|
|
384 | latency_ns as f64 / 1_000_000_000.0,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/metrics.rs:384:13
|
|
|
|
|
384 | latency_ns as f64 / 1_000_000_000.0,
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:386:18
|
|
|
|
|
386 | ("service".to_string(), "trading".to_string()),
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"service".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:386:41
|
|
|
|
|
386 | ("service".to_string(), "trading".to_string()),
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"trading".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:387:18
|
|
|
|
|
387 | ("type".to_string(), "total".to_string()),
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"type".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:387:38
|
|
|
|
|
387 | ("type".to_string(), "total".to_string()),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"total".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/metrics.rs:399:22
|
|
|
|
|
399 | .map(|d| d.as_nanos() as u64)
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:420:23
|
|
|
|
|
420 | name: "trading_order_processing_seconds".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"trading_order_processing_seconds".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/metrics.rs:421:24
|
|
|
|
|
421 | value: stats.order_processing_us / 1_000_000.0,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:423:23
|
|
|
|
|
423 | help: "Order processing latency in seconds".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Order processing latency in seconds".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:424:31
|
|
|
|
|
424 | labels: vec![("service".to_string(), "trading".to_string())],
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"service".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:424:54
|
|
|
|
|
424 | labels: vec![("service".to_string(), "trading".to_string())],
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"trading".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:427:23
|
|
|
|
|
427 | name: "trading_risk_check_seconds".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"trading_risk_check_seconds".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/metrics.rs:428:24
|
|
|
|
|
428 | value: stats.risk_check_us / 1_000_000.0,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:430:23
|
|
|
|
|
430 | help: "Risk check latency in seconds".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Risk check latency in seconds".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:431:31
|
|
|
|
|
431 | labels: vec![("service".to_string(), "trading".to_string())],
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"service".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:431:54
|
|
|
|
|
431 | labels: vec![("service".to_string(), "trading".to_string())],
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"trading".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:434:23
|
|
|
|
|
434 | name: "trading_market_data_seconds".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"trading_market_data_seconds".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/metrics.rs:435:24
|
|
|
|
|
435 | value: stats.market_data_us / 1_000_000.0,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:437:23
|
|
|
|
|
437 | help: "Market data processing latency in seconds".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Market data processing latency in seconds".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:438:31
|
|
|
|
|
438 | labels: vec![("service".to_string(), "trading".to_string())],
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"service".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:438:54
|
|
|
|
|
438 | labels: vec![("service".to_string(), "trading".to_string())],
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"trading".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:441:23
|
|
|
|
|
441 | name: "trading_total_latency_seconds".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"trading_total_latency_seconds".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/metrics.rs:442:24
|
|
|
|
|
442 | value: stats.total_latency_us / 1_000_000.0,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:444:23
|
|
|
|
|
444 | help: "Total trading latency in seconds".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Total trading latency in seconds".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:445:31
|
|
|
|
|
445 | labels: vec![("service".to_string(), "trading".to_string())],
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"service".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:445:54
|
|
|
|
|
445 | labels: vec![("service".to_string(), "trading".to_string())],
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"trading".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:448:23
|
|
|
|
|
448 | name: "trading_measurements_total".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"trading_measurements_total".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/metrics.rs:449:24
|
|
|
|
|
449 | value: stats.measurements_count as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:451:23
|
|
|
|
|
451 | help: "Total number of latency measurements".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Total number of latency measurements".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:452:31
|
|
|
|
|
452 | labels: vec![("service".to_string(), "trading".to_string())],
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"service".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:452:54
|
|
|
|
|
452 | labels: vec![("service".to_string(), "trading".to_string())],
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"trading".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:455:23
|
|
|
|
|
455 | name: "metrics_buffer_utilization_percent".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"metrics_buffer_utilization_percent".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:458:23
|
|
|
|
|
458 | help: "Metrics buffer utilization percentage".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Metrics buffer utilization percentage".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:459:31
|
|
|
|
|
459 | labels: vec![("buffer".to_string(), "ring".to_string())],
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `"buffer".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:459:53
|
|
|
|
|
459 | labels: vec![("buffer".to_string(), "ring".to_string())],
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"ring".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:462:23
|
|
|
|
|
462 | name: "metrics_dropped_total".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"metrics_dropped_total".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/metrics.rs:463:24
|
|
|
|
|
463 | value: buffer_stats.dropped_count as f64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:465:23
|
|
|
|
|
465 | help: "Total number of dropped metrics due to buffer overflow".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Total number of dropped metrics due to buffer overflow".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:466:31
|
|
|
|
|
466 | labels: vec![("buffer".to_string(), "ring".to_string())],
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `"buffer".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/metrics.rs:466:53
|
|
|
|
|
466 | labels: vec![("buffer".to_string(), "ring".to_string())],
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"ring".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/metrics.rs:488:5
|
|
|
|
|
488 | /// EnhancedLatencyStats
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
488 - /// EnhancedLatencyStats
|
|
488 + /// `EnhancedLatencyStats`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/metrics.rs:500:5
|
|
|
|
|
500 | /// PrometheusMetric
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
500 - /// PrometheusMetric
|
|
500 + /// `PrometheusMetric`
|
|
|
|
|
|
|
error: `format!(..)` appended to existing `String`
|
|
--> trading_engine/src/metrics.rs:523:13
|
|
|
|
|
523 | result.push_str(&format!("# HELP {} {}\n", self.name, self.help));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `write!` to avoid the extra allocation
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string
|
|
|
|
error: `format!(..)` appended to existing `String`
|
|
--> trading_engine/src/metrics.rs:533:9
|
|
|
|
|
533 | result.push_str(&format!("# TYPE {} {}\n", self.name, type_str));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `write!` to avoid the extra allocation
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string
|
|
|
|
error: `format!(..)` appended to existing `String`
|
|
--> trading_engine/src/metrics.rs:537:13
|
|
|
|
|
537 | result.push_str(&format!("{} {}\n", self.name, self.value));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `write!` to avoid the extra allocation
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string
|
|
|
|
error: `format!(..)` appended to existing `String`
|
|
--> trading_engine/src/metrics.rs:544:13
|
|
|
|
|
544 | / result.push_str(&format!(
|
|
545 | | "{}{{{}}} {}\n",
|
|
546 | | self.name,
|
|
547 | | labels_str.join(","),
|
|
548 | | self.value
|
|
549 | | ));
|
|
| |______________^
|
|
|
|
|
= help: consider using `write!` to avoid the extra allocation
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/tracing.rs:42:5
|
|
|
|
|
42 | /// FastSpan
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
42 - /// FastSpan
|
|
42 + /// `FastSpan`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/tracing.rs:68:5
|
|
|
|
|
68 | /// SpanStatus
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
68 - /// SpanStatus
|
|
68 + /// `SpanStatus`
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/tracing.rs:93:22
|
|
|
|
|
93 | .map(|d| d.as_nanos() as u64)
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/tracing.rs:100:29
|
|
|
|
|
100 | operation_name: operation_name.to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `operation_name.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/tracing.rs:104:27
|
|
|
|
|
104 | service_name: service_name.to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `service_name.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/tracing.rs:113:22
|
|
|
|
|
113 | .map(|d| d.as_nanos() as u64)
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/tracing.rs:120:29
|
|
|
|
|
120 | operation_name: operation_name.to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `operation_name.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/tracing.rs:132:25
|
|
|
|
|
132 | self.tags.push((key.to_string(), value.to_string()));
|
|
| ^^^^^^^^^^^^^^^ help: try: `key.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/tracing.rs:132:42
|
|
|
|
|
132 | self.tags.push((key.to_string(), value.to_string()));
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `value.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/tracing.rs:140:22
|
|
|
|
|
140 | .map(|d| d.as_nanos() as u64)
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: this could be a `const fn`
|
|
--> trading_engine/src/tracing.rs:152:5
|
|
|
|
|
152 | / pub fn duration_ns(&self) -> u64 {
|
|
153 | | if self.end_time_ns > 0 && self.end_time_ns >= self.start_time_ns {
|
|
154 | | self.end_time_ns - self.start_time_ns
|
|
155 | | } else {
|
|
... |
|
|
158 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
152 | pub const fn duration_ns(&self) -> u64 {
|
|
| +++++
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/tracing.rs:154:13
|
|
|
|
|
154 | self.end_time_ns - self.start_time_ns
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/tracing.rs:162:9
|
|
|
|
|
162 | self.duration_ns() as f64 / 1000.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/tracing.rs:162:9
|
|
|
|
|
162 | self.duration_ns() as f64 / 1000.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: this could be simplified with `bool::then`
|
|
--> trading_engine/src/tracing.rs:170:29
|
|
|
|
|
170 | parent_span_id: if self.parent_id > 0 {
|
|
| _____________________________^
|
|
171 | | Some(format!("{:016x}", self.parent_id))
|
|
172 | | } else {
|
|
... |
|
|
175 | | },
|
|
| |_____________^ help: try: `(self.parent_id > 0).then(|| format!("{:016x}", self.parent_id))`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_some_else_none
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/tracing.rs:185:31
|
|
|
|
|
185 | tag_type: "string".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `"string".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/tracing.rs:198:5
|
|
|
|
|
198 | /// JaegerSpan
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
198 - /// JaegerSpan
|
|
198 + /// `JaegerSpan`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/tracing.rs:226:5
|
|
|
|
|
226 | /// JaegerTag
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
226 - /// JaegerTag
|
|
226 + /// `JaegerTag`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/tracing.rs:240:5
|
|
|
|
|
240 | /// JaegerProcess
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
240 - /// JaegerProcess
|
|
240 + /// `JaegerProcess`
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/tracing.rs:270:27
|
|
|
|
|
270 | service_name: service_name.to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `service_name.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/tracing.rs:323:24
|
|
|
|
|
323 | .fetch_add(spans.len() as u64, Ordering::Relaxed);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/tracing.rs:341:5
|
|
|
|
|
341 | /// TracerStats
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
341 - /// TracerStats
|
|
341 + /// `TracerStats`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/tracing.rs:359:5
|
|
|
|
|
359 | /// SpanContext
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
359 - /// SpanContext
|
|
359 + /// `SpanContext`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/tracing.rs:372:21
|
|
|
|
|
372 | /// Create from FastSpan
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
372 - /// Create from FastSpan
|
|
372 + /// Create from `FastSpan`
|
|
|
|
|
|
|
warning: this could be a `const fn`
|
|
--> trading_engine/src/tracing.rs:373:5
|
|
|
|
|
373 | / pub fn from_span(span: &FastSpan) -> Self {
|
|
374 | | Self {
|
|
375 | | trace_id: span.trace_id,
|
|
376 | | span_id: span.span_id,
|
|
... |
|
|
379 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
373 | pub const fn from_span(span: &FastSpan) -> Self {
|
|
| +++++
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/tracing.rs:394:56
|
|
|
|
|
394 | u128::from_str_radix(parts[0], 16).map_err(|_| anyhow!("Invalid trace ID"))?;
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/tracing.rs:394:34
|
|
|
|
|
394 | u128::from_str_radix(parts[0], 16).map_err(|_| anyhow!("Invalid trace ID"))?;
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/tracing.rs:396:65
|
|
|
|
|
396 | let span_id = u64::from_str_radix(parts[1], 16).map_err(|_| anyhow!("Invalid span ID"))?;
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/tracing.rs:396:43
|
|
|
|
|
396 | let span_id = u64::from_str_radix(parts[1], 16).map_err(|_| anyhow!("Invalid span ID"))?;
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/tracing.rs:398:23
|
|
|
|
|
398 | let sampled = parts[2] == "1";
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: this could be a `const fn`
|
|
--> trading_engine/src/tracing.rs:416:5
|
|
|
|
|
416 | / pub fn new(tracer: &'a FastTracer, span: FastSpan) -> Self {
|
|
417 | | Self { tracer, span }
|
|
418 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
416 | pub const fn new(tracer: &'a FastTracer, span: FastSpan) -> Self {
|
|
| +++++
|
|
|
|
warning: this could be a `const fn`
|
|
--> trading_engine/src/tracing.rs:426:5
|
|
|
|
|
426 | / pub fn span(&self) -> &FastSpan {
|
|
427 | | &self.span
|
|
428 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
426 | pub const fn span(&self) -> &FastSpan {
|
|
| +++++
|
|
|
|
error: used `expect()` on an `Option` value
|
|
--> trading_engine/src/tracing.rs:457:5
|
|
|
|
|
457 | / GLOBAL_TRACER
|
|
458 | | .get()
|
|
459 | | .expect("Global tracer not initialized. Call init_global_tracer() first.")
|
|
| |__________________________________________________________________________________^
|
|
|
|
|
= note: if this value is `None`, it will panic
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_used
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/lib.rs:47:5
|
|
|
|
|
47 | clippy::expect_used,
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/tracing.rs:521:5
|
|
|
|
|
521 | /// SpanExportConfig
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
521 - /// SpanExportConfig
|
|
521 + /// `SpanExportConfig`
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/tracing.rs:538:30
|
|
|
|
|
538 | jaeger_endpoint: "http://localhost:14268/api/traces".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"http://localhost:14268/api/traces".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:20:5
|
|
|
|
|
20 | /// MemoryBenchmarkConfig
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
20 - /// MemoryBenchmarkConfig
|
|
20 + /// `MemoryBenchmarkConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:53:5
|
|
|
|
|
53 | /// MemoryBenchmarkResult
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
53 - /// MemoryBenchmarkResult
|
|
53 + /// `MemoryBenchmarkResult`
|
|
|
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:87:64
|
|
|
|
|
87 | Layout::from_size_align(block_size, 8).map_err(|_| "Invalid block layout")?;
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:89:23
|
|
|
|
|
89 | let ptr = unsafe { alloc(layout) };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:112:23
|
|
|
|
|
112 | let ptr = self.blocks[i].swap(null_mut(), Ordering::AcqRel);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:120:23
|
|
|
|
|
120 | let ptr = self.blocks[i].swap(null_mut(), Ordering::AcqRel);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: `panic` should not be present in production code
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:145:9
|
|
|
|
|
145 | panic!("Failed to return block to pool - pool full or corrupted");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:155:35
|
|
|
|
|
155 | Ok(layout) => unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: you should consider adding a `Default` implementation for `CacheAlignedOrderBuffer`
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:181:5
|
|
|
|
|
181 | / pub fn new() -> Self {
|
|
182 | | // Initialize array without requiring Copy trait
|
|
183 | | let orders = std::array::from_fn(|_| Order::default());
|
|
184 | | Self {
|
|
... |
|
|
189 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
180 + impl Default for CacheAlignedOrderBuffer {
|
|
181 + fn default() -> Self {
|
|
182 + Self::new()
|
|
183 + }
|
|
184 + }
|
|
|
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:193:13
|
|
|
|
|
193 | self.orders[self.count] = order;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:194:13
|
|
|
|
|
194 | self.count += 1;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:236:13
|
|
|
|
|
236 | self.local_pools[node].allocate()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:244:20
|
|
|
|
|
244 | let node = self.current_node.fetch_add(1, Ordering::Relaxed) % self.local_pools.len();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:245:9
|
|
|
|
|
245 | self.local_pools[node].allocate()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:265:9
|
|
|
|
|
265 | println!("\u{1f9e0} Starting Advanced Memory Benchmarks");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:277:9
|
|
|
|
|
277 | println!("\n\u{1f3af} MEMORY BENCHMARK SUMMARY");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:278:9
|
|
|
|
|
278 | println!("============================");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:281:13
|
|
|
|
|
281 | / println!(
|
|
282 | | "\u{2713} {}: {:.1}ns avg, {:.1} MB/s throughput",
|
|
283 | | result.test_name, result.avg_ns, result.throughput_mb_per_sec
|
|
284 | | );
|
|
| |_____________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:328:75
|
|
|
|
|
328 | (allocations_per_sec * self.config.allocation_size as f64) / (1024.0 * 1024.0)
|
|
| ^^^^^^ help: consider adding suffix: `1_024.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:328:84
|
|
|
|
|
328 | (allocations_per_sec * self.config.allocation_size as f64) / (1024.0 * 1024.0)
|
|
| ^^^^^^ help: consider adding suffix: `1_024.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:330:13
|
|
|
|
|
330 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:305:25
|
|
|
|
|
305 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:309:17
|
|
|
|
|
309 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:315:23
|
|
|
|
|
315 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:316:26
|
|
|
|
|
316 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:317:22
|
|
|
|
|
317 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:317:22
|
|
|
|
|
317 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:321:22
|
|
|
|
|
321 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:321:22
|
|
|
|
|
321 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:321:57
|
|
|
|
|
321 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:327:39
|
|
|
|
|
327 | let allocations_per_sec = 1_000_000_000_f64 / avg_ns as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:327:59
|
|
|
|
|
327 | let allocations_per_sec = 1_000_000_000_f64 / avg_ns as f64;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:328:13
|
|
|
|
|
328 | (allocations_per_sec * self.config.allocation_size as f64) / (1024.0 * 1024.0)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:328:36
|
|
|
|
|
328 | (allocations_per_sec * self.config.allocation_size as f64) / (1024.0 * 1024.0)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:348:40
|
|
|
|
|
348 | NumaAwareAllocator::new(2, self.config.pool_size / 2, self.config.allocation_size)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:355:25
|
|
|
|
|
355 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:362:23
|
|
|
|
|
362 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:363:26
|
|
|
|
|
363 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:364:22
|
|
|
|
|
364 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:364:22
|
|
|
|
|
364 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:368:22
|
|
|
|
|
368 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:368:22
|
|
|
|
|
368 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:368:57
|
|
|
|
|
368 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: used unwrap or expect in a function that returns result or option
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:385:5
|
|
|
|
|
385 | / fn benchmark_cache_aligned_structures(&mut self) -> Result<(), String> {
|
|
386 | | let mut buffer = CacheAlignedOrderBuffer::new();
|
|
387 | | let mut measurements = Vec::new();
|
|
... |
|
|
437 | | Ok(())
|
|
438 | | }
|
|
| |_____^
|
|
|
|
|
= help: unwrap and expect should not be used in a function that returns result or option
|
|
note: potential non-recoverable error(s)
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:393:32
|
|
|
|
|
393 | let quantity = Quantity::from_f64(100.0)
|
|
| ________________________________^
|
|
394 | | .map_err(|e| format!("Failed to create test quantity: {}", e))
|
|
395 | | .unwrap();
|
|
| |_____________________________^
|
|
396 | let price = Price::from_f64(500.0).unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_in_result
|
|
= note: requested on the command line with `-D clippy::unwrap-in-result`
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:385:5
|
|
|
|
|
385 | fn benchmark_cache_aligned_structures(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
385 - fn benchmark_cache_aligned_structures(&mut self) -> Result<(), String> {
|
|
385 + fn benchmark_cache_aligned_structures(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
437 - Ok(())
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:390:40
|
|
|
|
|
390 | let test_orders: Vec<Order> = (0..64)
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:390:43
|
|
|
|
|
390 | let test_orders: Vec<Order> = (0..64)
|
|
| ^^ help: consider adding suffix: `64_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: used `unwrap()` on a `Result` value
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:393:32
|
|
|
|
|
393 | let quantity = Quantity::from_f64(100.0)
|
|
| ________________________________^
|
|
394 | | .map_err(|e| format!("Failed to create test quantity: {}", e))
|
|
395 | | .unwrap();
|
|
| |_____________________________^
|
|
|
|
|
= note: if this value is an `Err`, it will panic
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/lib.rs:46:5
|
|
|
|
|
46 | clippy::unwrap_used,
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap()` on a `Result` value
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:396:29
|
|
|
|
|
396 | let price = Price::from_f64(500.0).unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: if this value is an `Err`, it will panic
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:403:25
|
|
|
|
|
403 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:414:39
|
|
|
|
|
414 | std::hint::black_box(&buffer.orders[i]);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:417:23
|
|
|
|
|
417 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:418:26
|
|
|
|
|
418 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:419:22
|
|
|
|
|
419 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:419:22
|
|
|
|
|
419 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:423:22
|
|
|
|
|
423 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:423:22
|
|
|
|
|
423 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:423:57
|
|
|
|
|
423 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:440:5
|
|
|
|
|
440 | fn benchmark_memory_prefetching_patterns(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
440 - fn benchmark_memory_prefetching_patterns(&mut self) -> Result<(), String> {
|
|
440 + fn benchmark_memory_prefetching_patterns(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
496 - Ok(())
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:479:58
|
|
|
|
|
479 | let data_size_mb = (data_size * 8) as f64 / (1024.0 * 1024.0);
|
|
| ^^^^^^ help: consider adding suffix: `1_024.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:479:67
|
|
|
|
|
479 | let data_size_mb = (data_size * 8) as f64 / (1024.0 * 1024.0);
|
|
| ^^^^^^ help: consider adding suffix: `1_024.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:483:13
|
|
|
|
|
483 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:447:25
|
|
|
|
|
447 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:450:13
|
|
|
|
|
450 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: this `unsafe` block contains 2 unsafe operations, expected only one
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:450:13
|
|
|
|
|
450 | / unsafe {
|
|
451 | | use std::arch::x86_64::{_mm_prefetch, _MM_HINT_T0};
|
|
452 | |
|
|
453 | | for i in 0..data.len() {
|
|
... |
|
|
464 | | }
|
|
| |_____________^
|
|
|
|
|
note: unsafe function call occurs here
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:456:25
|
|
|
|
|
456 | / _mm_prefetch(
|
|
457 | | data.as_ptr().add(i + self.config.prefetch_distance) as *const i8,
|
|
458 | | _MM_HINT_T0,
|
|
459 | | );
|
|
| |_________________________^
|
|
note: unsafe method call occurs here
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:457:29
|
|
|
|
|
457 | ... data.as_ptr().add(i + self.config.prefetch_distance) as *const i8,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:455:24
|
|
|
|
|
455 | if i + self.config.prefetch_distance < data.len() {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:457:29
|
|
|
|
|
457 | ... data.as_ptr().add(i + self.config.prefetch_distance) as *const i8,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:457:47
|
|
|
|
|
457 | ... data.as_ptr().add(i + self.config.prefetch_distance) as *const i8,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:462:44
|
|
|
|
|
462 | sum = sum.wrapping_add(data[i]);
|
|
| ^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:467:23
|
|
|
|
|
467 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:468:26
|
|
|
|
|
468 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:469:22
|
|
|
|
|
469 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:469:22
|
|
|
|
|
469 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:473:22
|
|
|
|
|
473 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:473:22
|
|
|
|
|
473 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:473:57
|
|
|
|
|
473 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:479:32
|
|
|
|
|
479 | let data_size_mb = (data_size * 8) as f64 / (1024.0 * 1024.0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:479:32
|
|
|
|
|
479 | let data_size_mb = (data_size * 8) as f64 / (1024.0 * 1024.0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:480:31
|
|
|
|
|
480 | let ops_per_sec = 1_000_000_000_f64 / avg_ns as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:480:51
|
|
|
|
|
480 | let ops_per_sec = 1_000_000_000_f64 / avg_ns as f64;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:481:13
|
|
|
|
|
481 | data_size_mb * ops_per_sec
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:499:5
|
|
|
|
|
499 | fn benchmark_zero_copy_processing(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
499 - fn benchmark_zero_copy_processing(&mut self) -> Result<(), String> {
|
|
499 + fn benchmark_zero_copy_processing(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
545 - Ok(())
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:528:33
|
|
|
|
|
528 | let data_size_mb = (10000 * 8) as f64 / (1024.0 * 1024.0);
|
|
| ^^^^^ help: consider adding suffix: `10_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:528:41
|
|
|
|
|
528 | let data_size_mb = (10000 * 8) as f64 / (1024.0 * 1024.0);
|
|
| ^ help: consider adding suffix: `8_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:528:54
|
|
|
|
|
528 | let data_size_mb = (10000 * 8) as f64 / (1024.0 * 1024.0);
|
|
| ^^^^^^ help: consider adding suffix: `1_024.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:528:63
|
|
|
|
|
528 | let data_size_mb = (10000 * 8) as f64 / (1024.0 * 1024.0);
|
|
| ^^^^^^ help: consider adding suffix: `1_024.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:532:13
|
|
|
|
|
532 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:505:25
|
|
|
|
|
505 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
error: slicing may panic
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:508:27
|
|
|
|
|
508 | let slice1 = &data[0..5000];
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: slicing may panic
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:509:27
|
|
|
|
|
509 | let slice2 = &data[5000..10000];
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:517:23
|
|
|
|
|
517 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:518:26
|
|
|
|
|
518 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:519:22
|
|
|
|
|
519 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:519:22
|
|
|
|
|
519 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:523:22
|
|
|
|
|
523 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:523:22
|
|
|
|
|
523 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:523:57
|
|
|
|
|
523 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:528:32
|
|
|
|
|
528 | let data_size_mb = (10000 * 8) as f64 / (1024.0 * 1024.0);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:528:32
|
|
|
|
|
528 | let data_size_mb = (10000 * 8) as f64 / (1024.0 * 1024.0);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:529:31
|
|
|
|
|
529 | let ops_per_sec = 1_000_000_000_f64 / avg_ns as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:529:51
|
|
|
|
|
529 | let ops_per_sec = 1_000_000_000_f64 / avg_ns as f64;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:530:13
|
|
|
|
|
530 | data_size_mb * ops_per_sec
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:548:5
|
|
|
|
|
548 | fn benchmark_memory_bandwidth_utilization(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
548 - fn benchmark_memory_bandwidth_utilization(&mut self) -> Result<(), String> {
|
|
548 + fn benchmark_memory_bandwidth_utilization(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
594 - Ok(())
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:579:45
|
|
|
|
|
579 | (bytes_per_op * ops_per_sec) / (1024.0 * 1024.0)
|
|
| ^^^^^^ help: consider adding suffix: `1_024.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:579:54
|
|
|
|
|
579 | (bytes_per_op * ops_per_sec) / (1024.0 * 1024.0)
|
|
| ^^^^^^ help: consider adding suffix: `1_024.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:581:13
|
|
|
|
|
581 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:555:21
|
|
|
|
|
555 | for _ in 0..(self.config.iterations / 10) {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:557:25
|
|
|
|
|
557 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:563:25
|
|
|
|
|
563 | source[0] = source[0].wrapping_add(1);
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:563:13
|
|
|
|
|
563 | source[0] = source[0].wrapping_add(1);
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:565:23
|
|
|
|
|
565 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:566:26
|
|
|
|
|
566 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:567:22
|
|
|
|
|
567 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:567:22
|
|
|
|
|
567 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:571:22
|
|
|
|
|
571 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:571:22
|
|
|
|
|
571 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:571:57
|
|
|
|
|
571 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:577:32
|
|
|
|
|
577 | let bytes_per_op = buffer_size as f64;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:578:31
|
|
|
|
|
578 | let ops_per_sec = 1_000_000_000_f64 / avg_ns as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:578:51
|
|
|
|
|
578 | let ops_per_sec = 1_000_000_000_f64 / avg_ns as f64;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:579:13
|
|
|
|
|
579 | (bytes_per_op * ops_per_sec) / (1024.0 * 1024.0)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:597:5
|
|
|
|
|
597 | fn benchmark_tlb_efficiency(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
597 - fn benchmark_tlb_efficiency(&mut self) -> Result<(), String> {
|
|
597 + fn benchmark_tlb_efficiency(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
641 - Ok(())
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:607:35
|
|
|
|
|
607 | data[i * page_size] = i as u8;
|
|
| ^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:607:13
|
|
|
|
|
607 | data[i * page_size] = i as u8;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:607:18
|
|
|
|
|
607 | data[i * page_size] = i as u8;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:612:25
|
|
|
|
|
612 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:617:40
|
|
|
|
|
617 | sum = sum.wrapping_add(data[i * page_size] as u64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:617:40
|
|
|
|
|
617 | sum = sum.wrapping_add(data[i * page_size] as u64);
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:617:45
|
|
|
|
|
617 | sum = sum.wrapping_add(data[i * page_size] as u64);
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:621:23
|
|
|
|
|
621 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:622:26
|
|
|
|
|
622 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:623:22
|
|
|
|
|
623 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:623:22
|
|
|
|
|
623 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:627:22
|
|
|
|
|
627 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:627:22
|
|
|
|
|
627 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:627:57
|
|
|
|
|
627 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: used unwrap or expect in a function that returns result or option
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:644:5
|
|
|
|
|
644 | / fn benchmark_memory_fragmentation_patterns(&mut self) -> Result<(), String> {
|
|
645 | | // Simulate fragmentation by allocating and deallocating in patterns
|
|
646 | | let mut allocations = Vec::new();
|
|
647 | | let mut measurements = Vec::new();
|
|
... |
|
|
714 | | Ok(())
|
|
715 | | }
|
|
| |_____^
|
|
|
|
|
= help: unwrap and expect should not be used in a function that returns result or option
|
|
note: potential non-recoverable error(s)
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:655:30
|
|
|
|
|
655 | let layout = Layout::from_size_align(64, 8).unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_in_result
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:644:5
|
|
|
|
|
644 | fn benchmark_memory_fragmentation_patterns(&mut self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
644 - fn benchmark_memory_fragmentation_patterns(&mut self) -> Result<(), String> {
|
|
644 + fn benchmark_memory_fragmentation_patterns(&mut self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
714 - Ok(())
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:654:22
|
|
|
|
|
654 | for _ in 0..8 {
|
|
| ^ help: consider adding suffix: `0_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:654:25
|
|
|
|
|
654 | for _ in 0..8 {
|
|
| ^ help: consider adding suffix: `8_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:651:25
|
|
|
|
|
651 | let start = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
error: used `unwrap()` on a `Result` value
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:655:30
|
|
|
|
|
655 | let layout = Layout::from_size_align(64, 8).unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: if this value is an `Err`, it will panic
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:656:27
|
|
|
|
|
656 | let ptr = unsafe { System.alloc(layout) };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:666:21
|
|
|
|
|
666 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:678:23
|
|
|
|
|
678 | let end = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:679:26
|
|
|
|
|
679 | let cycles = end - start;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:680:22
|
|
|
|
|
680 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:680:22
|
|
|
|
|
680 | let ns = (cycles * 1_000_000_000) / 3_000_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:686:21
|
|
|
|
|
686 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:695:13
|
|
|
|
|
695 | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:700:22
|
|
|
|
|
700 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:700:22
|
|
|
|
|
700 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/advanced_memory_benchmarks.rs:700:57
|
|
|
|
|
700 | let avg_ns = measurements.iter().sum::<u64>() / measurements.len() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/test_runner.rs:18:5
|
|
|
|
|
18 | /// TestRunnerConfig
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
18 - /// TestRunnerConfig
|
|
18 + /// `TestRunnerConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/test_runner.rs:51:5
|
|
|
|
|
51 | /// TestSuiteResults
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
51 - /// TestSuiteResults
|
|
51 + /// `TestSuiteResults`
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/test_runner.rs:92:52
|
|
|
|
|
92 | self.config.target_latency_ns as f64 / 1000.0
|
|
| ^^^^^^ help: consider adding suffix: `1_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:87:9
|
|
|
|
|
87 | println!("\u{1f680} FOXHUNT HFT PERFORMANCE VALIDATION SUITE");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:88:9
|
|
|
|
|
88 | println!("=============================================");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:89:9
|
|
|
|
|
89 | / println!(
|
|
90 | | "Target Latency: {}ns ({:.1}\u{3bc}s)",
|
|
91 | | self.config.target_latency_ns,
|
|
92 | | self.config.target_latency_ns as f64 / 1000.0
|
|
93 | | );
|
|
| |_________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/test_runner.rs:92:13
|
|
|
|
|
92 | self.config.target_latency_ns as f64 / 1000.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/test_runner.rs:92:13
|
|
|
|
|
92 | self.config.target_latency_ns as f64 / 1000.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:94:9
|
|
|
|
|
94 | println!("Iterations per test: {}", self.config.iterations);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:95:9
|
|
|
|
|
95 | println!();
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: this function's return value is unnecessary
|
|
--> trading_engine/src/test_runner.rs:141:5
|
|
|
|
|
141 | fn initialize_timing_subsystem(&self) -> Result<(), String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove the return type...
|
|
|
|
|
141 - fn initialize_timing_subsystem(&self) -> Result<(), String> {
|
|
141 + fn initialize_timing_subsystem(&self) -> () {
|
|
|
|
|
help: ...and then remove returned values
|
|
|
|
|
175 - Ok(())
|
|
|
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:142:9
|
|
|
|
|
142 | println!("\u{23f1}\u{fe0f} Initializing High-Precision Timing Subsystem");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:147:17
|
|
|
|
|
147 | println!("\u{2713} TSC calibrated: {} Hz", frequency);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:149:21
|
|
|
|
|
149 | println!("\u{2713} TSC reliability confirmed");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:151:21
|
|
|
|
|
151 | println!("\u{26a0}\u{fe0f} TSC reliability concerns detected");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:155:17
|
|
|
|
|
155 | println!("\u{26a0}\u{fe0f} TSC calibration failed: {}", e);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:156:17
|
|
|
|
|
156 | println!(" Using system clock fallback");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:164:17
|
|
|
|
|
164 | println!("\u{2713} AVX2 SIMD support detected");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:166:17
|
|
|
|
|
166 | println!("\u{26a0}\u{fe0f} AVX2 not available - using scalar fallback");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:170:17
|
|
|
|
|
170 | println!("\u{2713} AVX-512 support detected");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:174:9
|
|
|
|
|
174 | println!();
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:180:9
|
|
|
|
|
180 | println!("\u{1f4ca} Running Comprehensive Performance Benchmarks (25+ tests)");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/test_runner.rs:185:32
|
|
|
|
|
185 | warmup_iterations: self.config.iterations / 10,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/test_runner.rs:196:24
|
|
|
|
|
196 | let duration = start.elapsed().as_millis() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:212:9
|
|
|
|
|
212 | / println!(
|
|
213 | | "\u{2713} Comprehensive benchmarks completed in {}ms",
|
|
214 | | duration
|
|
215 | | );
|
|
| |_________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:229:9
|
|
|
|
|
229 | println!("\u{1f4be} Running Advanced Memory Benchmarks (8+ tests)");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/test_runner.rs:235:32
|
|
|
|
|
235 | warmup_iterations: self.config.iterations / 10,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/test_runner.rs:245:24
|
|
|
|
|
245 | let duration = start.elapsed().as_millis() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:247:9
|
|
|
|
|
247 | println!("\u{2713} Memory benchmarks completed in {}ms", duration);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:253:9
|
|
|
|
|
253 | println!("\u{1f525} Running Stress Tests");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/test_runner.rs:270:24
|
|
|
|
|
270 | let duration = start.elapsed().as_millis() as u64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:272:9
|
|
|
|
|
272 | println!("\u{2713} Stress tests completed in {}ms", duration);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
error: `counter` is shadowed
|
|
--> trading_engine/src/test_runner.rs:290:21
|
|
|
|
|
290 | let counter = Arc::clone(&counter);
|
|
| ^^^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/test_runner.rs:284:13
|
|
|
|
|
284 | let counter = Arc::new(AtomicU64::new(0));
|
|
| ^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_reuse
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/test_runner.rs:302:35
|
|
|
|
|
302 | handle.join().map_err(|_| "Thread join failed")?;
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/test_runner.rs:306:29
|
|
|
|
|
306 | let avg_ns_per_op = duration.as_nanos() as u64 / (iterations * num_threads);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/test_runner.rs:306:29
|
|
|
|
|
306 | let avg_ns_per_op = duration.as_nanos() as u64 / (iterations * num_threads);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/test_runner.rs:306:29
|
|
|
|
|
306 | let avg_ns_per_op = duration.as_nanos() as u64 / (iterations * num_threads);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:308:9
|
|
|
|
|
308 | println!(" Multithreaded stress: {}ns per operation", avg_ns_per_op);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> trading_engine/src/test_runner.rs:314:5
|
|
|
|
|
314 | fn run_sustained_load_test(&self) -> Result<u64, String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
314 - fn run_sustained_load_test(&self) -> Result<u64, String> {
|
|
314 + fn run_sustained_load_test(&self) -> u64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
345 - Ok(avg_ns)
|
|
345 + avg_ns
|
|
|
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/test_runner.rs:323:32
|
|
|
|
|
323 | let start_cycles = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: unsafe block missing a safety comment
|
|
--> trading_engine/src/test_runner.rs:328:30
|
|
|
|
|
328 | let end_cycles = unsafe { _rdtsc() };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/test_runner.rs:329:13
|
|
|
|
|
329 | total_cycles += end_cycles - start_cycles;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/test_runner.rs:330:13
|
|
|
|
|
330 | operation_count += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/test_runner.rs:334:13
|
|
|
|
|
334 | total_cycles / operation_count
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/test_runner.rs:334:13
|
|
|
|
|
334 | total_cycles / operation_count
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/test_runner.rs:338:22
|
|
|
|
|
338 | let avg_ns = (avg_cycles * 1_000_000_000) / 3_000_000_000; // Assume 3GHz CPU
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/test_runner.rs:338:22
|
|
|
|
|
338 | let avg_ns = (avg_cycles * 1_000_000_000) / 3_000_000_000; // Assume 3GHz CPU
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:340:9
|
|
|
|
|
340 | / println!(
|
|
341 | | " Sustained load: {} operations, {}ns avg",
|
|
342 | | operation_count, avg_ns
|
|
343 | | );
|
|
| |_________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> trading_engine/src/test_runner.rs:349:5
|
|
|
|
|
349 | fn run_memory_pressure_test(&self) -> Result<u64, String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
349 - fn run_memory_pressure_test(&self) -> Result<u64, String> {
|
|
349 + fn run_memory_pressure_test(&self) -> u64 {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
375 - Ok(avg_ns_per_alloc)
|
|
375 + avg_ns_per_alloc
|
|
|
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/test_runner.rs:364:29
|
|
|
|
|
364 | allocation[0] = allocation[0].wrapping_add(1);
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/test_runner.rs:364:13
|
|
|
|
|
364 | allocation[0] = allocation[0].wrapping_add(1);
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/test_runner.rs:368:32
|
|
|
|
|
368 | let avg_ns_per_alloc = duration.as_nanos() as u64 / num_allocations;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/test_runner.rs:368:32
|
|
|
|
|
368 | let avg_ns_per_alloc = duration.as_nanos() as u64 / num_allocations;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:370:9
|
|
|
|
|
370 | / println!(
|
|
371 | | " Memory pressure: {}ns per 1KB allocation",
|
|
372 | | avg_ns_per_alloc
|
|
373 | | );
|
|
| |_________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> trading_engine/src/test_runner.rs:379:5
|
|
|
|
|
379 | / fn generate_test_summary(
|
|
380 | | &self,
|
|
381 | | results: &[String],
|
|
382 | | _timings: &[(String, u64)],
|
|
383 | | total_duration: std::time::Duration,
|
|
384 | | ) -> Result<TestSuiteResults, String> {
|
|
| |_________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
384 - ) -> Result<TestSuiteResults, String> {
|
|
384 + ) -> test_runner::TestSuiteResults {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
426 ~ TestSuiteResults {
|
|
427 + total_tests,
|
|
428 + passed_tests: passed,
|
|
429 + failed_tests: failed,
|
|
430 + total_duration_ms: total_duration.as_millis() as u64,
|
|
431 + overall_success_rate: success_rate,
|
|
432 + fastest_test,
|
|
433 + slowest_test,
|
|
434 + performance_summary,
|
|
435 + }
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/test_runner.rs:418:13
|
|
|
|
|
418 | 0.0
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/test_runner.rs:395:20
|
|
|
|
|
395 | if parts[2] == "PASS" {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/test_runner.rs:396:21
|
|
|
|
|
396 | passed += 1;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/test_runner.rs:398:21
|
|
|
|
|
398 | failed += 1;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/test_runner.rs:401:33
|
|
|
|
|
401 | if let Ok(ns) = parts[1].parse::<u64>() {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/test_runner.rs:404:45
|
|
|
|
|
404 | fastest_test = Some(parts[0].to_owned());
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/test_runner.rs:408:45
|
|
|
|
|
408 | slowest_test = Some(parts[0].to_owned());
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/test_runner.rs:414:27
|
|
|
|
|
414 | let total_tests = passed + failed;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/test_runner.rs:416:13
|
|
|
|
|
416 | passed as f64 / total_tests as f64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/test_runner.rs:416:13
|
|
|
|
|
416 | passed as f64 / total_tests as f64
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/test_runner.rs:416:29
|
|
|
|
|
416 | passed as f64 / total_tests as f64
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/test_runner.rs:430:32
|
|
|
|
|
430 | total_duration_ms: total_duration.as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/test_runner.rs:446:44
|
|
|
|
|
446 | summary.overall_success_rate * 100.0
|
|
| ^^^^^ help: consider adding suffix: `100.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/test_runner.rs:452:44
|
|
|
|
|
452 | summary.overall_success_rate * 100.0
|
|
| ^^^^^ help: consider adding suffix: `100.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/test_runner.rs:466:44
|
|
|
|
|
466 | if summary.overall_success_rate >= 0.9 {
|
|
| ^^^ help: consider adding suffix: `0.9_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/test_runner.rs:468:51
|
|
|
|
|
468 | } else if summary.overall_success_rate >= 0.8 {
|
|
| ^^^ help: consider adding suffix: `0.8_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/test_runner.rs:470:51
|
|
|
|
|
470 | } else if summary.overall_success_rate >= 0.7 {
|
|
| ^^^ help: consider adding suffix: `0.7_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:440:9
|
|
|
|
|
440 | println!("\n\u{1f3af} PERFORMANCE VALIDATION SUMMARY");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:441:9
|
|
|
|
|
441 | println!("=================================");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:442:9
|
|
|
|
|
442 | println!("Total Tests: {}", summary.total_tests);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:443:9
|
|
|
|
|
443 | / println!(
|
|
444 | | "Passed: {} ({:.1}%)",
|
|
445 | | summary.passed_tests,
|
|
446 | | summary.overall_success_rate * 100.0
|
|
447 | | );
|
|
| |_________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/test_runner.rs:446:13
|
|
|
|
|
446 | summary.overall_success_rate * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:448:9
|
|
|
|
|
448 | println!("Failed: {}", summary.failed_tests);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:449:9
|
|
|
|
|
449 | println!("Test Duration: {}ms", summary.total_duration_ms);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:450:9
|
|
|
|
|
450 | / println!(
|
|
451 | | "Success Rate: {:.1}%",
|
|
452 | | summary.overall_success_rate * 100.0
|
|
453 | | );
|
|
| |_________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/test_runner.rs:452:13
|
|
|
|
|
452 | summary.overall_success_rate * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:454:9
|
|
|
|
|
454 | println!();
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:457:13
|
|
|
|
|
457 | println!("Fastest Test: {}", fastest);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:460:13
|
|
|
|
|
460 | println!("Slowest Test: {}", slowest);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:462:9
|
|
|
|
|
462 | println!("Performance: {}", summary.performance_summary);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:463:9
|
|
|
|
|
463 | println!();
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:467:13
|
|
|
|
|
467 | println!("\u{1f389} EXCELLENT: System performance exceeds HFT requirements!");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:469:13
|
|
|
|
|
469 | println!("\u{2705} GOOD: System performance meets HFT requirements");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:471:13
|
|
|
|
|
471 | println!("\u{26a0}\u{fe0f} MARGINAL: Some performance issues detected");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:473:13
|
|
|
|
|
473 | println!("\u{274c} POOR: System performance below HFT requirements");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:576:5
|
|
|
|
|
576 | println!("\u{1f52c} FOXHUNT HFT PERFORMANCE BENCHMARK DEMONSTRATION");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:577:5
|
|
|
|
|
577 | println!("==================================================");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:580:5
|
|
|
|
|
580 | println!("\n1. Running Quick Validation (10K iterations)...");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:583:13
|
|
|
|
|
583 | / println!(
|
|
584 | | " \u{2713} Quick validation completed: {}/{} tests passed",
|
|
585 | | summary.passed_tests, summary.total_tests
|
|
586 | | );
|
|
| |_____________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:588:19
|
|
|
|
|
588 | Err(e) => println!(" \u{274c} Quick validation failed: {}", e),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:592:5
|
|
|
|
|
592 | println!("\n2. Running Comprehensive Validation (50K iterations)...");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:595:13
|
|
|
|
|
595 | / println!(
|
|
596 | | " \u{2713} Comprehensive validation completed: {}/{} tests passed",
|
|
597 | | summary.passed_tests, summary.total_tests
|
|
598 | | );
|
|
| |_____________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:599:13
|
|
|
|
|
599 | println!(" Performance: {}", summary.performance_summary);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:601:19
|
|
|
|
|
601 | Err(e) => println!(" \u{274c} Comprehensive validation failed: {}", e),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:604:5
|
|
|
|
|
604 | println!("\n\u{1f3af} Performance benchmark demonstration completed!");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:605:5
|
|
|
|
|
605 | println!(" Total benchmark categories: 5");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:606:5
|
|
|
|
|
606 | println!(" - SIMD operations (5 tests)");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:607:5
|
|
|
|
|
607 | println!(" - Lock-free structures (5 tests)");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:608:5
|
|
|
|
|
608 | println!(" - RDTSC timing accuracy (5 tests)");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:609:5
|
|
|
|
|
609 | println!(" - Order processing latency (5 tests)");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:610:5
|
|
|
|
|
610 | println!(" - Memory allocation patterns (7+ tests)");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/test_runner.rs:611:5
|
|
|
|
|
611 | println!(" Total: 27+ individual performance tests");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:25:5
|
|
|
|
|
25 | /// AuditTrailEngine
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
25 - /// AuditTrailEngine
|
|
25 + /// `AuditTrailEngine`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:39:5
|
|
|
|
|
39 | /// AuditTrailConfig
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
39 - /// AuditTrailConfig
|
|
39 + /// `AuditTrailConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:65:5
|
|
|
|
|
65 | /// StorageBackendConfig
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
65 - /// StorageBackendConfig
|
|
65 + /// `StorageBackendConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:83:5
|
|
|
|
|
83 | /// StorageType
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
83 - /// StorageType
|
|
83 + /// `StorageType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:99:5
|
|
|
|
|
99 | /// PartitioningStrategy
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
99 - /// PartitioningStrategy
|
|
99 + /// `PartitioningStrategy`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:115:5
|
|
|
|
|
115 | /// ComplianceRequirements
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
115 - /// ComplianceRequirements
|
|
115 + /// `ComplianceRequirements`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:133:5
|
|
|
|
|
133 | /// TransactionAuditEvent
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
133 - /// TransactionAuditEvent
|
|
133 + /// `TransactionAuditEvent`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:173:5
|
|
|
|
|
173 | /// AuditEventType
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
173 - /// AuditEventType
|
|
173 + /// `AuditEventType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:207:5
|
|
|
|
|
207 | /// AuditEventDetails
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
207 - /// AuditEventDetails
|
|
207 + /// `AuditEventDetails`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:235:5
|
|
|
|
|
235 | /// PerformanceMetrics
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
235 - /// PerformanceMetrics
|
|
235 + /// `PerformanceMetrics`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:251:5
|
|
|
|
|
251 | /// RiskLevel
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
251 - /// RiskLevel
|
|
251 + /// `RiskLevel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:267:5
|
|
|
|
|
267 | /// LockFreeEventBuffer
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
267 - /// LockFreeEventBuffer
|
|
267 + /// `LockFreeEventBuffer`
|
|
|
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/compliance/audit_trails.rs:317:22
|
|
|
|
|
317 | .map_err(|_| AuditTrailError::BufferFull)?;
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:326:30
|
|
|
|
|
326 | /// 2. Batches writes to PostgreSQL
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
326 - /// 2. Batches writes to PostgreSQL
|
|
326 + /// 2. Batches writes to `PostgreSQL`
|
|
|
|
|
|
|
warning: the function has a cognitive complexity of (42/30)
|
|
--> trading_engine/src/compliance/audit_trails.rs:358:14
|
|
|
|
|
358 | async fn background_flush_worker(
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cognitive_complexity
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:435:24
|
|
|
|
|
435 | /// Flush batch to PostgreSQL and clear from WAL
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
435 - /// Flush batch to PostgreSQL and clear from WAL
|
|
435 + /// Flush batch to `PostgreSQL` and clear from WAL
|
|
|
|
|
|
|
warning: the borrowed expression implements the required traits
|
|
--> trading_engine/src/compliance/audit_trails.rs:467:19
|
|
|
|
|
467 | .bind(&event.timestamp)
|
|
| ^^^^^^^^^^^^^^^^ help: change this to: `event.timestamp`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/audit_trails.rs:468:19
|
|
|
|
|
468 | .bind(event.timestamp_nanos as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/audit_trails.rs:495:36
|
|
|
|
|
495 | persisted_events.fetch_add(batch.len() as u64, std::sync::atomic::Ordering::Relaxed);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: `line` is shadowed
|
|
--> trading_engine/src/compliance/audit_trails.rs:519:17
|
|
|
|
|
519 | let line = line.map_err(|e| AuditTrailError::Persistence(format!("Failed to read WAL line: {}", e)))?;
|
|
| ^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> trading_engine/src/compliance/audit_trails.rs:518:13
|
|
|
|
|
518 | for line in reader.lines() {
|
|
| ^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_reuse
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:583:5
|
|
|
|
|
583 | /// PersistenceEngine
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
583 - /// PersistenceEngine
|
|
583 + /// `PersistenceEngine`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:601:5
|
|
|
|
|
601 | /// BatchProcessor
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
601 - /// BatchProcessor
|
|
601 + /// `BatchProcessor`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:614:5
|
|
|
|
|
614 | /// CompressionEngine
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
614 - /// CompressionEngine
|
|
614 + /// `CompressionEngine`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:624:5
|
|
|
|
|
624 | /// CompressionAlgorithm
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
624 - /// CompressionAlgorithm
|
|
624 + /// `CompressionAlgorithm`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:640:5
|
|
|
|
|
640 | /// EncryptionEngine
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
640 - /// EncryptionEngine
|
|
640 + /// `EncryptionEngine`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:650:5
|
|
|
|
|
650 | /// EncryptionAlgorithm
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
650 - /// EncryptionAlgorithm
|
|
650 + /// `EncryptionAlgorithm`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:664:5
|
|
|
|
|
664 | /// RetentionManager
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
664 - /// RetentionManager
|
|
664 + /// `RetentionManager`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:676:5
|
|
|
|
|
676 | /// ArchiveScheduler
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
676 - /// ArchiveScheduler
|
|
676 + /// `ArchiveScheduler`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:689:5
|
|
|
|
|
689 | /// QueryEngine
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
689 - /// QueryEngine
|
|
689 + /// `QueryEngine`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:702:5
|
|
|
|
|
702 | /// IndexManager
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
702 - /// IndexManager
|
|
702 + /// `IndexManager`
|
|
|
|
|
|
|
error: found empty brackets on struct declaration
|
|
--> trading_engine/src/compliance/audit_trails.rs:705:24
|
|
|
|
|
705 | pub struct IndexManager {}
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_structs_with_brackets
|
|
= help: remove the brackets
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:709:5
|
|
|
|
|
709 | /// IndexDefinition
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
709 - /// IndexDefinition
|
|
709 + /// `IndexDefinition`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:723:5
|
|
|
|
|
723 | /// IndexType
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
723 - /// IndexType
|
|
723 + /// `IndexType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:741:5
|
|
|
|
|
741 | /// QueryCache
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
741 - /// QueryCache
|
|
741 + /// `QueryCache`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:752:5
|
|
|
|
|
752 | /// CachedQuery
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
752 - /// CachedQuery
|
|
752 + /// `CachedQuery`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:766:5
|
|
|
|
|
766 | /// AuditTrailQuery
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
766 - /// AuditTrailQuery
|
|
766 + /// `AuditTrailQuery`
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/audit_trails.rs:801:25
|
|
|
|
|
801 | start_time: chrono::Utc::now() - chrono::Duration::hours(24),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:820:5
|
|
|
|
|
820 | /// SortOrder
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
820 - /// SortOrder
|
|
820 + /// `SortOrder`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:837:5
|
|
|
|
|
837 | /// AuditTrailQueryResult
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
837 - /// AuditTrailQueryResult
|
|
837 + /// `AuditTrailQueryResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:884:13
|
|
|
|
|
884 | /// Set PostgreSQL connection pool for persistence and queries
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
884 - /// Set PostgreSQL connection pool for persistence and queries
|
|
884 + /// Set `PostgreSQL` connection pool for persistence and queries
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:886:48
|
|
|
|
|
886 | /// This must be called after creating the AuditTrailEngine to enable database persistence.
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
886 - /// This must be called after creating the AuditTrailEngine to enable database persistence.
|
|
886 + /// This must be called after creating the `AuditTrailEngine` to enable database persistence.
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/audit_trails.rs:1030:22
|
|
|
|
|
1030 | .map(|d| d.as_nanos() as u64)
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/audit_trails.rs:1037:24
|
|
|
|
|
1037 | let notional = order_details.quantity * order_details.price.unwrap_or(Decimal::ZERO);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: infinite loop detected
|
|
--> trading_engine/src/compliance/audit_trails.rs:1058:13
|
|
|
|
|
1058 | / loop {
|
|
1059 | | interval.tick().await;
|
|
... |
|
|
1068 | | }
|
|
| |_____________^
|
|
|
|
|
= help: if this is not intended, try adding a `break` or `return` condition in the loop
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#infinite_loop
|
|
= note: requested on the command line with `-D clippy::infinite-loop`
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1065:25
|
|
|
|
|
1065 | eprintln!("Failed to persist audit events: {}", e);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
error: infinite loop detected
|
|
--> trading_engine/src/compliance/audit_trails.rs:1080:13
|
|
|
|
|
1080 | / loop {
|
|
1081 | | interval.tick().await;
|
|
1082 | |
|
|
1083 | | if let Err(e) = retention_manager.cleanup_expired_events().await {
|
|
... |
|
|
1086 | | }
|
|
| |_____________^
|
|
|
|
|
= help: if this is not intended, try adding a `break` or `return` condition in the loop
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#infinite_loop
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1084:21
|
|
|
|
|
1084 | eprintln!("Failed to cleanup expired audit events: {}", e);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:1094:5
|
|
|
|
|
1094 | /// OrderDetails
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1094 - /// OrderDetails
|
|
1094 + /// `OrderDetails`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:1128:5
|
|
|
|
|
1128 | /// ExecutionDetails
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1128 - /// ExecutionDetails
|
|
1128 + /// `ExecutionDetails`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:1209:13
|
|
|
|
|
1209 | /// Set PostgreSQL connection pool for persistence
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1209 - /// Set PostgreSQL connection pool for persistence
|
|
1209 + /// Set `PostgreSQL` connection pool for persistence
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1227:17
|
|
|
|
|
1227 | "PostgreSQL connection pool not initialized".to_string()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"PostgreSQL connection pool not initialized".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: the borrowed expression implements the required traits
|
|
--> trading_engine/src/compliance/audit_trails.rs:1251:19
|
|
|
|
|
1251 | .bind(&event.timestamp)
|
|
| ^^^^^^^^^^^^^^^^ help: change this to: `event.timestamp`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/audit_trails.rs:1252:19
|
|
|
|
|
1252 | .bind(event.timestamp_nanos as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: redundant closure
|
|
--> trading_engine/src/compliance/audit_trails.rs:1259:26
|
|
|
|
|
1259 | .map_err(|e| AuditTrailError::Serialization(e))?)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `AuditTrailError::Serialization`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
|
|
= note: `-W clippy::redundant-closure` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::redundant_closure)]`
|
|
|
|
warning: this could be a `const fn`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1281:5
|
|
|
|
|
1281 | / pub fn new(algorithm: CompressionAlgorithm, compression_level: u32) -> Self {
|
|
1282 | | Self {
|
|
1283 | | algorithm,
|
|
1284 | | compression_level,
|
|
1285 | | }
|
|
1286 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
1281 | pub const fn new(algorithm: CompressionAlgorithm, compression_level: u32) -> Self {
|
|
| +++++
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1304:50
|
|
|
|
|
1304 | Err(AuditTrailError::Compression("LZ4/ZSTD not yet implemented".to_string()))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"LZ4/ZSTD not yet implemented".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1323:50
|
|
|
|
|
1323 | Err(AuditTrailError::Compression("LZ4/ZSTD not yet implemented".to_string()))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"LZ4/ZSTD not yet implemented".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: this could be a `const fn`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1330:5
|
|
|
|
|
1330 | / pub fn new(algorithm: EncryptionAlgorithm, key_id: String) -> Self {
|
|
1331 | | Self { algorithm, key_id }
|
|
1332 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
1330 | pub const fn new(algorithm: EncryptionAlgorithm, key_id: String) -> Self {
|
|
| +++++
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1357:49
|
|
|
|
|
1357 | Err(AuditTrailError::Encryption("ChaCha20Poly1305 not yet implemented".to_string()))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"ChaCha20Poly1305 not yet implemented".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1378:49
|
|
|
|
|
1378 | Err(AuditTrailError::Encryption("ChaCha20Poly1305 not yet implemented".to_string()))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"ChaCha20Poly1305 not yet implemented".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: you should consider adding a `Default` implementation for `BatchProcessor`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1385:5
|
|
|
|
|
1385 | / pub fn new() -> Self {
|
|
1386 | | Self {
|
|
1387 | | pending_events: Vec::new(),
|
|
1388 | | last_flush: Utc::now(),
|
|
... |
|
|
1391 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
1384 + impl Default for BatchProcessor {
|
|
1385 + fn default() -> Self {
|
|
1386 + Self::new()
|
|
1387 + }
|
|
1388 + }
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/audit_trails.rs:1408:27
|
|
|
|
|
1408 | let cutoff_date = Utc::now() - Duration::days(self.config.retention_days as i64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/audit_trails.rs:1408:55
|
|
|
|
|
1408 | let cutoff_date = Utc::now() - Duration::days(self.config.retention_days as i64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:1451:13
|
|
|
|
|
1451 | /// Set PostgreSQL connection pool for queries
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1451 - /// Set PostgreSQL connection pool for queries
|
|
1451 + /// Set `PostgreSQL` connection pool for queries
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/audit_trails.rs:1482:31
|
|
|
|
|
1482 | let mut param_count = 2;
|
|
| ^ help: consider adding suffix: `2_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/audit_trails.rs:1490:32
|
|
|
|
|
1490 | param_count += 1;
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/audit_trails.rs:1494:32
|
|
|
|
|
1494 | param_count += 1;
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/audit_trails.rs:1498:32
|
|
|
|
|
1498 | param_count += 1;
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/audit_trails.rs:1517:28
|
|
|
|
|
1517 | param_count += 1;
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/audit_trails.rs:1519:28
|
|
|
|
|
1519 | param_count += 1;
|
|
| ^ help: consider adding suffix: `1_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1467:17
|
|
|
|
|
1467 | "PostgreSQL connection pool not initialized".to_string()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"PostgreSQL connection pool not initialized".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1473:13
|
|
|
|
|
1473 | "SELECT event_id, event_type, timestamp, timestamp_nanos,".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"SELECT event_id, event_type, timestamp, timestamp_nanos,".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1474:13
|
|
|
|
|
1474 | "transaction_id, order_id, actor, session_id, client_ip,".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"transaction_id, order_id, actor, session_id, client_ip,".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1475:13
|
|
|
|
|
1475 | "details, before_state, after_state, compliance_tags,".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"details, before_state, after_state, compliance_tags,".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1476:13
|
|
|
|
|
1476 | "risk_level, digital_signature, checksum".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"risk_level, digital_signature, checksum".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1477:13
|
|
|
|
|
1477 | "FROM transaction_audit_events".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"FROM transaction_audit_events".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1478:13
|
|
|
|
|
1478 | "WHERE timestamp >= $1 AND timestamp <= $2".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"WHERE timestamp >= $1 AND timestamp <= $2".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/audit_trails.rs:1490:17
|
|
|
|
|
1490 | param_count += 1;
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/audit_trails.rs:1494:17
|
|
|
|
|
1494 | param_count += 1;
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/audit_trails.rs:1498:17
|
|
|
|
|
1498 | param_count += 1;
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1514:28
|
|
|
|
|
1514 | sql_parts.push(order_clause.to_string());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `order_clause.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/audit_trails.rs:1517:13
|
|
|
|
|
1517 | param_count += 1;
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/audit_trails.rs:1519:13
|
|
|
|
|
1519 | param_count += 1;
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: the borrowed expression implements the required traits
|
|
--> trading_engine/src/compliance/audit_trails.rs:1541:19
|
|
|
|
|
1541 | .bind(&query.start_time)
|
|
| ^^^^^^^^^^^^^^^^^ help: change this to: `query.start_time`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
|
|
warning: the borrowed expression implements the required traits
|
|
--> trading_engine/src/compliance/audit_trails.rs:1542:19
|
|
|
|
|
1542 | .bind(&query.end_time);
|
|
| ^^^^^^^^^^^^^^^ help: change this to: `query.end_time`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/audit_trails.rs:1557:19
|
|
|
|
|
1557 | .bind(validated_limit as i64)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/audit_trails.rs:1558:19
|
|
|
|
|
1558 | .bind(validated_offset as i64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/audit_trails.rs:1583:26
|
|
|
|
|
1583 | total_count: rows.len() as u32,
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/audit_trails.rs:1584:32
|
|
|
|
|
1584 | execution_time_ms: start_time.elapsed().as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:1589:28
|
|
|
|
|
1589 | /// Validate ID field (transaction_id, order_id) for SQL injection prevention
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1589 - /// Validate ID field (transaction_id, order_id) for SQL injection prevention
|
|
1589 + /// Validate ID field (`transaction_id`, order_id) for SQL injection prevention
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:1589:44
|
|
|
|
|
1589 | /// Validate ID field (transaction_id, order_id) for SQL injection prevention
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1589 - /// Validate ID field (transaction_id, order_id) for SQL injection prevention
|
|
1589 + /// Validate ID field (transaction_id, `order_id`) for SQL injection prevention
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1613:17
|
|
|
|
|
1613 | "actor must be between 1 and 255 characters".to_string()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"actor must be between 1 and 255 characters".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1620:17
|
|
|
|
|
1620 | "actor contains invalid characters (only alphanumeric, -, _, @, . allowed)".to_string()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"actor contains invalid characters (only alphanumeric, -, _, @, . allowed)".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:1670:13
|
|
|
|
|
1670 | /// Map PostgreSQL row to TransactionAuditEvent
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1670 - /// Map PostgreSQL row to TransactionAuditEvent
|
|
1670 + /// Map `PostgreSQL` row to TransactionAuditEvent
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:1670:31
|
|
|
|
|
1670 | /// Map PostgreSQL row to TransactionAuditEvent
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1670 - /// Map PostgreSQL row to TransactionAuditEvent
|
|
1670 + /// Map PostgreSQL row to `TransactionAuditEvent`
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/audit_trails.rs:1688:30
|
|
|
|
|
1688 | timestamp_nanos: row.get::<i64, _>("timestamp_nanos") as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: you should consider adding a `Default` implementation for `IndexManager`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1738:5
|
|
|
|
|
1738 | / pub fn new() -> Self {
|
|
1739 | | IndexManager {}
|
|
1740 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
1737 + impl Default for IndexManager {
|
|
1738 + fn default() -> Self {
|
|
1739 + Self::new()
|
|
1740 + }
|
|
1741 + }
|
|
|
|
|
|
|
warning: this could be a `const fn`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1738:5
|
|
|
|
|
1738 | / pub fn new() -> Self {
|
|
1739 | | IndexManager {}
|
|
1740 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
1738 | pub const fn new() -> Self {
|
|
| +++++
|
|
|
|
warning: you should consider adding a `Default` implementation for `QueryCache`
|
|
--> trading_engine/src/compliance/audit_trails.rs:1744:5
|
|
|
|
|
1744 | / pub fn new() -> Self {
|
|
1745 | | Self {
|
|
1746 | | cache: HashMap::new(),
|
|
1747 | | max_size: 1000,
|
|
... |
|
|
1750 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
1743 + impl Default for QueryCache {
|
|
1744 + fn default() -> Self {
|
|
1745 + Self::new()
|
|
1746 + }
|
|
1747 + }
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/audit_trails.rs:1783:5
|
|
|
|
|
1783 | /// AuditTrailError
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1783 - /// AuditTrailError
|
|
1783 + /// `AuditTrailError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:18:5
|
|
|
|
|
18 | /// BestExecutionAnalyzer
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
18 - /// BestExecutionAnalyzer
|
|
18 + /// `BestExecutionAnalyzer`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:29:5
|
|
|
|
|
29 | /// BestExecutionConfig
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
29 - /// BestExecutionConfig
|
|
29 + /// `BestExecutionConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:47:5
|
|
|
|
|
47 | /// ExecutionFactors
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
47 - /// ExecutionFactors
|
|
47 + /// `ExecutionFactors`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:67:5
|
|
|
|
|
67 | /// VenueSelectionCriteria
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
67 - /// VenueSelectionCriteria
|
|
67 + /// `VenueSelectionCriteria`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:83:5
|
|
|
|
|
83 | /// ReportingIntervals
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
83 - /// ReportingIntervals
|
|
83 + /// `ReportingIntervals`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:99:5
|
|
|
|
|
99 | /// BestExecutionAnalysis
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
99 - /// BestExecutionAnalysis
|
|
99 + /// `BestExecutionAnalysis`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:129:5
|
|
|
|
|
129 | /// VenueAnalysis
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
129 - /// VenueAnalysis
|
|
129 + /// `VenueAnalysis`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:157:5
|
|
|
|
|
157 | /// VenueType
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
157 - /// VenueType
|
|
157 + /// `VenueType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:177:5
|
|
|
|
|
177 | /// ExecutionQualityMetrics
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
177 - /// ExecutionQualityMetrics
|
|
177 + /// `ExecutionQualityMetrics`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:199:5
|
|
|
|
|
199 | /// TransactionCostBreakdown
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
199 - /// TransactionCostBreakdown
|
|
199 + /// `TransactionCostBreakdown`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:215:5
|
|
|
|
|
215 | /// ExplicitCosts
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
215 - /// ExplicitCosts
|
|
215 + /// `ExplicitCosts`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:233:5
|
|
|
|
|
233 | /// ImplicitCosts
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
233 - /// ImplicitCosts
|
|
233 + /// `ImplicitCosts`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:251:5
|
|
|
|
|
251 | /// ExecutionFinding
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
251 - /// ExecutionFinding
|
|
251 + /// `ExecutionFinding`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:269:5
|
|
|
|
|
269 | /// ExecutionFindingType
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
269 - /// ExecutionFindingType
|
|
269 + /// `ExecutionFindingType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:287:5
|
|
|
|
|
287 | /// FindingSeverity
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
287 - /// FindingSeverity
|
|
287 + /// `FindingSeverity`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:305:5
|
|
|
|
|
305 | /// ExecutionDocumentation
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
305 - /// ExecutionDocumentation
|
|
305 + /// `ExecutionDocumentation`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:323:5
|
|
|
|
|
323 | /// MarketConditionsSnapshot
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
323 - /// MarketConditionsSnapshot
|
|
323 + /// `MarketConditionsSnapshot`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:343:5
|
|
|
|
|
343 | /// VenueExecutionMonitor
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
343 - /// VenueExecutionMonitor
|
|
343 + /// `VenueExecutionMonitor`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:352:5
|
|
|
|
|
352 | /// VenueMetrics
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
352 - /// VenueMetrics
|
|
352 + /// `VenueMetrics`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:374:5
|
|
|
|
|
374 | /// TransactionCostAnalyzer
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
374 - /// TransactionCostAnalyzer
|
|
374 + /// `TransactionCostAnalyzer`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:384:5
|
|
|
|
|
384 | /// CostModel
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
384 - /// CostModel
|
|
384 + /// `CostModel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:398:5
|
|
|
|
|
398 | /// ModelAccuracy
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
398 - /// ModelAccuracy
|
|
398 + /// `ModelAccuracy`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:412:5
|
|
|
|
|
412 | /// CostBenchmarks
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
412 - /// CostBenchmarks
|
|
412 + /// `CostBenchmarks`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:428:5
|
|
|
|
|
428 | /// ExecutionReportGenerator
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
428 - /// ExecutionReportGenerator
|
|
428 + /// `ExecutionReportGenerator`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:438:5
|
|
|
|
|
438 | /// ReportTemplate
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
438 - /// ReportTemplate
|
|
438 + /// `ReportTemplate`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:454:5
|
|
|
|
|
454 | /// ReportType
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
454 - /// ReportType
|
|
454 + /// `ReportType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:472:5
|
|
|
|
|
472 | /// OutputFormat
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
472 - /// OutputFormat
|
|
472 + /// `OutputFormat`
|
|
|
|
|
|
|
error: indexing may panic
|
|
--> trading_engine/src/compliance/best_execution.rs:618:24
|
|
|
|
|
618 | let selected = venue_analyses[0].clone();
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n)` or `.get_mut(n)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
error: slicing may panic
|
|
--> trading_engine/src/compliance/best_execution.rs:619:28
|
|
|
|
|
619 | let alternatives = venue_analyses[1..].to_vec();
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.get(n..)` or .get_mut(n..)` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/best_execution.rs:716:89
|
|
|
|
|
716 | let price_score = (10.0 - quality_metrics.price_deviation_bps.abs()).max(0.0) / 10.0;
|
|
| ^^^^ help: consider adding suffix: `10.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/best_execution.rs:717:76
|
|
|
|
|
717 | let cost_score = (20.0 - cost_analysis.total_costs_bps).max(0.0) / 20.0;
|
|
| ^^^^ help: consider adding suffix: `20.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/best_execution.rs:718:94
|
|
|
|
|
718 | let speed_score = (1000.0 - quality_metrics.avg_execution_time_ms as f64).max(0.0) / 1000.0;
|
|
| ^^^^^^ help: consider adding suffix: `1_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/best_execution.rs:720:88
|
|
|
|
|
720 | let impact_score = (10.0 - quality_metrics.market_impact_bps.abs()).max(0.0) / 10.0;
|
|
| ^^^^ help: consider adding suffix: `10.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/compliance/best_execution.rs:716:27
|
|
|
|
|
716 | let price_score = (10.0 - quality_metrics.price_deviation_bps.abs()).max(0.0) / 10.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/compliance/best_execution.rs:717:26
|
|
|
|
|
717 | let cost_score = (20.0 - cost_analysis.total_costs_bps).max(0.0) / 20.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/compliance/best_execution.rs:718:27
|
|
|
|
|
718 | let speed_score = (1000.0 - quality_metrics.avg_execution_time_ms as f64).max(0.0) / 1000.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/best_execution.rs:718:37
|
|
|
|
|
718 | let speed_score = (1000.0 - quality_metrics.avg_execution_time_ms as f64).max(0.0) / 1000.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/compliance/best_execution.rs:720:28
|
|
|
|
|
720 | let impact_score = (10.0 - quality_metrics.market_impact_bps.abs()).max(0.0) / 10.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/compliance/best_execution.rs:722:9
|
|
|
|
|
722 | / factors.price_weight * price_score
|
|
723 | | + factors.cost_weight * cost_score
|
|
724 | | + factors.speed_weight * speed_score
|
|
725 | | + factors.likelihood_weight * fill_score
|
|
726 | | + factors.market_impact_weight * impact_score
|
|
| |_________________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/best_execution.rs:740:44
|
|
|
|
|
740 | if cost_analysis.total_costs_bps > 15.0 {
|
|
| ^^^^ help: consider adding suffix: `15.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/best_execution.rs:771:32
|
|
|
|
|
771 | if venue.venue_score < 0.7 {
|
|
| ^^^ help: consider adding suffix: `0.7_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/best_execution.rs:807:52
|
|
|
|
|
807 | selected_venue.execution_probability * 100.0
|
|
| ^^^^^ help: consider adding suffix: `100.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/compliance/best_execution.rs:807:13
|
|
|
|
|
807 | selected_venue.execution_probability * 100.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/best_execution.rs:853:9
|
|
|
|
|
853 | metrics.response_times.iter().sum::<u64>() / metrics.response_times.len().max(1) as u64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: integer division
|
|
--> trading_engine/src/compliance/best_execution.rs:853:9
|
|
|
|
|
853 | metrics.response_times.iter().sum::<u64>() / metrics.response_times.len().max(1) as u64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: division of integers may cause loss of precision. consider using floats
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/best_execution.rs:853:54
|
|
|
|
|
853 | metrics.response_times.iter().sum::<u64>() / metrics.response_times.len().max(1) as u64
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/best_execution.rs:857:28
|
|
|
|
|
857 | Some(Decimal::from(50000))
|
|
| ^^^^^ help: consider adding suffix: `50_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/best_execution.rs:868:68
|
|
|
|
|
868 | let cost_score = (20.0 - costs.total_costs_bps).max(0.0) / 20.0;
|
|
| ^^^^ help: consider adding suffix: `20.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/compliance/best_execution.rs:868:26
|
|
|
|
|
868 | let cost_score = (20.0 - costs.total_costs_bps).max(0.0) / 20.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/compliance/best_execution.rs:869:9
|
|
|
|
|
869 | (quality_score + cost_score) / 2.0
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:887:5
|
|
|
|
|
887 | /// VenueInfo
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
887 - /// VenueInfo
|
|
887 + /// `VenueInfo`
|
|
|
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/best_execution.rs:916:49
|
|
|
|
|
916 | fill_rates.insert("default".to_owned(), 0.95);
|
|
| ^^^^ help: consider adding suffix: `0.95_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/best_execution.rs:958:39
|
|
|
|
|
958 | None => Decimal::try_from(100.0).map_err(|_| {
|
|
| ^^^^^ help: consider adding suffix: `100.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/best_execution.rs:967:49
|
|
|
|
|
967 | let commission_rate = Decimal::try_from(0.0005).map_err(|_| {
|
|
| ^^^^^^ help: consider adding suffix: `0.000_5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/best_execution.rs:970:51
|
|
|
|
|
970 | let exchange_fee_rate = Decimal::try_from(0.0002).map_err(|_| {
|
|
| ^^^^^^ help: consider adding suffix: `0.000_2_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/best_execution.rs:973:51
|
|
|
|
|
973 | let clearing_fee_rate = Decimal::try_from(0.0001).map_err(|_| {
|
|
| ^^^^^^ help: consider adding suffix: `0.000_1_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/best_execution.rs:976:53
|
|
|
|
|
976 | let regulatory_fee_rate = Decimal::try_from(0.00005).map_err(|_| {
|
|
| ^^^^^^^ help: consider adding suffix: `0.000_05_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/best_execution.rs:979:53
|
|
|
|
|
979 | let total_explicit_rate = Decimal::try_from(0.00085).map_err(|_| {
|
|
| ^^^^^^^ help: consider adding suffix: `0.000_85_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/compliance/best_execution.rs:958:54
|
|
|
|
|
958 | None => Decimal::try_from(100.0).map_err(|_| {
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/best_execution.rs:964:24
|
|
|
|
|
964 | let notional = quantity_decimal * price_decimal;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/compliance/best_execution.rs:967:65
|
|
|
|
|
967 | let commission_rate = Decimal::try_from(0.0005).map_err(|_| {
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/compliance/best_execution.rs:970:67
|
|
|
|
|
970 | let exchange_fee_rate = Decimal::try_from(0.0002).map_err(|_| {
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/compliance/best_execution.rs:973:67
|
|
|
|
|
973 | let clearing_fee_rate = Decimal::try_from(0.0001).map_err(|_| {
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/compliance/best_execution.rs:976:70
|
|
|
|
|
976 | let regulatory_fee_rate = Decimal::try_from(0.00005).map_err(|_| {
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: `map_err(|_|...` wildcard pattern discards the original error
|
|
--> trading_engine/src/compliance/best_execution.rs:979:70
|
|
|
|
|
979 | let total_explicit_rate = Decimal::try_from(0.00085).map_err(|_| {
|
|
| ^^^
|
|
|
|
|
= help: consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/best_execution.rs:985:29
|
|
|
|
|
985 | commission: notional * commission_rate,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/best_execution.rs:986:32
|
|
|
|
|
986 | exchange_fees: notional * exchange_fee_rate,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/best_execution.rs:987:32
|
|
|
|
|
987 | clearing_fees: notional * clearing_fee_rate,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/best_execution.rs:988:34
|
|
|
|
|
988 | regulatory_fees: notional * regulatory_fee_rate,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/best_execution.rs:989:33
|
|
|
|
|
989 | total_explicit: notional * total_explicit_rate,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/compliance/best_execution.rs:998:30
|
|
|
|
|
998 | total_costs_bps: 8.5 + 3.8, // explicit + implicit
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/best_execution.rs:1015:5
|
|
|
|
|
1015 | /// BestExecutionError
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1015 - /// BestExecutionError
|
|
1015 + /// `BestExecutionError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:15:5
|
|
|
|
|
15 | /// MiFID II Transaction Reporter
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
15 - /// MiFID II Transaction Reporter
|
|
15 + /// `MiFID` II Transaction Reporter
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:17:52
|
|
|
|
|
17 | /// Comprehensive transaction reporting system for MiFID II RTS 22 compliance.
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
17 - /// Comprehensive transaction reporting system for MiFID II RTS 22 compliance.
|
|
17 + /// Comprehensive transaction reporting system for `MiFID` II RTS 22 compliance.
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:43:5
|
|
|
|
|
43 | /// TransactionReporter
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
43 - /// TransactionReporter
|
|
43 + /// `TransactionReporter`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:55:37
|
|
|
|
|
55 | /// Comprehensive configuration for MiFID II transaction reporting including
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
55 - /// Comprehensive configuration for MiFID II transaction reporting including
|
|
55 + /// Comprehensive configuration for `MiFID` II transaction reporting including
|
|
|
|
|
|
|
warning: doc list item without indentation
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:66:5
|
|
|
|
|
66 | /// TransactionReportingConfig
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
|
|
= note: `-W clippy::doc-lazy-continuation` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::doc_lazy_continuation)]`
|
|
help: indent this line
|
|
|
|
|
66 | /// TransactionReportingConfig
|
|
| ++
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:66:5
|
|
|
|
|
66 | /// TransactionReportingConfig
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
66 - /// TransactionReportingConfig
|
|
66 + /// `TransactionReportingConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:85:27
|
|
|
|
|
85 | /// authority (e.g., FCA, BaFin, ESMA). Each authority may have different
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
85 - /// authority (e.g., FCA, BaFin, ESMA). Each authority may have different
|
|
85 + /// authority (e.g., FCA, `BaFin`, ESMA). Each authority may have different
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:92:5
|
|
|
|
|
92 | /// AuthorityEndpoint
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
92 - /// AuthorityEndpoint
|
|
92 + /// `AuthorityEndpoint`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:96:45
|
|
|
|
|
96 | /// Authority identifier (e.g., "FCA", "BaFin", "ESMA")
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
96 - /// Authority identifier (e.g., "FCA", "BaFin", "ESMA")
|
|
96 + /// Authority identifier (e.g., "FCA", "`BaFin`", "ESMA")
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:119:5
|
|
|
|
|
119 | /// AuthenticationMethod
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
119 - /// AuthenticationMethod
|
|
119 + /// `AuthenticationMethod`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:142:5
|
|
|
|
|
142 | /// ReportFormat
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
142 - /// ReportFormat
|
|
142 + /// `ReportFormat`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:164:5
|
|
|
|
|
164 | /// SubmissionFrequency
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
164 - /// SubmissionFrequency
|
|
164 + /// `SubmissionFrequency`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:186:5
|
|
|
|
|
186 | /// SubmissionSchedule
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
186 - /// SubmissionSchedule
|
|
186 + /// `SubmissionSchedule`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:206:5
|
|
|
|
|
206 | /// RetentionSettings
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
206 - /// RetentionSettings
|
|
206 + /// `RetentionSettings`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:226:5
|
|
|
|
|
226 | /// ValidationRules
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
226 - /// ValidationRules
|
|
226 + /// `ValidationRules`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:246:5
|
|
|
|
|
246 | /// CustomValidationRule
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
246 - /// CustomValidationRule
|
|
246 + /// `CustomValidationRule`
|
|
|
|
|
|
|
warning: doc list item without indentation
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:269:5
|
|
|
|
|
269 | /// ValidationSeverity
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
|
|
help: indent this line
|
|
|
|
|
269 | /// ValidationSeverity
|
|
| ++
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:269:5
|
|
|
|
|
269 | /// ValidationSeverity
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
269 - /// ValidationSeverity
|
|
269 + /// `ValidationSeverity`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:281:31
|
|
|
|
|
281 | /// Transaction report as per MiFID II RTS 22
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
281 - /// Transaction report as per MiFID II RTS 22
|
|
281 + /// Transaction report as per `MiFID` II RTS 22
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:290:21
|
|
|
|
|
290 | /// - Article 26 of MiFID II
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
290 - /// - Article 26 of MiFID II
|
|
290 + /// - Article 26 of `MiFID` II
|
|
|
|
|
|
|
warning: doc list item without indentation
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:294:5
|
|
|
|
|
294 | /// TransactionReport
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
|
|
help: indent this line
|
|
|
|
|
294 | /// TransactionReport
|
|
| ++
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:294:5
|
|
|
|
|
294 | /// TransactionReport
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
294 - /// TransactionReport
|
|
294 + /// `TransactionReport`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:322:5
|
|
|
|
|
322 | /// ReportHeader
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
322 - /// ReportHeader
|
|
322 + /// `ReportHeader`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:343:36
|
|
|
|
|
343 | /// the transaction as required by MiFID II Article 26.
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
343 - /// the transaction as required by MiFID II Article 26.
|
|
343 + /// the transaction as required by `MiFID` II Article 26.
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:346:5
|
|
|
|
|
346 | /// TradingCapacity
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
346 - /// TradingCapacity
|
|
346 + /// `TradingCapacity`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:364:5
|
|
|
|
|
364 | /// TransactionDetails
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
364 - /// TransactionDetails
|
|
364 + /// `TransactionDetails`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:396:5
|
|
|
|
|
396 | /// UnitOfMeasure
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
396 - /// UnitOfMeasure
|
|
396 + /// `UnitOfMeasure`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:412:33
|
|
|
|
|
412 | /// classification according to MiFID II instrument categories.
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
412 - /// classification according to MiFID II instrument categories.
|
|
412 + /// classification according to `MiFID` II instrument categories.
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:414:5
|
|
|
|
|
414 | /// InstrumentIdentification
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
414 - /// InstrumentIdentification
|
|
414 + /// `InstrumentIdentification`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:430:51
|
|
|
|
|
430 | /// Classifies financial instruments according to MiFID II categories.
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
430 - /// Classifies financial instruments according to MiFID II categories.
|
|
430 + /// Classifies financial instruments according to `MiFID` II categories.
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:434:5
|
|
|
|
|
434 | /// InstrumentClassification
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
434 - /// InstrumentClassification
|
|
434 + /// `InstrumentClassification`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:453:29
|
|
|
|
|
453 | /// decision as required by MiFID II. Critical for regulatory oversight
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
453 - /// decision as required by MiFID II. Critical for regulatory oversight
|
|
453 + /// decision as required by `MiFID` II. Critical for regulatory oversight
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:456:5
|
|
|
|
|
456 | /// InvestmentDecisionInfo
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
456 - /// InvestmentDecisionInfo
|
|
456 + /// `InvestmentDecisionInfo`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:470:8
|
|
|
|
|
470 | /// by MiFID II transparency and accountability requirements.
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
470 - /// by MiFID II transparency and accountability requirements.
|
|
470 + /// by `MiFID` II transparency and accountability requirements.
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:472:5
|
|
|
|
|
472 | /// DecisionMaker
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
472 - /// DecisionMaker
|
|
472 + /// `DecisionMaker`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:504:35
|
|
|
|
|
504 | /// was transmitted. Required for MiFID II execution reporting
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
504 - /// was transmitted. Required for MiFID II execution reporting
|
|
504 + /// was transmitted. Required for `MiFID` II execution reporting
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:507:5
|
|
|
|
|
507 | /// ExecutionInfo
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
507 - /// ExecutionInfo
|
|
507 + /// `ExecutionInfo`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:525:5
|
|
|
|
|
525 | /// TransmissionMethod
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
525 - /// TransmissionMethod
|
|
525 + /// `TransmissionMethod`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:545:5
|
|
|
|
|
545 | /// VenueInfo
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
545 - /// VenueInfo
|
|
545 + /// `VenueInfo`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:565:5
|
|
|
|
|
565 | /// ReportMetadata
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
565 - /// ReportMetadata
|
|
565 + /// `ReportMetadata`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:587:5
|
|
|
|
|
587 | /// ReportStatus
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
587 - /// ReportStatus
|
|
587 + /// `ReportStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:611:5
|
|
|
|
|
611 | /// ValidationResult
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
611 - /// ValidationResult
|
|
611 + /// `ValidationResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:631:5
|
|
|
|
|
631 | /// ValidationStatus
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
631 - /// ValidationStatus
|
|
631 + /// `ValidationStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:649:5
|
|
|
|
|
649 | /// SubmissionAttempt
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
649 - /// SubmissionAttempt
|
|
649 + /// `SubmissionAttempt`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:673:5
|
|
|
|
|
673 | /// SubmissionStatus
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
673 - /// SubmissionStatus
|
|
673 + /// `SubmissionStatus`
|
|
|
|
|
|
|
warning: doc list item without indentation
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:701:5
|
|
|
|
|
701 | /// TransactionReportBuilder
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
|
|
help: indent this line
|
|
|
|
|
701 | /// TransactionReportBuilder
|
|
| ++
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:701:5
|
|
|
|
|
701 | /// TransactionReportBuilder
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
701 - /// TransactionReportBuilder
|
|
701 + /// `TransactionReportBuilder`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:717:5
|
|
|
|
|
717 | /// ReportTemplate
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
717 - /// ReportTemplate
|
|
717 + /// `ReportTemplate`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:739:5
|
|
|
|
|
739 | /// ReportField
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
739 - /// ReportField
|
|
739 + /// `ReportField`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:763:5
|
|
|
|
|
763 | /// FieldDataType
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
763 - /// FieldDataType
|
|
763 + /// `FieldDataType`
|
|
|
|
|
|
|
warning: doc list item without indentation
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:793:5
|
|
|
|
|
793 | /// ReportSubmissionManager
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
|
|
help: indent this line
|
|
|
|
|
793 | /// ReportSubmissionManager
|
|
| ++
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:793:5
|
|
|
|
|
793 | /// ReportSubmissionManager
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
793 - /// ReportSubmissionManager
|
|
793 + /// `ReportSubmissionManager`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:810:5
|
|
|
|
|
810 | /// SubmissionTask
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
810 - /// SubmissionTask
|
|
810 + /// `SubmissionTask`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:834:5
|
|
|
|
|
834 | /// TaskPriority
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
834 - /// TaskPriority
|
|
834 + /// `TaskPriority`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:852:5
|
|
|
|
|
852 | /// RetryPolicy
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
852 - /// RetryPolicy
|
|
852 + /// `RetryPolicy`
|
|
|
|
|
|
|
warning: doc list item without indentation
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:878:5
|
|
|
|
|
878 | /// ReportValidationEngine
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
|
|
help: indent this line
|
|
|
|
|
878 | /// ReportValidationEngine
|
|
| ++
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:878:5
|
|
|
|
|
878 | /// ReportValidationEngine
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
878 - /// ReportValidationEngine
|
|
878 + /// `ReportValidationEngine`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:894:5
|
|
|
|
|
894 | /// ValidationSchema
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
894 - /// ValidationSchema
|
|
894 + /// `ValidationSchema`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:914:5
|
|
|
|
|
914 | /// SchemaRule
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
914 - /// SchemaRule
|
|
914 + /// `SchemaRule`
|
|
|
|
|
|
|
warning: doc list item without indentation
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:937:5
|
|
|
|
|
937 | /// SchemaRuleType
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
|
|
help: indent this line
|
|
|
|
|
937 | /// SchemaRuleType
|
|
| ++
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:937:5
|
|
|
|
|
937 | /// SchemaRuleType
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
937 - /// SchemaRuleType
|
|
937 + /// `SchemaRuleType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:999:66
|
|
|
|
|
999 | /// Initializes a new transaction reporter with the provided MiFID configuration.
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
999 - /// Initializes a new transaction reporter with the provided MiFID configuration.
|
|
999 + /// Initializes a new transaction reporter with the provided `MiFID` configuration.
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1004:23
|
|
|
|
|
1004 | /// * `_config` - MiFID configuration containing authority endpoints and settings
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1004 - /// * `_config` - MiFID configuration containing authority endpoints and settings
|
|
1004 + /// * `_config` - `MiFID` configuration containing authority endpoints and settings
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1027:28
|
|
|
|
|
1027 | /// Creates a complete MiFID II transaction report from order execution data.
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1027 - /// Creates a complete MiFID II transaction report from order execution data.
|
|
1027 + /// Creates a complete `MiFID` II transaction report from order execution data.
|
|
|
|
|
|
|
warning: doc list item without indentation
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1143:9
|
|
|
|
|
1143 | /// Submit report to competent authority
|
|
| ^
|
|
|
|
|
= help: if this is supposed to be its own paragraph, add a blank line
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
|
|
help: indent this line
|
|
|
|
|
1143 | /// Submit report to competent authority
|
|
| ++
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1188:43
|
|
|
|
|
1188 | /// Generate transparency reports for MiFID II compliance
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1188 - /// Generate transparency reports for MiFID II compliance
|
|
1188 + /// Generate transparency reports for `MiFID` II compliance
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1202:19
|
|
|
|
|
1202 | /// Addresses MiFID II transparency requirements including:
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1202 - /// Addresses MiFID II transparency requirements including:
|
|
1202 + /// Addresses `MiFID` II transparency requirements including:
|
|
|
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1231:5
|
|
|
|
|
1231 | / fn build_report_header(
|
|
1232 | | &self,
|
|
1233 | | execution: &OrderExecution,
|
|
1234 | | ) -> Result<ReportHeader, TransactionReportingError> {
|
|
| |________________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1234 - ) -> Result<ReportHeader, TransactionReportingError> {
|
|
1234 + ) -> compliance::transaction_reporting::ReportHeader {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1235 ~ ReportHeader {
|
|
1236 + report_id: format!("RPT-{}-{}", execution.execution_id, Utc::now().timestamp()),
|
|
1237 + reporting_entity_lei: "FOXHUNT123456789012".to_owned(), // Replace with actual LEI
|
|
1238 + trading_capacity: TradingCapacity::DealingOwnAccount,
|
|
1239 + report_timestamp: Utc::now(),
|
|
1240 + report_version: "1.0".to_owned(),
|
|
1241 + original_report_reference: None,
|
|
1242 + }
|
|
|
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1255:5
|
|
|
|
|
1255 | / fn extract_transaction_details(
|
|
1256 | | &self,
|
|
1257 | | execution: &OrderExecution,
|
|
1258 | | ) -> Result<TransactionDetails, TransactionReportingError> {
|
|
| |______________________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1258 - ) -> Result<TransactionDetails, TransactionReportingError> {
|
|
1258 + ) -> compliance::transaction_reporting::TransactionDetails {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1259 ~ TransactionDetails {
|
|
1260 + transaction_reference: execution.execution_id.clone(),
|
|
1261 + trading_datetime: execution.execution_time,
|
|
1262 + trading_capacity: TradingCapacity::DealingOwnAccount,
|
|
1263 + quantity: execution.filled_quantity,
|
|
1264 + unit_of_measure: UnitOfMeasure::Units,
|
|
1265 + price: execution.execution_price,
|
|
1266 + price_currency: execution.currency.clone(),
|
|
1267 + net_amount: {
|
|
1268 + let qty_decimal = execution.filled_quantity;
|
|
1269 + let price_decimal = execution.execution_price;
|
|
1270 + qty_decimal * price_decimal
|
|
1271 + },
|
|
1272 + venue_of_execution: execution.venue.clone(),
|
|
1273 + country_of_branch: None,
|
|
1274 + }
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1270:17
|
|
|
|
|
1270 | qty_decimal * price_decimal
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1280:66
|
|
|
|
|
1280 | /// alternative identifiers, and classification according to MiFID II categories.
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1280 - /// alternative identifiers, and classification according to MiFID II categories.
|
|
1280 + /// alternative identifiers, and classification according to `MiFID` II categories.
|
|
|
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1287:5
|
|
|
|
|
1287 | / fn build_instrument_identification(
|
|
1288 | | &self,
|
|
1289 | | execution: &OrderExecution,
|
|
1290 | | ) -> Result<InstrumentIdentification, TransactionReportingError> {
|
|
| |____________________________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1290 - ) -> Result<InstrumentIdentification, TransactionReportingError> {
|
|
1290 + ) -> compliance::transaction_reporting::InstrumentIdentification {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1291 ~ InstrumentIdentification {
|
|
1292 + isin: execution.isin.clone(),
|
|
1293 + alternative_identifier: Some(execution.symbol.clone()),
|
|
1294 + instrument_name: execution.symbol.clone(),
|
|
1295 + classification: InstrumentClassification::Equity, // Determine from instrument data
|
|
1296 + }
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1302:24
|
|
|
|
|
1302 | /// as required by MiFID II. For algorithmic trading, provides algorithm
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1302 - /// as required by MiFID II. For algorithmic trading, provides algorithm
|
|
1302 + /// as required by `MiFID` II. For algorithmic trading, provides algorithm
|
|
|
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1310:5
|
|
|
|
|
1310 | / fn extract_investment_decision_info(
|
|
1311 | | &self,
|
|
1312 | | _execution: &OrderExecution,
|
|
1313 | | ) -> Result<InvestmentDecisionInfo, TransactionReportingError> {
|
|
| |__________________________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1313 - ) -> Result<InvestmentDecisionInfo, TransactionReportingError> {
|
|
1313 + ) -> compliance::transaction_reporting::InvestmentDecisionInfo {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1314 ~ InvestmentDecisionInfo {
|
|
1315 + decision_maker: DecisionMaker::Algorithm {
|
|
1316 + algorithm_id: "FOXHUNT_TRADING_ALGO_v1.0".to_owned(),
|
|
1317 + description: "Foxhunt High-Frequency Trading Algorithm".to_owned(),
|
|
1318 + },
|
|
1319 + country_of_branch: None,
|
|
1320 + }
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1326:39
|
|
|
|
|
1326 | /// was transmitted. Required for MiFID II execution reporting.
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1326 - /// was transmitted. Required for MiFID II execution reporting.
|
|
1326 + /// was transmitted. Required for `MiFID` II execution reporting.
|
|
|
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1333:5
|
|
|
|
|
1333 | / fn extract_execution_info(
|
|
1334 | | &self,
|
|
1335 | | execution: &OrderExecution,
|
|
1336 | | ) -> Result<ExecutionInfo, TransactionReportingError> {
|
|
| |_________________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1336 - ) -> Result<ExecutionInfo, TransactionReportingError> {
|
|
1336 + ) -> compliance::transaction_reporting::ExecutionInfo {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1337 ~ ExecutionInfo {
|
|
1338 + executor: DecisionMaker::Algorithm {
|
|
1339 + algorithm_id: "FOXHUNT_EXECUTION_ALGO_v1.0".to_owned(),
|
|
1340 + description: "Foxhunt Execution Management System".to_owned(),
|
|
1341 + },
|
|
1342 + execution_timestamp: execution.execution_time,
|
|
1343 + transmission_method: TransmissionMethod::DirectElectronicAccess,
|
|
1344 + }
|
|
|
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1357:5
|
|
|
|
|
1357 | / fn build_venue_info(
|
|
1358 | | &self,
|
|
1359 | | execution: &OrderExecution,
|
|
1360 | | ) -> Result<VenueInfo, TransactionReportingError> {
|
|
| |_____________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
1360 - ) -> Result<VenueInfo, TransactionReportingError> {
|
|
1360 + ) -> compliance::transaction_reporting::VenueInfo {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
1361 ~ VenueInfo {
|
|
1362 + venue_id: execution.venue.clone(),
|
|
1363 + venue_name: execution.venue.clone(), // Map to full venue name
|
|
1364 + venue_mic: execution.venue.clone(), // Map to MIC code
|
|
1365 + venue_country: "US".to_owned(), // Determine from venue
|
|
1366 + }
|
|
|
|
|
|
|
warning: used underscore-prefixed binding
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1386:31
|
|
|
|
|
1386 | reporting_period: _period.clone(),
|
|
| ^^^^^^^
|
|
|
|
|
note: binding is defined here
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1381:9
|
|
|
|
|
1381 | _period: &ReportingPeriod,
|
|
| ^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding
|
|
|
|
warning: used underscore-prefixed binding
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1411:31
|
|
|
|
|
1411 | reporting_period: _period.clone(),
|
|
| ^^^^^^^
|
|
|
|
|
note: binding is defined here
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1406:9
|
|
|
|
|
1406 | _period: &ReportingPeriod,
|
|
| ^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1425:18
|
|
|
|
|
1425 | /// required for MiFID II transaction reporting. This structure
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1425 - /// required for MiFID II transaction reporting. This structure
|
|
1425 + /// required for `MiFID` II transaction reporting. This structure
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1429:38
|
|
|
|
|
1429 | /// All fields marked as required by MiFID II RTS 22 must be populated
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1429 - /// All fields marked as required by MiFID II RTS 22 must be populated
|
|
1429 + /// All fields marked as required by `MiFID` II RTS 22 must be populated
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1432:5
|
|
|
|
|
1432 | /// OrderExecution
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1432 - /// OrderExecution
|
|
1432 + /// `OrderExecution`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1466:5
|
|
|
|
|
1466 | /// ReportingPeriod
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1466 - /// ReportingPeriod
|
|
1466 + /// `ReportingPeriod`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1484:5
|
|
|
|
|
1484 | /// PeriodType
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1484 - /// PeriodType
|
|
1484 + /// `PeriodType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1500:39
|
|
|
|
|
1500 | /// Combined transparency reports for MiFID II compliance
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1500 - /// Combined transparency reports for MiFID II compliance
|
|
1500 + /// Combined transparency reports for `MiFID` II compliance
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1504:21
|
|
|
|
|
1504 | /// compliance with MiFID II transparency obligations.
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1504 - /// compliance with MiFID II transparency obligations.
|
|
1504 + /// compliance with `MiFID` II transparency obligations.
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1506:5
|
|
|
|
|
1506 | /// TransparencyReports
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1506 - /// TransparencyReports
|
|
1506 + /// `TransparencyReports`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1520:39
|
|
|
|
|
1520 | /// Pre-trade transparency report for MiFID II compliance
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1520 - /// Pre-trade transparency report for MiFID II compliance
|
|
1520 + /// Pre-trade transparency report for `MiFID` II compliance
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1526:5
|
|
|
|
|
1526 | /// PreTradeTransparencyReport
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1526 - /// PreTradeTransparencyReport
|
|
1526 + /// `PreTradeTransparencyReport`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1544:40
|
|
|
|
|
1544 | /// Post-trade transparency report for MiFID II compliance
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1544 - /// Post-trade transparency report for MiFID II compliance
|
|
1544 + /// Post-trade transparency report for `MiFID` II compliance
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1550:5
|
|
|
|
|
1550 | /// PostTradeTransparencyReport
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1550 - /// PostTradeTransparencyReport
|
|
1550 + /// `PostTradeTransparencyReport`
|
|
|
|
|
|
|
warning: calls to `push` immediately after creation
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1669:9
|
|
|
|
|
1669 | / let mut results = Vec::new();
|
|
1670 | |
|
|
1671 | | // Basic field validation
|
|
1672 | | results.push(ValidationResult {
|
|
... |
|
|
1684 | | validated_at: Utc::now(),
|
|
1685 | | });
|
|
| |___________^ help: consider using the `vec![]` macro: `let results = vec![..];`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push
|
|
= note: `-W clippy::vec-init-then-push` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::vec_init_then_push)]`
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/transaction_reporting.rs:1694:5
|
|
|
|
|
1694 | /// TransactionReportingError
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1694 - /// TransactionReportingError
|
|
1694 + /// `TransactionReportingError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:20:5
|
|
|
|
|
20 | /// SOXComplianceManager
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
20 - /// SOXComplianceManager
|
|
20 + /// `SOXComplianceManager`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:35:5
|
|
|
|
|
35 | /// SOXConfig
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
35 - /// SOXConfig
|
|
35 + /// `SOXConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:57:5
|
|
|
|
|
57 | /// ManagementCertificationConfig
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
57 - /// ManagementCertificationConfig
|
|
57 + /// `ManagementCertificationConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:73:5
|
|
|
|
|
73 | /// CertificationLevel
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
73 - /// CertificationLevel
|
|
73 + /// `CertificationLevel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:87:5
|
|
|
|
|
87 | /// OfficerRole
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
87 - /// OfficerRole
|
|
87 + /// `OfficerRole`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:105:5
|
|
|
|
|
105 | /// TestingFrequency
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
105 - /// TestingFrequency
|
|
105 + /// `TestingFrequency`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:123:5
|
|
|
|
|
123 | /// EscalationPolicies
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
123 - /// EscalationPolicies
|
|
123 + /// `EscalationPolicies`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:137:5
|
|
|
|
|
137 | /// EscalationPolicy
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
137 - /// EscalationPolicy
|
|
137 + /// `EscalationPolicy`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:151:5
|
|
|
|
|
151 | /// EscalationLevel
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
151 - /// EscalationLevel
|
|
151 + /// `EscalationLevel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:165:5
|
|
|
|
|
165 | /// NotificationMethod
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
165 - /// NotificationMethod
|
|
165 + /// `NotificationMethod`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:181:5
|
|
|
|
|
181 | /// InternalControlsEngine
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
181 - /// InternalControlsEngine
|
|
181 + /// `InternalControlsEngine`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:193:5
|
|
|
|
|
193 | /// InternalControl
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
193 - /// InternalControl
|
|
193 + /// `InternalControl`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:223:5
|
|
|
|
|
223 | /// ControlType
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
223 - /// ControlType
|
|
223 + /// `ControlType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:239:5
|
|
|
|
|
239 | /// ControlFrequency
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
239 - /// ControlFrequency
|
|
239 + /// `ControlFrequency`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:261:5
|
|
|
|
|
261 | /// RiskLevel
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
261 - /// RiskLevel
|
|
261 + /// `RiskLevel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:277:5
|
|
|
|
|
277 | /// TestingProcedure
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
277 - /// TestingProcedure
|
|
277 + /// `TestingProcedure`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:297:5
|
|
|
|
|
297 | /// TestingMethod
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
297 - /// TestingMethod
|
|
297 + /// `TestingMethod`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:315:5
|
|
|
|
|
315 | /// ImplementationStatus
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
315 - /// ImplementationStatus
|
|
315 + /// `ImplementationStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:333:5
|
|
|
|
|
333 | /// ControlTestingEngine
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
333 - /// ControlTestingEngine
|
|
333 + /// `ControlTestingEngine`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:344:5
|
|
|
|
|
344 | /// TestSchedule
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
344 - /// TestSchedule
|
|
344 + /// `TestSchedule`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:358:5
|
|
|
|
|
358 | /// ScheduledTest
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
358 - /// ScheduledTest
|
|
358 + /// `ScheduledTest`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:376:5
|
|
|
|
|
376 | /// TestType
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
376 - /// TestType
|
|
376 + /// `TestType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:392:5
|
|
|
|
|
392 | /// TestStatus
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
392 - /// TestStatus
|
|
392 + /// `TestStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:410:5
|
|
|
|
|
410 | /// ControlTestResult
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
410 - /// ControlTestResult
|
|
410 + /// `ControlTestResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:434:5
|
|
|
|
|
434 | /// TesterInfo
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
434 - /// TesterInfo
|
|
434 + /// `TesterInfo`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:450:5
|
|
|
|
|
450 | /// TestConclusion
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
450 - /// TestConclusion
|
|
450 + /// `TestConclusion`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:468:5
|
|
|
|
|
468 | /// TestEvidence
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
468 - /// TestEvidence
|
|
468 + /// `TestEvidence`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:486:5
|
|
|
|
|
486 | /// EvidenceType
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
486 - /// EvidenceType
|
|
486 + /// `EvidenceType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:506:5
|
|
|
|
|
506 | /// ControlDeficiency
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
506 - /// ControlDeficiency
|
|
506 + /// `ControlDeficiency`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:536:5
|
|
|
|
|
536 | /// DeficiencyType
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
536 - /// DeficiencyType
|
|
536 + /// `DeficiencyType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:550:5
|
|
|
|
|
550 | /// DeficiencySeverity
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
550 - /// DeficiencySeverity
|
|
550 + /// `DeficiencySeverity`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:564:5
|
|
|
|
|
564 | /// RemediationPlan
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
564 - /// RemediationPlan
|
|
564 + /// `RemediationPlan`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:582:5
|
|
|
|
|
582 | /// RemediationAction
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
582 - /// RemediationAction
|
|
582 + /// `RemediationAction`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:600:5
|
|
|
|
|
600 | /// ActionStatus
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
600 - /// ActionStatus
|
|
600 + /// `ActionStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:618:5
|
|
|
|
|
618 | /// ProgressUpdate
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
618 - /// ProgressUpdate
|
|
618 + /// `ProgressUpdate`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:634:5
|
|
|
|
|
634 | /// DeficiencyStatus
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
634 - /// DeficiencyStatus
|
|
634 + /// `DeficiencyStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:650:5
|
|
|
|
|
650 | /// ManagementResponse
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
650 - /// ManagementResponse
|
|
650 + /// `ManagementResponse`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:672:5
|
|
|
|
|
672 | /// DeficiencyTracker
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
672 - /// DeficiencyTracker
|
|
672 + /// `DeficiencyTracker`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:683:5
|
|
|
|
|
683 | /// DeficiencyMetrics
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
683 - /// DeficiencyMetrics
|
|
683 + /// `DeficiencyMetrics`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:703:5
|
|
|
|
|
703 | /// SegregationOfDutiesManager
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
703 - /// SegregationOfDutiesManager
|
|
703 + /// `SegregationOfDutiesManager`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:715:5
|
|
|
|
|
715 | /// SegregationMatrix
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
715 - /// SegregationMatrix
|
|
715 + /// `SegregationMatrix`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:729:5
|
|
|
|
|
729 | /// RoleDefinition
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
729 - /// RoleDefinition
|
|
729 + /// `RoleDefinition`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:765:5
|
|
|
|
|
765 | /// IncompatibleRoles
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
765 - /// IncompatibleRoles
|
|
765 + /// `IncompatibleRoles`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:783:5
|
|
|
|
|
783 | /// RequiredSeparation
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
783 - /// RequiredSeparation
|
|
783 + /// `RequiredSeparation`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:799:5
|
|
|
|
|
799 | /// ConflictDetector
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
799 - /// ConflictDetector
|
|
799 + /// `ConflictDetector`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:811:5
|
|
|
|
|
811 | /// ConflictDetectionRule
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
811 - /// ConflictDetectionRule
|
|
811 + /// `ConflictDetectionRule`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:827:5
|
|
|
|
|
827 | /// ConflictRuleType
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
827 - /// ConflictRuleType
|
|
827 + /// `ConflictRuleType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:843:5
|
|
|
|
|
843 | /// ConflictSeverity
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
843 - /// ConflictSeverity
|
|
843 + /// `ConflictSeverity`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:859:5
|
|
|
|
|
859 | /// DetectedConflict
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
859 - /// DetectedConflict
|
|
859 + /// `DetectedConflict`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:883:5
|
|
|
|
|
883 | /// ConflictResolutionStatus
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
883 - /// ConflictResolutionStatus
|
|
883 + /// `ConflictResolutionStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:901:5
|
|
|
|
|
901 | /// ApprovalWorkflow
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
901 - /// ApprovalWorkflow
|
|
901 + /// `ApprovalWorkflow`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:919:5
|
|
|
|
|
919 | /// ApprovalStep
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
919 - /// ApprovalStep
|
|
919 + /// `ApprovalStep`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:937:5
|
|
|
|
|
937 | /// ApprovalType
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
937 - /// ApprovalType
|
|
937 + /// `ApprovalType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:953:5
|
|
|
|
|
953 | /// TimeoutSettings
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
953 - /// TimeoutSettings
|
|
953 + /// `TimeoutSettings`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:967:5
|
|
|
|
|
967 | /// ChangeManagementSystem
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
967 - /// ChangeManagementSystem
|
|
967 + /// `ChangeManagementSystem`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:980:5
|
|
|
|
|
980 | /// ChangeRequest
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
980 - /// ChangeRequest
|
|
980 + /// `ChangeRequest`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1012:5
|
|
|
|
|
1012 | /// ChangeType
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1012 - /// ChangeType
|
|
1012 + /// `ChangeType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1028:5
|
|
|
|
|
1028 | /// ChangePriority
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1028 - /// ChangePriority
|
|
1028 + /// `ChangePriority`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1044:5
|
|
|
|
|
1044 | /// RiskAssessment
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1044 - /// RiskAssessment
|
|
1044 + /// `RiskAssessment`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1060:5
|
|
|
|
|
1060 | /// RiskFactor
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1060 - /// RiskFactor
|
|
1060 + /// `RiskFactor`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1076:5
|
|
|
|
|
1076 | /// ImpactAnalysis
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1076 - /// ImpactAnalysis
|
|
1076 + /// `ImpactAnalysis`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1094:5
|
|
|
|
|
1094 | /// BusinessImpact
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1094 - /// BusinessImpact
|
|
1094 + /// `BusinessImpact`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1110:5
|
|
|
|
|
1110 | /// TechnicalImpact
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1110 - /// TechnicalImpact
|
|
1110 + /// `TechnicalImpact`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1126:5
|
|
|
|
|
1126 | /// ComplianceImpact
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1126 - /// ComplianceImpact
|
|
1126 + /// `ComplianceImpact`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1140:5
|
|
|
|
|
1140 | /// ImpactLevel
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1140 - /// ImpactLevel
|
|
1140 + /// `ImpactLevel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1158:5
|
|
|
|
|
1158 | /// ImplementationPlan
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1158 - /// ImplementationPlan
|
|
1158 + /// `ImplementationPlan`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1176:5
|
|
|
|
|
1176 | /// ImplementationStep
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1176 - /// ImplementationStep
|
|
1176 + /// `ImplementationStep`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1196:5
|
|
|
|
|
1196 | /// RollbackPlan
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1196 - /// RollbackPlan
|
|
1196 + /// `RollbackPlan`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1212:5
|
|
|
|
|
1212 | /// RollbackStep
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1212 - /// RollbackStep
|
|
1212 + /// `RollbackStep`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1228:5
|
|
|
|
|
1228 | /// ChangeApprovalStatus
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1228 - /// ChangeApprovalStatus
|
|
1228 + /// `ChangeApprovalStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1244:5
|
|
|
|
|
1244 | /// ChangeImplementationStatus
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1244 - /// ChangeImplementationStatus
|
|
1244 + /// `ChangeImplementationStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1262:5
|
|
|
|
|
1262 | /// ChangeApprovalEngine
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1262 - /// ChangeApprovalEngine
|
|
1262 + /// `ChangeApprovalEngine`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1273:5
|
|
|
|
|
1273 | /// ApprovalRecord
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1273 - /// ApprovalRecord
|
|
1273 + /// `ApprovalRecord`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1294:5
|
|
|
|
|
1294 | /// ApprovalDecision
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1294 - /// ApprovalDecision
|
|
1294 + /// `ApprovalDecision`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1310:5
|
|
|
|
|
1310 | /// ChangeImpactAnalyzer
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1310 - /// ChangeImpactAnalyzer
|
|
1310 + /// `ChangeImpactAnalyzer`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1321:5
|
|
|
|
|
1321 | /// ImpactModel
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1321 - /// ImpactModel
|
|
1321 + /// `ImpactModel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1338:5
|
|
|
|
|
1338 | /// DependencyGraph
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1338 - /// DependencyGraph
|
|
1338 + /// `DependencyGraph`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1350:5
|
|
|
|
|
1350 | /// DependencyNode
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1350 - /// DependencyNode
|
|
1350 + /// `DependencyNode`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1364:5
|
|
|
|
|
1364 | /// DependencyEdge
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1364 - /// DependencyEdge
|
|
1364 + /// `DependencyEdge`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1380:5
|
|
|
|
|
1380 | /// AccessControlMatrix
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1380 - /// AccessControlMatrix
|
|
1380 + /// `AccessControlMatrix`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1392:5
|
|
|
|
|
1392 | /// UserRoleAssignment
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1392 - /// UserRoleAssignment
|
|
1392 + /// `UserRoleAssignment`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1411:5
|
|
|
|
|
1411 | /// AssignedRole
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1411 - /// AssignedRole
|
|
1411 + /// `AssignedRole`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1429:5
|
|
|
|
|
1429 | /// AssignmentStatus
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1429 - /// AssignmentStatus
|
|
1429 + /// `AssignmentStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1447:5
|
|
|
|
|
1447 | /// RolePermissions
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1447 - /// RolePermissions
|
|
1447 + /// `RolePermissions`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1465:5
|
|
|
|
|
1465 | /// AccessReview
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1465 - /// AccessReview
|
|
1465 + /// `AccessReview`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1487:5
|
|
|
|
|
1487 | /// AccessReviewType
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1487 - /// AccessReviewType
|
|
1487 + /// `AccessReviewType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1503:5
|
|
|
|
|
1503 | /// ReviewScope
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1503 - /// ReviewScope
|
|
1503 + /// `ReviewScope`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1519:5
|
|
|
|
|
1519 | /// ReviewPeriod
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1519 - /// ReviewPeriod
|
|
1519 + /// `ReviewPeriod`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1531:5
|
|
|
|
|
1531 | /// AccessReviewFinding
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1531 - /// AccessReviewFinding
|
|
1531 + /// `AccessReviewFinding`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1553:5
|
|
|
|
|
1553 | /// AccessFindingType
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1553 - /// AccessFindingType
|
|
1553 + /// `AccessFindingType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1573:5
|
|
|
|
|
1573 | /// ReviewStatus
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1573 - /// ReviewStatus
|
|
1573 + /// `ReviewStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1589:5
|
|
|
|
|
1589 | /// SOXAuditLogger
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1589 - /// SOXAuditLogger
|
|
1589 + /// `SOXAuditLogger`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1600:5
|
|
|
|
|
1600 | /// SOXAuditEvent
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1600 - /// SOXAuditEvent
|
|
1600 + /// `SOXAuditEvent`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1626:5
|
|
|
|
|
1626 | /// SOXEventType
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1626 - /// SOXEventType
|
|
1626 + /// `SOXEventType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1656:5
|
|
|
|
|
1656 | /// EventOutcome
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1656 - /// EventOutcome
|
|
1656 + /// `EventOutcome`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1672:5
|
|
|
|
|
1672 | /// AuditRetentionPolicy
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1672 - /// AuditRetentionPolicy
|
|
1672 + /// `AuditRetentionPolicy`
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1708:48
|
|
|
|
|
1708 | ... target_roles: vec!["supervisor".to_string()],
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"supervisor".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1713:48
|
|
|
|
|
1713 | ... target_roles: vec!["manager".to_string()],
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"manager".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1724:48
|
|
|
|
|
1724 | ... target_roles: vec!["cfo".to_string()],
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"cfo".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1729:48
|
|
|
|
|
1729 | ... target_roles: vec!["ceo".to_string()],
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"ceo".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1740:48
|
|
|
|
|
1740 | ... target_roles: vec!["director".to_string()],
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `"director".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: `to_string` applied to a type that implements `Display` in `format!` args
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1799:60
|
|
|
|
|
1799 | certification_id: format!("CERT-{}-{}", officer.to_string(), Utc::now().timestamp()),
|
|
| ^^^^^^^^^^^^ help: remove this
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
|
|
= note: `-W clippy::to-string-in-format-args` implied by `-W clippy::all`
|
|
= help: to override `-W clippy::all` add `#[allow(clippy::to_string_in_format_args)]`
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1803:29
|
|
|
|
|
1803 | start_date: Utc::now() - Duration::days(90),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1808:37
|
|
|
|
|
1808 | deficiencies_disclosed: assessment.material_weaknesses.len() + assessment.significant_deficiencies.len(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: this could be a `const fn`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1814:5
|
|
|
|
|
1814 | / fn calculate_overall_compliance_score(&self, _controls: &str, _sod: &str, _change: &str, _access: &str) -> f64 {
|
|
1815 | | 85.0 // Placeholder score
|
|
1816 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
1814 | const fn calculate_overall_compliance_score(&self, _controls: &str, _sod: &str, _change: &str, _access: &str) -> f64 {
|
|
| +++++
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1821:36
|
|
|
|
|
1821 | recommendation_id: "REC-001".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"REC-001".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1822:27
|
|
|
|
|
1822 | category: "Internal Controls".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Internal Controls".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1823:27
|
|
|
|
|
1823 | priority: "High".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"High".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1824:30
|
|
|
|
|
1824 | description: "Implement automated control testing".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Implement automated control testing".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1825:30
|
|
|
|
|
1825 | target_date: Utc::now() + Duration::days(90),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1833:33
|
|
|
|
|
1833 | assertion_type: "Design Effectiveness".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Design Effectiveness".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1834:28
|
|
|
|
|
1834 | statement: "Internal controls are properly designed".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Internal controls are properly designed".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1845:9
|
|
|
|
|
1845 | "I certify that the internal controls over financial reporting are effective.".to_string()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"I certify that the internal controls over financial reporting are effective.".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: implementation of inherent method `to_string(&self) -> String` for type `compliance::sox_compliance::SOXComplianceManager`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1849:5
|
|
|
|
|
1849 | / fn to_string(&self) -> String {
|
|
1850 | | "SOXComplianceManager".to_string()
|
|
1851 | | }
|
|
| |_____^
|
|
|
|
|
= help: implement trait `Display` for type `compliance::sox_compliance::SOXComplianceManager` instead
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1850:9
|
|
|
|
|
1850 | "SOXComplianceManager".to_string()
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"SOXComplianceManager".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1856:5
|
|
|
|
|
1856 | /// SOXComplianceAssessment
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1856 - /// SOXComplianceAssessment
|
|
1856 + /// `SOXComplianceAssessment`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1881:5
|
|
|
|
|
1881 | /// ComplianceRecommendation
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1881 - /// ComplianceRecommendation
|
|
1881 + /// `ComplianceRecommendation`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1898:5
|
|
|
|
|
1898 | /// ManagementCertificationReport
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1898 - /// ManagementCertificationReport
|
|
1898 + /// `ManagementCertificationReport`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1921:5
|
|
|
|
|
1921 | /// CertificationPeriod
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1921 - /// CertificationPeriod
|
|
1921 + /// `CertificationPeriod`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1932:5
|
|
|
|
|
1932 | /// ComplianceAssertion
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1932 - /// ComplianceAssertion
|
|
1932 + /// `ComplianceAssertion`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1945:5
|
|
|
|
|
1945 | /// MaterialChange
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1945 - /// MaterialChange
|
|
1945 + /// `MaterialChange`
|
|
|
|
|
|
|
warning: you should consider adding a `Default` implementation for `InternalControlsEngine`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1961:5
|
|
|
|
|
1961 | / pub fn new() -> Self {
|
|
1962 | | Self {
|
|
1963 | | controls_catalog: HashMap::new(),
|
|
1964 | | control_testing: ControlTestingEngine::new(),
|
|
... |
|
|
1967 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
1960 + impl Default for InternalControlsEngine {
|
|
1961 + fn default() -> Self {
|
|
1962 + Self::new()
|
|
1963 + }
|
|
1964 + }
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1970:12
|
|
|
|
|
1970 | Ok("Controls are operating effectively".to_string())
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Controls are operating effectively".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: you should consider adding a `Default` implementation for `ControlTestingEngine`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1983:5
|
|
|
|
|
1983 | / pub fn new() -> Self {
|
|
1984 | | Self {
|
|
1985 | | test_schedules: HashMap::new(),
|
|
1986 | | test_results: Vec::new(),
|
|
1987 | | }
|
|
1988 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
1982 + impl Default for ControlTestingEngine {
|
|
1983 + fn default() -> Self {
|
|
1984 + Self::new()
|
|
1985 + }
|
|
1986 + }
|
|
|
|
|
|
|
warning: you should consider adding a `Default` implementation for `DeficiencyTracker`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:1992:5
|
|
|
|
|
1992 | / pub fn new() -> Self {
|
|
1993 | | Self {
|
|
1994 | | deficiencies: HashMap::new(),
|
|
1995 | | metrics: DeficiencyMetrics {
|
|
... |
|
|
2004 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
1991 + impl Default for DeficiencyTracker {
|
|
1992 + fn default() -> Self {
|
|
1993 + Self::new()
|
|
1994 + }
|
|
1995 + }
|
|
|
|
|
|
|
warning: you should consider adding a `Default` implementation for `SegregationOfDutiesManager`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2008:5
|
|
|
|
|
2008 | / pub fn new() -> Self {
|
|
2009 | | Self {
|
|
2010 | | sod_matrix: SegregationMatrix {
|
|
2011 | | roles: HashMap::new(),
|
|
... |
|
|
2018 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
2007 + impl Default for SegregationOfDutiesManager {
|
|
2008 + fn default() -> Self {
|
|
2009 + Self::new()
|
|
2010 + }
|
|
2011 + }
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2021:12
|
|
|
|
|
2021 | Ok("Segregation of duties is properly maintained".to_string())
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Segregation of duties is properly maintained".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: you should consider adding a `Default` implementation for `ConflictDetector`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2026:5
|
|
|
|
|
2026 | / pub fn new() -> Self {
|
|
2027 | | Self {
|
|
2028 | | detection_rules: Vec::new(),
|
|
2029 | | active_conflicts: Vec::new(),
|
|
2030 | | }
|
|
2031 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
2025 + impl Default for ConflictDetector {
|
|
2026 + fn default() -> Self {
|
|
2027 + Self::new()
|
|
2028 + }
|
|
2029 + }
|
|
|
|
|
|
|
warning: this could be a `const fn`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2026:5
|
|
|
|
|
2026 | / pub fn new() -> Self {
|
|
2027 | | Self {
|
|
2028 | | detection_rules: Vec::new(),
|
|
2029 | | active_conflicts: Vec::new(),
|
|
2030 | | }
|
|
2031 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
2026 | pub const fn new() -> Self {
|
|
| +++++
|
|
|
|
warning: you should consider adding a `Default` implementation for `ChangeManagementSystem`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2035:5
|
|
|
|
|
2035 | / pub fn new() -> Self {
|
|
2036 | | Self {
|
|
2037 | | change_requests: HashMap::new(),
|
|
2038 | | approval_engine: ChangeApprovalEngine::new(),
|
|
... |
|
|
2041 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
2034 + impl Default for ChangeManagementSystem {
|
|
2035 + fn default() -> Self {
|
|
2036 + Self::new()
|
|
2037 + }
|
|
2038 + }
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2044:12
|
|
|
|
|
2044 | Ok("Change management controls are effective".to_string())
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Change management controls are effective".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: you should consider adding a `Default` implementation for `ChangeApprovalEngine`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2049:5
|
|
|
|
|
2049 | / pub fn new() -> Self {
|
|
2050 | | Self {
|
|
2051 | | approval_workflows: HashMap::new(),
|
|
2052 | | approval_history: Vec::new(),
|
|
2053 | | }
|
|
2054 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
2048 + impl Default for ChangeApprovalEngine {
|
|
2049 + fn default() -> Self {
|
|
2050 + Self::new()
|
|
2051 + }
|
|
2052 + }
|
|
|
|
|
|
|
warning: you should consider adding a `Default` implementation for `ChangeImpactAnalyzer`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2058:5
|
|
|
|
|
2058 | / pub fn new() -> Self {
|
|
2059 | | Self {
|
|
2060 | | impact_models: HashMap::new(),
|
|
2061 | | dependency_graph: DependencyGraph {
|
|
... |
|
|
2066 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
2057 + impl Default for ChangeImpactAnalyzer {
|
|
2058 + fn default() -> Self {
|
|
2059 + Self::new()
|
|
2060 + }
|
|
2061 + }
|
|
|
|
|
|
|
warning: you should consider adding a `Default` implementation for `AccessControlMatrix`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2070:5
|
|
|
|
|
2070 | / pub fn new() -> Self {
|
|
2071 | | Self {
|
|
2072 | | user_roles: HashMap::new(),
|
|
2073 | | role_permissions: HashMap::new(),
|
|
... |
|
|
2076 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
2069 + impl Default for AccessControlMatrix {
|
|
2070 + fn default() -> Self {
|
|
2071 + Self::new()
|
|
2072 + }
|
|
2073 + }
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2079:12
|
|
|
|
|
2079 | Ok("Access controls are properly implemented".to_string())
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Access controls are properly implemented".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2089:35
|
|
|
|
|
2089 | archive_location: "sox_audit_archive".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"sox_audit_archive".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: redundant clone
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2099:36
|
|
|
|
|
2099 | self.audit_trail.push(event.clone());
|
|
| ^^^^^^^^ help: remove this
|
|
|
|
|
note: this value is dropped without further use
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2099:31
|
|
|
|
|
2099 | self.audit_trail.push(event.clone());
|
|
| ^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
|
|
= note: requested on the command line with `-W clippy::redundant-clone`
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2116:23
|
|
|
|
|
2116 | resource: control_id.to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `control_id.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: wildcard match will also match any future added variants
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2121:17
|
|
|
|
|
2121 | _ => EventOutcome::Failure,
|
|
| ^ help: try: `TestConclusion::SignificantDeficiency | TestConclusion::MaterialWeakness | TestConclusion::NotOperating`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_enum_match_arm
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2136:20
|
|
|
|
|
2136 | actor: "system".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `"system".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2160:20
|
|
|
|
|
2160 | actor: user_id.to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `user_id.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2161:23
|
|
|
|
|
2161 | resource: resource.to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `resource.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2164:32
|
|
|
|
|
2164 | details.insert("action".to_string(), serde_json::Value::String(action.to_string()));
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `"action".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2164:80
|
|
|
|
|
2164 | details.insert("action".to_string(), serde_json::Value::String(action.to_string()));
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `action.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2184:5
|
|
|
|
|
2184 | fn serialize_test_result(&self, test_result: &ControlTestResult) -> Result<HashMap<String, serde_json::Value>, SOXComplianceError> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
2184 - fn serialize_test_result(&self, test_result: &ControlTestResult) -> Result<HashMap<String, serde_json::Value>, SOXComplianceError> {
|
|
2184 + fn serialize_test_result(&self, test_result: &ControlTestResult) -> std::collections::HashMap<std::string::String, serde_json::Value> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
2190 - Ok(details)
|
|
2190 + details
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2186:24
|
|
|
|
|
2186 | details.insert("test_id".to_string(), serde_json::Value::String(test_result.test_id.clone()));
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `"test_id".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2187:24
|
|
|
|
|
2187 | details.insert("conclusion".to_string(), serde_json::json!(test_result.conclusion));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"conclusion".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2188:24
|
|
|
|
|
2188 | details.insert("evidence_count".to_string(), serde_json::Value::Number(serde_json::Number::from(test_result.evidence.len())));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"evidence_count".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: this function's return value is unnecessarily wrapped by `Result`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2194:5
|
|
|
|
|
2194 | fn serialize_deficiency(&self, deficiency: &ControlDeficiency) -> Result<HashMap<String, serde_json::Value>, SOXComplianceError> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
|
help: remove `Result` from the return type...
|
|
|
|
|
2194 - fn serialize_deficiency(&self, deficiency: &ControlDeficiency) -> Result<HashMap<String, serde_json::Value>, SOXComplianceError> {
|
|
2194 + fn serialize_deficiency(&self, deficiency: &ControlDeficiency) -> std::collections::HashMap<std::string::String, serde_json::Value> {
|
|
|
|
|
help: ...and then remove the surrounding `Ok()` from returning expressions
|
|
|
|
|
2200 - Ok(details)
|
|
2200 + details
|
|
|
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2196:24
|
|
|
|
|
2196 | details.insert("severity".to_string(), serde_json::json!(deficiency.severity));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `"severity".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2197:24
|
|
|
|
|
2197 | details.insert("description".to_string(), serde_json::Value::String(deficiency.description.clone()));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"description".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2198:24
|
|
|
|
|
2198 | details.insert("root_cause".to_string(), serde_json::Value::String(deficiency.root_cause.clone()));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"root_cause".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/sox_compliance.rs:2218:5
|
|
|
|
|
2218 | /// SOXComplianceError
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2218 - /// SOXComplianceError
|
|
2218 + /// `SOXComplianceError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:4:33
|
|
|
|
|
4 | //! regulatory reports for SOX, MiFID II, and other compliance requirements.
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
4 - //! regulatory reports for SOX, MiFID II, and other compliance requirements.
|
|
4 + //! regulatory reports for SOX, `MiFID` II, and other compliance requirements.
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:25:5
|
|
|
|
|
25 | /// AutomatedReportingSystem
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
25 - /// AutomatedReportingSystem
|
|
25 + /// `AutomatedReportingSystem`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:41:5
|
|
|
|
|
41 | /// AutomatedReportingConfig
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
41 - /// AutomatedReportingConfig
|
|
41 + /// `AutomatedReportingConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:63:5
|
|
|
|
|
63 | /// ReportSchedule
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
63 - /// ReportSchedule
|
|
63 + /// `ReportSchedule`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:91:5
|
|
|
|
|
91 | /// ScheduledReportType
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
91 - /// ScheduledReportType
|
|
91 + /// `ScheduledReportType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:95:9
|
|
|
|
|
95 | /// MiFID II transaction reports
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
95 - /// MiFID II transaction reports
|
|
95 + /// `MiFID` II transaction reports
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:97:9
|
|
|
|
|
97 | /// MiFID II best execution reports
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
97 - /// MiFID II best execution reports
|
|
97 + /// `MiFID` II best execution reports
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:99:9
|
|
|
|
|
99 | /// MiFID II transparency reports
|
|
| ^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
99 - /// MiFID II transparency reports
|
|
99 + /// `MiFID` II transparency reports
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:115:5
|
|
|
|
|
115 | /// QualityCheck
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
115 - /// QualityCheck
|
|
115 + /// `QualityCheck`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:135:5
|
|
|
|
|
135 | /// QualityCheckType
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
135 - /// QualityCheckType
|
|
135 + /// `QualityCheckType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:157:5
|
|
|
|
|
157 | /// QualityCheckSeverity
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
157 - /// QualityCheckSeverity
|
|
157 + /// `QualityCheckSeverity`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:173:5
|
|
|
|
|
173 | /// SubmissionSettings
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
173 - /// SubmissionSettings
|
|
173 + /// `SubmissionSettings`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:193:5
|
|
|
|
|
193 | /// AuthoritySubmissionSettings
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
193 - /// AuthoritySubmissionSettings
|
|
193 + /// `AuthoritySubmissionSettings`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:211:5
|
|
|
|
|
211 | /// SubmissionMethod
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
211 - /// SubmissionMethod
|
|
211 + /// `SubmissionMethod`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:229:5
|
|
|
|
|
229 | /// NotificationSettings
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
229 - /// NotificationSettings
|
|
229 + /// `NotificationSettings`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:245:5
|
|
|
|
|
245 | /// NotificationChannel
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
245 - /// NotificationChannel
|
|
245 + /// `NotificationChannel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:277:5
|
|
|
|
|
277 | /// NotificationLevel
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
277 - /// NotificationLevel
|
|
277 + /// `NotificationLevel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:293:5
|
|
|
|
|
293 | /// EscalationSettings
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
293 - /// EscalationSettings
|
|
293 + /// `EscalationSettings`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:307:5
|
|
|
|
|
307 | /// EscalationLevel
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
307 - /// EscalationLevel
|
|
307 + /// `EscalationLevel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:323:5
|
|
|
|
|
323 | /// QualityAssuranceSettings
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
323 - /// QualityAssuranceSettings
|
|
323 + /// `QualityAssuranceSettings`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:341:5
|
|
|
|
|
341 | /// RetrySettings
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
341 - /// RetrySettings
|
|
341 + /// `RetrySettings`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:359:5
|
|
|
|
|
359 | /// RetryCondition
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
359 - /// RetryCondition
|
|
359 + /// `RetryCondition`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:373:5
|
|
|
|
|
373 | /// RetryPolicy
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
373 - /// RetryPolicy
|
|
373 + /// `RetryPolicy`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:387:5
|
|
|
|
|
387 | /// MonitoringSettings
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
387 - /// MonitoringSettings
|
|
387 + /// `MonitoringSettings`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:403:5
|
|
|
|
|
403 | /// PerformanceThresholds
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
403 - /// PerformanceThresholds
|
|
403 + /// `PerformanceThresholds`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:419:5
|
|
|
|
|
419 | /// AlertSettings
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
419 - /// AlertSettings
|
|
419 + /// `AlertSettings`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:433:5
|
|
|
|
|
433 | /// AlertCondition
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
433 - /// AlertCondition
|
|
433 + /// `AlertCondition`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:451:5
|
|
|
|
|
451 | /// ComparisonOperator
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
451 - /// ComparisonOperator
|
|
451 + /// `ComparisonOperator`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:467:5
|
|
|
|
|
467 | /// ReportScheduler
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
467 - /// ReportScheduler
|
|
467 + /// `ReportScheduler`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:477:5
|
|
|
|
|
477 | /// CronJob
|
|
| ^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
477 - /// CronJob
|
|
477 + /// `CronJob`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:493:5
|
|
|
|
|
493 | /// ReportGenerators
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
493 - /// ReportGenerators
|
|
493 + /// `ReportGenerators`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:506:5
|
|
|
|
|
506 | /// SubmissionEngine
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
506 - /// SubmissionEngine
|
|
506 + /// `SubmissionEngine`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:518:5
|
|
|
|
|
518 | /// SubmissionTask
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
518 - /// SubmissionTask
|
|
518 + /// `SubmissionTask`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:542:5
|
|
|
|
|
542 | /// TaskPriority
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
542 - /// TaskPriority
|
|
542 + /// `TaskPriority`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:558:5
|
|
|
|
|
558 | /// GeneratedReport
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
558 - /// GeneratedReport
|
|
558 + /// `GeneratedReport`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:580:5
|
|
|
|
|
580 | /// ValidationResult
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
580 - /// ValidationResult
|
|
580 + /// `ValidationResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:600:5
|
|
|
|
|
600 | /// ActiveSubmission
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
600 - /// ActiveSubmission
|
|
600 + /// `ActiveSubmission`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:618:5
|
|
|
|
|
618 | /// SubmissionStatus
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
618 - /// SubmissionStatus
|
|
618 + /// `SubmissionStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:636:5
|
|
|
|
|
636 | /// NotificationService
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
636 - /// NotificationService
|
|
636 + /// `NotificationService`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:647:5
|
|
|
|
|
647 | /// NotificationTask
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
647 - /// NotificationTask
|
|
647 + /// `NotificationTask`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:669:5
|
|
|
|
|
669 | /// ReportingMonitoring
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
669 - /// ReportingMonitoring
|
|
669 + /// `ReportingMonitoring`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:680:5
|
|
|
|
|
680 | /// ReportingMetrics
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
680 - /// ReportingMetrics
|
|
680 + /// `ReportingMetrics`
|
|
|
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:764:9
|
|
|
|
|
764 | println!("Starting automated regulatory reporting system...");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:769:9
|
|
|
|
|
769 | println!("Automated reporting system started successfully");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:770:9
|
|
|
|
|
770 | println!("Active schedules: {}", self.config.schedules.len());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:793:70
|
|
|
|
|
793 | .ok_or_else(|| AutomatedReportingError::ScheduleNotFound(schedule_id.to_string()))?;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `schedule_id.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: infinite loop detected
|
|
--> trading_engine/src/compliance/automated_reporting.rs:818:13
|
|
|
|
|
818 | / loop {
|
|
819 | | interval.tick().await;
|
|
... |
|
|
837 | | }
|
|
| |_____________^
|
|
|
|
|
= help: if this is not intended, try adding a `break` or `return` condition in the loop
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#infinite_loop
|
|
|
|
warning: use of `println!`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:829:25
|
|
|
|
|
829 | println!("Processing due schedule: {} ({})", schedule.name, schedule.schedule_id);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:833:29
|
|
|
|
|
833 | ... eprintln!("Failed to mark schedule as processed: {}", e);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
error: infinite loop detected
|
|
--> trading_engine/src/compliance/automated_reporting.rs:849:13
|
|
|
|
|
849 | / loop {
|
|
850 | | interval.tick().await;
|
|
... |
|
|
856 | | }
|
|
| |_____________^
|
|
|
|
|
= help: if this is not intended, try adding a `break` or `return` condition in the loop
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#infinite_loop
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:854:21
|
|
|
|
|
854 | eprintln!("Error processing submissions: {}", e);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
error: infinite loop detected
|
|
--> trading_engine/src/compliance/automated_reporting.rs:865:13
|
|
|
|
|
865 | / loop {
|
|
866 | | interval.tick().await;
|
|
... |
|
|
872 | | }
|
|
| |_____________^
|
|
|
|
|
= help: if this is not intended, try adding a `break` or `return` condition in the loop
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#infinite_loop
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:870:21
|
|
|
|
|
870 | eprintln!("Error updating metrics: {}", e);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/automated_reporting.rs:887:43
|
|
|
|
|
887 | "transactions_count": 1000,
|
|
| ^^^^ help: consider adding suffix: `1_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/automated_reporting.rs:896:41
|
|
|
|
|
896 | "compliance_score": 95.5,
|
|
| ^^^^ help: consider adding suffix: `95.5_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
error: wildcard match will also match any future added variants
|
|
--> trading_engine/src/compliance/automated_reporting.rs:900:13
|
|
|
|
|
900 | _ => {
|
|
| ^ help: try: `ScheduledReportType::BestExecutionReports | ScheduledReportType::TransparencyReports | ScheduledReportType::SOXManagementCertification | ScheduledReportType::AuditTrailSummary | ScheduledReportType::RiskManagementReports | ScheduledReportType::Custom{ .. }`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_enum_match_arm
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/automated_reporting.rs:920:31
|
|
|
|
|
920 | let generation_time = start_time.elapsed().as_millis() as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
error: wildcard match will also match any future added variants
|
|
--> trading_engine/src/compliance/automated_reporting.rs:936:13
|
|
|
|
|
936 | _ => ReportingPeriod {
|
|
| ^ help: try: `ScheduledReportType::BestExecutionReports | ScheduledReportType::TransparencyReports | ScheduledReportType::SOXComplianceAssessment | ScheduledReportType::SOXManagementCertification | ScheduledReportType::AuditTrailSummary | ScheduledReportType::RiskManagementReports | ScheduledReportType::Custom{ .. }`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_enum_match_arm
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/automated_reporting.rs:932:29
|
|
|
|
|
932 | start_date: now.date_naive().and_hms_opt(0, 0, 0).unwrap().and_utc() - Duration::days(1),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: used `unwrap()` on an `Option` value
|
|
--> trading_engine/src/compliance/automated_reporting.rs:932:29
|
|
|
|
|
932 | start_date: now.date_naive().and_hms_opt(0, 0, 0).unwrap().and_utc() - Duration::days(1),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: if this value is `None`, it will panic
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
|
note: the lint level is defined here
|
|
--> trading_engine/src/compliance/automated_reporting.rs:7:9
|
|
|
|
|
7 | #![deny(clippy::unwrap_used, clippy::expect_used)]
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap()` on an `Option` value
|
|
--> trading_engine/src/compliance/automated_reporting.rs:933:27
|
|
|
|
|
933 | end_date: now.date_naive().and_hms_opt(0, 0, 0).unwrap().and_utc(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: if this value is `None`, it will panic
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/automated_reporting.rs:937:29
|
|
|
|
|
937 | start_date: now - Duration::days(1),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1022:66
|
|
|
|
|
1022 | return Err(AutomatedReportingError::ScheduleNotFound(schedule_id.to_string()));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `schedule_id.to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1126:26
|
|
|
|
|
1126 | let batch_size = self.config.batch_size as usize;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1166:13
|
|
|
|
|
1166 | task.current_attempts += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1212:30
|
|
|
|
|
1212 | let one_minute_ago = Utc::now() - Duration::minutes(1);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1218:30
|
|
|
|
|
1218 | recent_submissions < rate_limit as usize
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: the function has a cognitive complexity of (37/30)
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1242:14
|
|
|
|
|
1242 | async fn execute_submission(
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cognitive_complexity
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1326:9
|
|
|
|
|
1326 | metrics.total_reports_generated += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1328:13
|
|
|
|
|
1328 | / (metrics.average_generation_time_ms * (metrics.total_reports_generated - 1) as f64 + generation_time_ms) /
|
|
1329 | | metrics.total_reports_generated as f64;
|
|
| |__________________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1328:51
|
|
|
|
|
1328 | (metrics.average_generation_time_ms * (metrics.total_reports_generated - 1) as f64 + generation_time_ms) /
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1328:51
|
|
|
|
|
1328 | (metrics.average_generation_time_ms * (metrics.total_reports_generated - 1) as f64 + generation_time_ms) /
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1329:13
|
|
|
|
|
1329 | metrics.total_reports_generated as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1340:85
|
|
|
|
|
1340 | (metrics.total_reports_submitted as f64 / total_completed as f64) * 100.0;
|
|
| ^^^^^ help: consider adding suffix: `100.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1337:31
|
|
|
|
|
1337 | let total_completed = metrics.total_reports_submitted + metrics.total_submission_failures;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1340:17
|
|
|
|
|
1340 | (metrics.total_reports_submitted as f64 / total_completed as f64) * 100.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1340:18
|
|
|
|
|
1340 | (metrics.total_reports_submitted as f64 / total_completed as f64) * 100.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1340:59
|
|
|
|
|
1340 | (metrics.total_reports_submitted as f64 / total_completed as f64) * 100.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1378:70
|
|
|
|
|
1378 | let avg_gen_time_secs = metrics.average_generation_time_ms / 1000.0;
|
|
| ^^^^^^ help: consider adding suffix: `1_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1388:70
|
|
|
|
|
1388 | let avg_sub_time_secs = metrics.average_submission_time_ms / 1000.0;
|
|
| ^^^^^^ help: consider adding suffix: `1_000.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1378:33
|
|
|
|
|
1378 | let avg_gen_time_secs = metrics.average_generation_time_ms / 1000.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1379:32
|
|
|
|
|
1379 | if avg_gen_time_secs > thresholds.max_generation_time_seconds as f64 {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1388:33
|
|
|
|
|
1388 | let avg_sub_time_secs = metrics.average_submission_time_ms / 1000.0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1389:32
|
|
|
|
|
1389 | if avg_sub_time_secs > thresholds.max_submission_time_seconds as f64 {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1403:9
|
|
|
|
|
1403 | metrics.total_reports_submitted += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1409:17
|
|
|
|
|
1409 | (metrics.average_submission_time_ms * (total - 1) as f64 + submission_time_ms) / total as f64;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1409:55
|
|
|
|
|
1409 | (metrics.average_submission_time_ms * (total - 1) as f64 + submission_time_ms) / total as f64;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1409:55
|
|
|
|
|
1409 | (metrics.average_submission_time_ms * (total - 1) as f64 + submission_time_ms) / total as f64;
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1409:98
|
|
|
|
|
1409 | (metrics.average_submission_time_ms * (total - 1) as f64 + submission_time_ms) / total as f64;
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1420:9
|
|
|
|
|
1420 | metrics.total_submission_failures += 1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1446:34
|
|
|
|
|
1446 | schedule_id: "daily_mifid_reports".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"daily_mifid_reports".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1447:27
|
|
|
|
|
1447 | name: "Daily MiFID II Transaction Reports".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Daily MiFID II Transaction Reports".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1449:38
|
|
|
|
|
1449 | cron_expression: "0 18 * * *".to_string(), // Daily at 6 PM
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"0 18 * * *".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1450:31
|
|
|
|
|
1450 | timezone: "UTC".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"UTC".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1452:46
|
|
|
|
|
1452 | target_authorities: vec!["ESMA".to_string()],
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `"ESMA".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1455:51
|
|
|
|
|
1455 | notification_recipients: vec!["compliance@foxhunt.com".to_string()],
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"compliance@foxhunt.com".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1458:34
|
|
|
|
|
1458 | schedule_id: "quarterly_sox_assessment".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"quarterly_sox_assessment".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1459:27
|
|
|
|
|
1459 | name: "Quarterly SOX Compliance Assessment".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"Quarterly SOX Compliance Assessment".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1461:38
|
|
|
|
|
1461 | cron_expression: "0 9 1 */3 *".to_string(), // First day of quarter at 9 AM
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"0 9 1 */3 *".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1462:31
|
|
|
|
|
1462 | timezone: "UTC".to_string(),
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"UTC".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1464:46
|
|
|
|
|
1464 | target_authorities: vec!["SEC".to_string()],
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"SEC".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1467:51
|
|
|
|
|
1467 | notification_recipients: vec!["compliance@foxhunt.com".to_string()],
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"compliance@foxhunt.com".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1492:33
|
|
|
|
|
1492 | reviewers: vec!["qa@foxhunt.com".to_string()],
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"qa@foxhunt.com".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
error: `to_string()` called on a `&str`
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1513:38
|
|
|
|
|
1513 | recipients: vec!["alerts@foxhunt.com".to_string()],
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"alerts@foxhunt.com".to_owned()`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/automated_reporting.rs:1523:5
|
|
|
|
|
1523 | /// AutomatedReportingError
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1523 - /// AutomatedReportingError
|
|
1523 + /// `AutomatedReportingError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:27:5
|
|
|
|
|
27 | /// RegulatoryApiConfig
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
27 - /// RegulatoryApiConfig
|
|
27 + /// `RegulatoryApiConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:53:5
|
|
|
|
|
53 | /// ApiKeyInfo
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
53 - /// ApiKeyInfo
|
|
53 + /// `ApiKeyInfo`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:71:5
|
|
|
|
|
71 | /// RateLimitConfig
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
71 - /// RateLimitConfig
|
|
71 + /// `RateLimitConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:87:5
|
|
|
|
|
87 | /// RegulatoryApiServer
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
87 - /// RegulatoryApiServer
|
|
87 + /// `RegulatoryApiServer`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:101:5
|
|
|
|
|
101 | /// RateLimiter
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
101 - /// RateLimiter
|
|
101 + /// `RateLimiter`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:111:5
|
|
|
|
|
111 | /// RateLimit
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
111 - /// RateLimit
|
|
111 + /// `RateLimit`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:121:5
|
|
|
|
|
121 | /// ApiContext
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
121 - /// ApiContext
|
|
121 + /// `ApiContext`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:139:5
|
|
|
|
|
139 | /// ApiResponse
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
139 - /// ApiResponse
|
|
139 + /// `ApiResponse`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:157:5
|
|
|
|
|
157 | /// ApiError
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
157 - /// ApiError
|
|
157 + /// `ApiError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:171:5
|
|
|
|
|
171 | /// TransactionReportRequest
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
171 - /// TransactionReportRequest
|
|
171 + /// `TransactionReportRequest`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:185:5
|
|
|
|
|
185 | /// TransactionReportResponse
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
185 - /// TransactionReportResponse
|
|
185 + /// `TransactionReportResponse`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:201:5
|
|
|
|
|
201 | /// SoxAuditQueryRequest
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
201 - /// SoxAuditQueryRequest
|
|
201 + /// `SoxAuditQueryRequest`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:219:5
|
|
|
|
|
219 | /// SoxAuditQueryResponse
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
219 - /// SoxAuditQueryResponse
|
|
219 + /// `SoxAuditQueryResponse`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:233:5
|
|
|
|
|
233 | /// BestExecutionAnalysisRequest
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
233 - /// BestExecutionAnalysisRequest
|
|
233 + /// `BestExecutionAnalysisRequest`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:247:5
|
|
|
|
|
247 | /// BestExecutionAnalysisResponse
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
247 - /// BestExecutionAnalysisResponse
|
|
247 + /// `BestExecutionAnalysisResponse`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:265:5
|
|
|
|
|
265 | /// VenueAnalysisResult
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
265 - /// VenueAnalysisResult
|
|
265 + /// `VenueAnalysisResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:285:5
|
|
|
|
|
285 | /// CostAnalysisResult
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
285 - /// CostAnalysisResult
|
|
285 + /// `CostAnalysisResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:301:5
|
|
|
|
|
301 | /// ComplianceStatusResponse
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
301 - /// ComplianceStatusResponse
|
|
301 + /// `ComplianceStatusResponse`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:317:5
|
|
|
|
|
317 | /// ComplianceFindingSummary
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
317 - /// ComplianceFindingSummary
|
|
317 + /// `ComplianceFindingSummary`
|
|
|
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/compliance/regulatory_api.rs:394:13
|
|
|
|
|
394 | eprintln!("HTTP API server would start on {}", bind_addr);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/compliance/regulatory_api.rs:395:13
|
|
|
|
|
395 | eprintln!("Available endpoints:");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/compliance/regulatory_api.rs:396:13
|
|
|
|
|
396 | eprintln!(" POST /api/v1/mifid2/transaction-reports");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/compliance/regulatory_api.rs:397:13
|
|
|
|
|
397 | eprintln!(" GET /api/v1/sox/audit-events");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/compliance/regulatory_api.rs:398:13
|
|
|
|
|
398 | eprintln!(" POST /api/v1/mifid2/best-execution-analysis");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/compliance/regulatory_api.rs:399:13
|
|
|
|
|
399 | eprintln!(" GET /api/v1/compliance/status");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
error: infinite loop detected
|
|
--> trading_engine/src/compliance/regulatory_api.rs:402:13
|
|
|
|
|
402 | / loop {
|
|
403 | | tokio::time::sleep(tokio::time::Duration::from_secs(3600)).await;
|
|
404 | | }
|
|
| |_____________^
|
|
|
|
|
= help: if this is not intended, try adding a `break` or `return` condition in the loop
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#infinite_loop
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/compliance/regulatory_api.rs:420:13
|
|
|
|
|
420 | eprintln!("gRPC API server would start on {}", bind_addr);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/compliance/regulatory_api.rs:421:13
|
|
|
|
|
421 | eprintln!("Available gRPC services:");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/compliance/regulatory_api.rs:422:13
|
|
|
|
|
422 | eprintln!(" RegulatoryReporting.SubmitTransactionReport");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/compliance/regulatory_api.rs:423:13
|
|
|
|
|
423 | eprintln!(" ComplianceAudit.QueryAuditEvents");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
warning: use of `eprintln!`
|
|
--> trading_engine/src/compliance/regulatory_api.rs:424:13
|
|
|
|
|
424 | eprintln!(" BestExecution.AnalyzeExecution");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stderr
|
|
|
|
error: infinite loop detected
|
|
--> trading_engine/src/compliance/regulatory_api.rs:427:13
|
|
|
|
|
427 | / loop {
|
|
428 | | tokio::time::sleep(tokio::time::Duration::from_secs(3600)).await;
|
|
429 | | }
|
|
| |_____________^
|
|
|
|
|
= help: if this is not intended, try adding a `break` or `return` condition in the loop
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#infinite_loop
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/regulatory_api.rs:527:32
|
|
|
|
|
527 | execution_time_ms: start_time.elapsed().as_millis() as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: redundant closure
|
|
--> trading_engine/src/compliance/regulatory_api.rs:559:65
|
|
|
|
|
559 | venue_analysis: request.include_venue_analysis.then(|| vec![]),
|
|
| ^^^^^^^^^ help: replace the closure with `Vec::new`: `std::vec::Vec::new`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/regulatory_api.rs:561:43
|
|
|
|
|
561 | total_cost: Decimal::from(10),
|
|
| ^^ help: consider adding suffix: `10_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/regulatory_api.rs:697:26
|
|
|
|
|
697 | let cutoff = now - Duration::minutes(1);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/regulatory_api.rs:703:36
|
|
|
|
|
703 | if limit.requests.len() >= self.config.requests_per_minute as usize {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/regulatory_api.rs:756:5
|
|
|
|
|
756 | /// RegulatoryApiError
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
756 - /// RegulatoryApiError
|
|
756 + /// `RegulatoryApiError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:65:5
|
|
|
|
|
65 | /// PostgreSQL database configuration for compliance data storage
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
65 - /// PostgreSQL database configuration for compliance data storage
|
|
65 + /// `PostgreSQL` database configuration for compliance data storage
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:68:5
|
|
|
|
|
68 | /// PostgreSQL database configuration
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
68 - /// PostgreSQL database configuration
|
|
68 + /// `PostgreSQL` database configuration
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:70:37
|
|
|
|
|
70 | /// Configuration for connecting to PostgreSQL database including connection pooling,
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
70 - /// Configuration for connecting to PostgreSQL database including connection pooling,
|
|
70 + /// Configuration for connecting to `PostgreSQL` database including connection pooling,
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:383:9
|
|
|
|
|
383 | /// PostgreSQL database dump format
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
383 - /// PostgreSQL database dump format
|
|
383 + /// `PostgreSQL` database dump format
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:505:5
|
|
|
|
|
505 | /// CloudKMSConfig
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
505 - /// CloudKMSConfig
|
|
505 + /// `CloudKMSConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:521:5
|
|
|
|
|
521 | /// KeyDerivationFunction
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
521 - /// KeyDerivationFunction
|
|
521 + /// `KeyDerivationFunction`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:535:5
|
|
|
|
|
535 | /// AuditVerificationConfig
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
535 - /// AuditVerificationConfig
|
|
535 + /// `AuditVerificationConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:553:5
|
|
|
|
|
553 | /// HashAlgorithm
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
553 - /// HashAlgorithm
|
|
553 + /// `HashAlgorithm`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:559:9
|
|
|
|
|
559 | /// SHA3_256 variant
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
559 - /// SHA3_256 variant
|
|
559 + /// `SHA3_256` variant
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:567:5
|
|
|
|
|
567 | /// SignatureAlgorithm
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
567 - /// SignatureAlgorithm
|
|
567 + /// `SignatureAlgorithm`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:575:9
|
|
|
|
|
575 | /// EcdsaP256 variant
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
575 - /// EcdsaP256 variant
|
|
575 + /// `EcdsaP256` variant
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:577:9
|
|
|
|
|
577 | /// EcdsaP384 variant
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
577 - /// EcdsaP384 variant
|
|
577 + /// `EcdsaP384` variant
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:585:5
|
|
|
|
|
585 | /// EventProcessor
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
585 - /// EventProcessor
|
|
585 + /// `EventProcessor`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:596:5
|
|
|
|
|
596 | /// EventEnricher
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
596 - /// EventEnricher
|
|
596 + /// `EventEnricher`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:608:5
|
|
|
|
|
608 | /// EnrichmentRule
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
608 - /// EnrichmentRule
|
|
608 + /// `EnrichmentRule`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:622:5
|
|
|
|
|
622 | /// EnrichmentAction
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
622 - /// EnrichmentAction
|
|
622 + /// `EnrichmentAction`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:645:5
|
|
|
|
|
645 | /// ClassificationRule
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
645 - /// ClassificationRule
|
|
645 + /// `ClassificationRule`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:657:5
|
|
|
|
|
657 | /// EventContext
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
657 - /// EventContext
|
|
657 + /// `EventContext`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:673:5
|
|
|
|
|
673 | /// UserInfo
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
673 - /// UserInfo
|
|
673 + /// `UserInfo`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:691:5
|
|
|
|
|
691 | /// SessionInfo
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
691 - /// SessionInfo
|
|
691 + /// `SessionInfo`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:709:5
|
|
|
|
|
709 | /// GeoLocation
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
709 - /// GeoLocation
|
|
709 + /// `GeoLocation`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:725:5
|
|
|
|
|
725 | /// SystemInfo
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
725 - /// SystemInfo
|
|
725 + /// `SystemInfo`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:741:5
|
|
|
|
|
741 | /// HostInfo
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
741 - /// HostInfo
|
|
741 + /// `HostInfo`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:757:5
|
|
|
|
|
757 | /// BusinessContext
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
757 - /// BusinessContext
|
|
757 + /// `BusinessContext`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:775:5
|
|
|
|
|
775 | /// BatchProcessor
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
775 - /// BatchProcessor
|
|
775 + /// `BatchProcessor`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:789:5
|
|
|
|
|
789 | /// ComplianceEvent
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
789 - /// ComplianceEvent
|
|
789 + /// `ComplianceEvent`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:823:5
|
|
|
|
|
823 | /// ComplianceEventType
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
823 - /// ComplianceEventType
|
|
823 + /// `ComplianceEventType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:861:5
|
|
|
|
|
861 | /// ComplianceCategory
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
861 - /// ComplianceCategory
|
|
861 + /// `ComplianceCategory`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:891:5
|
|
|
|
|
891 | /// ReportGenerator
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
891 - /// ReportGenerator
|
|
891 + /// `ReportGenerator`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:906:5
|
|
|
|
|
906 | /// TemplateEngine
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
906 - /// TemplateEngine
|
|
906 + /// `TemplateEngine`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:916:5
|
|
|
|
|
916 | /// ReportTemplate
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
916 - /// ReportTemplate
|
|
916 + /// `ReportTemplate`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:938:5
|
|
|
|
|
938 | /// ReportTemplateType
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
938 - /// ReportTemplateType
|
|
938 + /// `ReportTemplateType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:956:5
|
|
|
|
|
956 | /// TemplateParameter
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
956 - /// TemplateParameter
|
|
956 + /// `TemplateParameter`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:974:5
|
|
|
|
|
974 | /// ParameterType
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
974 - /// ParameterType
|
|
974 + /// `ParameterType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:998:5
|
|
|
|
|
998 | /// CompiledTemplate
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
998 - /// CompiledTemplate
|
|
998 + /// `CompiledTemplate`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1012:5
|
|
|
|
|
1012 | /// ReportScheduler
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1012 - /// ReportScheduler
|
|
1012 + /// `ReportScheduler`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1024:5
|
|
|
|
|
1024 | /// ReportSchedule
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1024 - /// ReportSchedule
|
|
1024 + /// `ReportSchedule`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1046:5
|
|
|
|
|
1046 | /// ScheduledJob
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1046 - /// ScheduledJob
|
|
1046 + /// `ScheduledJob`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1070:5
|
|
|
|
|
1070 | /// JobStatus
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1070 - /// JobStatus
|
|
1070 + /// `JobStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1088:5
|
|
|
|
|
1088 | /// ReportDistributor
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1088 - /// ReportDistributor
|
|
1088 + /// `ReportDistributor`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1100:5
|
|
|
|
|
1100 | /// DistributionJob
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1100 - /// DistributionJob
|
|
1100 + /// `DistributionJob`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1126:5
|
|
|
|
|
1126 | /// DistributionMethod
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1126 - /// DistributionMethod
|
|
1126 + /// `DistributionMethod`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1142:5
|
|
|
|
|
1142 | /// DistributionStatus
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1142 - /// DistributionStatus
|
|
1142 + /// `DistributionStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1160:5
|
|
|
|
|
1160 | /// ComplianceStorageManager
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1160 - /// ComplianceStorageManager
|
|
1160 + /// `ComplianceStorageManager`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1176:5
|
|
|
|
|
1176 | /// ArchivalEngine
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1176 - /// ArchivalEngine
|
|
1176 + /// `ArchivalEngine`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1186:5
|
|
|
|
|
1186 | /// ArchivalJob
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1186 - /// ArchivalJob
|
|
1186 + /// `ArchivalJob`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1210:5
|
|
|
|
|
1210 | /// ArchivalCriteria
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1210 - /// ArchivalCriteria
|
|
1210 + /// `ArchivalCriteria`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1226:5
|
|
|
|
|
1226 | /// ArchivalStatus
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1226 - /// ArchivalStatus
|
|
1226 + /// `ArchivalStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1242:5
|
|
|
|
|
1242 | /// CompressionEngine
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1242 - /// CompressionEngine
|
|
1242 + /// `CompressionEngine`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1255:5
|
|
|
|
|
1255 | /// EncryptionEngine
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1255 - /// EncryptionEngine
|
|
1255 + /// `EncryptionEngine`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1267:5
|
|
|
|
|
1267 | /// KeyManager
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1267 - /// KeyManager
|
|
1267 + /// `KeyManager`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1277:5
|
|
|
|
|
1277 | /// CryptoKey
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1277 - /// CryptoKey
|
|
1277 + /// `CryptoKey`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1295:5
|
|
|
|
|
1295 | /// KeyStatus
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1295 - /// KeyStatus
|
|
1295 + /// `KeyStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1311:5
|
|
|
|
|
1311 | /// RetentionPolicyManager
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1311 - /// RetentionPolicyManager
|
|
1311 + /// `RetentionPolicyManager`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1326:5
|
|
|
|
|
1326 | /// PolicyEngine
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1326 - /// PolicyEngine
|
|
1326 + /// `PolicyEngine`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1336:5
|
|
|
|
|
1336 | /// PolicyEvaluator
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1336 - /// PolicyEvaluator
|
|
1336 + /// `PolicyEvaluator`
|
|
|
|
|
|
|
error: found empty brackets on struct declaration
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1339:27
|
|
|
|
|
1339 | pub struct PolicyEvaluator {}
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_structs_with_brackets
|
|
= help: remove the brackets
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1343:5
|
|
|
|
|
1343 | /// EvaluationRule
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1343 - /// EvaluationRule
|
|
1343 + /// `EvaluationRule`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1357:5
|
|
|
|
|
1357 | /// RetentionAction
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1357 - /// RetentionAction
|
|
1357 + /// `RetentionAction`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1373:5
|
|
|
|
|
1373 | /// CleanupScheduler
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1373 - /// CleanupScheduler
|
|
1373 + /// `CleanupScheduler`
|
|
|
|
|
|
|
error: found empty brackets on struct declaration
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1376:28
|
|
|
|
|
1376 | pub struct CleanupScheduler {}
|
|
| ^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_structs_with_brackets
|
|
= help: remove the brackets
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1380:5
|
|
|
|
|
1380 | /// CleanupJob
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1380 - /// CleanupJob
|
|
1380 + /// `CleanupJob`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1398:5
|
|
|
|
|
1398 | /// CleanupJobType
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1398 - /// CleanupJobType
|
|
1398 + /// `CleanupJobType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1412:5
|
|
|
|
|
1412 | /// CleanupStatus
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1412 - /// CleanupStatus
|
|
1412 + /// `CleanupStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1428:5
|
|
|
|
|
1428 | /// AuditTrailVerifier
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1428 - /// AuditTrailVerifier
|
|
1428 + /// `AuditTrailVerifier`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1444:5
|
|
|
|
|
1444 | /// HashCalculator
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1444 - /// HashCalculator
|
|
1444 + /// `HashCalculator`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1455:5
|
|
|
|
|
1455 | /// SignatureVerifier
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1455 - /// SignatureVerifier
|
|
1455 + /// `SignatureVerifier`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1465:5
|
|
|
|
|
1465 | /// VerificationKey
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1465 - /// VerificationKey
|
|
1465 + /// `VerificationKey`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1483:5
|
|
|
|
|
1483 | /// VerificationResult
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1483 - /// VerificationResult
|
|
1483 + /// `VerificationResult`
|
|
|
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1803:30
|
|
|
|
|
1803 | event_count: row.get::<i64, _>("event_count") as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: using a potentially dangerous silent `as` conversion
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1804:31
|
|
|
|
|
1804 | unique_users: row.get::<i64, _>("unique_users") as u64,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using a safe wrapper for this conversion
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1824:5
|
|
|
|
|
1824 | /// GeneratedReport
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1824 - /// GeneratedReport
|
|
1824 + /// `GeneratedReport`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1844:5
|
|
|
|
|
1844 | /// AuditVerificationReport
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1844 - /// AuditVerificationReport
|
|
1844 + /// `AuditVerificationReport`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1864:5
|
|
|
|
|
1864 | /// VerificationError
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1864 - /// VerificationError
|
|
1864 + /// `VerificationError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1880:5
|
|
|
|
|
1880 | /// RetentionExecutionReport
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1880 - /// RetentionExecutionReport
|
|
1880 + /// `RetentionExecutionReport`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1900:5
|
|
|
|
|
1900 | /// PolicyExecutionResult
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1900 - /// PolicyExecutionResult
|
|
1900 + /// `PolicyExecutionResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1920:5
|
|
|
|
|
1920 | /// ReportingPeriod
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1920 - /// ReportingPeriod
|
|
1920 + /// `ReportingPeriod`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1932:5
|
|
|
|
|
1932 | /// ComplianceMetrics
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1932 - /// ComplianceMetrics
|
|
1932 + /// `ComplianceMetrics`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1950:5
|
|
|
|
|
1950 | /// EventMetric
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1950 - /// EventMetric
|
|
1950 + /// `EventMetric`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:1968:5
|
|
|
|
|
1968 | /// StorageMetrics
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1968 - /// StorageMetrics
|
|
1968 + /// `StorageMetrics`
|
|
|
|
|
|
|
warning: the borrowed expression implements the required traits
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:2028:19
|
|
|
|
|
2028 | .bind(&format!("{:?}", event.event_type))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{:?}", event.event_type)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
|
|
warning: the borrowed expression implements the required traits
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:2029:19
|
|
|
|
|
2029 | .bind(&event.timestamp)
|
|
| ^^^^^^^^^^^^^^^^ help: change this to: `event.timestamp`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
|
|
warning: the borrowed expression implements the required traits
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:2037:19
|
|
|
|
|
2037 | .bind(&format!("{:?}", event.risk_level))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{:?}", event.risk_level)`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
|
|
warning: the borrowed expression implements the required traits
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:2039:17
|
|
|
|
|
2039 | / &event
|
|
2040 | | .compliance_categories
|
|
2041 | | .iter()
|
|
2042 | | .map(|c| format!("{:?}", c))
|
|
2043 | | .collect::<Vec<_>>(),
|
|
| |________________________________________^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
help: change this to
|
|
|
|
|
2039 ~ event
|
|
2040 + .compliance_categories
|
|
2041 + .iter()
|
|
2042 + .map(|c| format!("{:?}", c))
|
|
2043 ~ .collect::<Vec<_>>(),
|
|
|
|
|
|
|
warning: redundant closure
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:2049:26
|
|
|
|
|
2049 | .map(|d| serde_json::to_value(d))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `serde_json::to_value`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
|
|
|
|
warning: you should consider adding a `Default` implementation for `EventEnricher`
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:2080:5
|
|
|
|
|
2080 | / pub fn new() -> Self {
|
|
2081 | | Self {
|
|
2082 | | enrichment_rules: Vec::new(),
|
|
2083 | | context_cache: HashMap::new(),
|
|
2084 | | }
|
|
2085 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
2079 + impl Default for EventEnricher {
|
|
2080 + fn default() -> Self {
|
|
2081 + Self::new()
|
|
2082 + }
|
|
2083 + }
|
|
|
|
|
|
|
warning: you should consider adding a `Default` implementation for `TemplateEngine`
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:2166:5
|
|
|
|
|
2166 | / pub fn new() -> Self {
|
|
2167 | | Self {
|
|
2168 | | templates: HashMap::new(),
|
|
2169 | | template_cache: HashMap::new(),
|
|
2170 | | }
|
|
2171 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
2165 + impl Default for TemplateEngine {
|
|
2166 + fn default() -> Self {
|
|
2167 + Self::new()
|
|
2168 + }
|
|
2169 + }
|
|
|
|
|
|
|
warning: you should consider adding a `Default` implementation for `ReportScheduler`
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:2175:5
|
|
|
|
|
2175 | / pub const fn new() -> Self {
|
|
2176 | | Self {
|
|
2177 | | schedules: Vec::new(),
|
|
2178 | | job_queue: Vec::new(),
|
|
2179 | | }
|
|
2180 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
2174 + impl Default for ReportScheduler {
|
|
2175 + fn default() -> Self {
|
|
2176 + Self::new()
|
|
2177 + }
|
|
2178 + }
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:2271:34
|
|
|
|
|
2271 | let execution_duration = Utc::now() - execution_start;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: you should consider adding a `Default` implementation for `PolicyEvaluator`
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:2318:5
|
|
|
|
|
2318 | / pub const fn new() -> Self {
|
|
2319 | | Self {}
|
|
2320 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
2317 + impl Default for PolicyEvaluator {
|
|
2318 + fn default() -> Self {
|
|
2319 + Self::new()
|
|
2320 + }
|
|
2321 + }
|
|
|
|
|
|
|
warning: you should consider adding a `Default` implementation for `CleanupScheduler`
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:2324:5
|
|
|
|
|
2324 | / pub const fn new() -> Self {
|
|
2325 | | Self {}
|
|
2326 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
2323 + impl Default for CleanupScheduler {
|
|
2324 + fn default() -> Self {
|
|
2325 + Self::new()
|
|
2326 + }
|
|
2327 + }
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/compliance_reporting.rs:2379:5
|
|
|
|
|
2379 | /// ComplianceReportingError
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2379 - /// ComplianceReportingError
|
|
2379 + /// `ComplianceReportingError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:20:5
|
|
|
|
|
20 | /// ISO27001ComplianceManager
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
20 - /// ISO27001ComplianceManager
|
|
20 + /// `ISO27001ComplianceManager`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:37:5
|
|
|
|
|
37 | /// ISO27001Config
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
37 - /// ISO27001Config
|
|
37 + /// `ISO27001Config`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:59:5
|
|
|
|
|
59 | /// OrganizationInfo
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
59 - /// OrganizationInfo
|
|
59 + /// `OrganizationInfo`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:97:5
|
|
|
|
|
97 | /// FacilityType
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
97 - /// FacilityType
|
|
97 + /// `FacilityType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:115:5
|
|
|
|
|
115 | /// ContactInfo
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
115 - /// ContactInfo
|
|
115 + /// `ContactInfo`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:133:5
|
|
|
|
|
133 | /// ISMSScope
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
133 - /// ISMSScope
|
|
133 + /// `ISMSScope`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:153:5
|
|
|
|
|
153 | /// ScopeBoundaries
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
153 - /// ScopeBoundaries
|
|
153 + /// `ScopeBoundaries`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:169:5
|
|
|
|
|
169 | /// SecurityObjective
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
169 - /// SecurityObjective
|
|
169 + /// `SecurityObjective`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:189:5
|
|
|
|
|
189 | /// SecurityMetric
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
189 - /// SecurityMetric
|
|
189 + /// `SecurityMetric`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:207:5
|
|
|
|
|
207 | /// MeasurementFrequency
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
207 - /// MeasurementFrequency
|
|
207 + /// `MeasurementFrequency`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:227:5
|
|
|
|
|
227 | /// ObjectiveStatus
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
227 - /// ObjectiveStatus
|
|
227 + /// `ObjectiveStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:245:5
|
|
|
|
|
245 | /// RiskMethodology
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
245 - /// RiskMethodology
|
|
245 + /// `RiskMethodology`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:261:5
|
|
|
|
|
261 | /// RiskCriteria
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
261 - /// RiskCriteria
|
|
261 + /// `RiskCriteria`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:275:5
|
|
|
|
|
275 | /// ImpactLevel
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
275 - /// ImpactLevel
|
|
275 + /// `ImpactLevel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:291:5
|
|
|
|
|
291 | /// LikelihoodLevel
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
291 - /// LikelihoodLevel
|
|
291 + /// `LikelihoodLevel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:307:5
|
|
|
|
|
307 | /// FrequencyRange
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
307 - /// FrequencyRange
|
|
307 + /// `FrequencyRange`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:319:5
|
|
|
|
|
319 | /// RiskThresholds
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
319 - /// RiskThresholds
|
|
319 + /// `RiskThresholds`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:333:5
|
|
|
|
|
333 | /// IncidentResponseConfig
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
333 - /// IncidentResponseConfig
|
|
333 + /// `IncidentResponseConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:349:5
|
|
|
|
|
349 | /// ResponseTeamMember
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
349 - /// ResponseTeamMember
|
|
349 + /// `ResponseTeamMember`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:369:5
|
|
|
|
|
369 | /// IncidentRole
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
369 - /// IncidentRole
|
|
369 + /// `IncidentRole`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:405:5
|
|
|
|
|
405 | /// ContactMethod
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
405 - /// ContactMethod
|
|
405 + /// `ContactMethod`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:423:5
|
|
|
|
|
423 | /// EscalationMatrix
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
423 - /// EscalationMatrix
|
|
423 + /// `EscalationMatrix`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:435:5
|
|
|
|
|
435 | /// EscalationRule
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
435 - /// EscalationRule
|
|
435 + /// `EscalationRule`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:449:5
|
|
|
|
|
449 | /// EscalationTarget
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
449 - /// EscalationTarget
|
|
449 + /// `EscalationTarget`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:463:5
|
|
|
|
|
463 | /// TimeEscalation
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
463 - /// TimeEscalation
|
|
463 + /// `TimeEscalation`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:477:5
|
|
|
|
|
477 | /// CommunicationPlan
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
477 - /// CommunicationPlan
|
|
477 + /// `CommunicationPlan`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:491:5
|
|
|
|
|
491 | /// CommunicationProcedure
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
491 - /// CommunicationProcedure
|
|
491 + /// `CommunicationProcedure`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:511:5
|
|
|
|
|
511 | /// AudienceType
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
511 - /// AudienceType
|
|
511 + /// `AudienceType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:531:5
|
|
|
|
|
531 | /// CommunicationTiming
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
531 - /// CommunicationTiming
|
|
531 + /// `CommunicationTiming`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:547:5
|
|
|
|
|
547 | /// CommunicationChannel
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
547 - /// CommunicationChannel
|
|
547 + /// `CommunicationChannel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:567:5
|
|
|
|
|
567 | /// CommunicationTemplate
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
567 - /// CommunicationTemplate
|
|
567 + /// `CommunicationTemplate`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:585:5
|
|
|
|
|
585 | /// EvidenceHandlingProcedures
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
585 - /// EvidenceHandlingProcedures
|
|
585 + /// `EvidenceHandlingProcedures`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:601:5
|
|
|
|
|
601 | /// EvidenceProcedure
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
601 - /// EvidenceProcedure
|
|
601 + /// `EvidenceProcedure`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:619:5
|
|
|
|
|
619 | /// ChainOfCustodyProcedure
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
619 - /// ChainOfCustodyProcedure
|
|
619 + /// `ChainOfCustodyProcedure`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:635:5
|
|
|
|
|
635 | /// BusinessContinuityConfig
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
635 - /// BusinessContinuityConfig
|
|
635 + /// `BusinessContinuityConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:651:5
|
|
|
|
|
651 | /// BIAConfig
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
651 - /// BIAConfig
|
|
651 + /// `BIAConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:667:5
|
|
|
|
|
667 | /// BusinessProcess
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
667 - /// BusinessProcess
|
|
667 + /// `BusinessProcess`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:689:5
|
|
|
|
|
689 | /// CriticalityLevel
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
689 - /// CriticalityLevel
|
|
689 + /// `CriticalityLevel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:705:5
|
|
|
|
|
705 | /// ProcessDependency
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
705 - /// ProcessDependency
|
|
705 + /// `ProcessDependency`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:721:5
|
|
|
|
|
721 | /// DependencyType
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
721 - /// DependencyType
|
|
721 + /// `DependencyType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:741:5
|
|
|
|
|
741 | /// ProcessResource
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
741 - /// ProcessResource
|
|
741 + /// `ProcessResource`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:757:5
|
|
|
|
|
757 | /// ResourceType
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
757 - /// ResourceType
|
|
757 + /// `ResourceType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:775:5
|
|
|
|
|
775 | /// ImpactCriterion
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
775 - /// ImpactCriterion
|
|
775 + /// `ImpactCriterion`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:789:5
|
|
|
|
|
789 | /// ImpactLevelDefinition
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
789 - /// ImpactLevelDefinition
|
|
789 + /// `ImpactLevelDefinition`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:803:5
|
|
|
|
|
803 | /// RecoveryStrategy
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
803 - /// RecoveryStrategy
|
|
803 + /// `RecoveryStrategy`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:825:5
|
|
|
|
|
825 | /// RecoveryStrategyType
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
825 - /// RecoveryStrategyType
|
|
825 + /// `RecoveryStrategyType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:845:5
|
|
|
|
|
845 | /// TestingSchedule
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
845 - /// TestingSchedule
|
|
845 + /// `TestingSchedule`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:861:5
|
|
|
|
|
861 | /// ScheduledTest
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
861 - /// ScheduledTest
|
|
861 + /// `ScheduledTest`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:881:5
|
|
|
|
|
881 | /// TestType
|
|
| ^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
881 - /// TestType
|
|
881 + /// `TestType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:899:5
|
|
|
|
|
899 | /// MaintenanceProcedure
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
899 - /// MaintenanceProcedure
|
|
899 + /// `MaintenanceProcedure`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:917:5
|
|
|
|
|
917 | /// AuditSchedule
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
917 - /// AuditSchedule
|
|
917 + /// `AuditSchedule`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:933:5
|
|
|
|
|
933 | /// ScheduledAudit
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
933 - /// ScheduledAudit
|
|
933 + /// `ScheduledAudit`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:951:5
|
|
|
|
|
951 | /// AuditType
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
951 - /// AuditType
|
|
951 + /// `AuditType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:969:5
|
|
|
|
|
969 | /// InformationSecurityManagementSystem
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
969 - /// InformationSecurityManagementSystem
|
|
969 + /// `InformationSecurityManagementSystem`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:984:5
|
|
|
|
|
984 | /// SecurityPolicy
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
984 - /// SecurityPolicy
|
|
984 + /// `SecurityPolicy`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1016:5
|
|
|
|
|
1016 | /// PolicyStatus
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1016 - /// PolicyStatus
|
|
1016 + /// `PolicyStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1034:5
|
|
|
|
|
1034 | /// SecurityProcedure
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1034 - /// SecurityProcedure
|
|
1034 + /// `SecurityProcedure`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1060:5
|
|
|
|
|
1060 | /// ProcedureStep
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1060 - /// ProcedureStep
|
|
1060 + /// `ProcedureStep`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1080:5
|
|
|
|
|
1080 | /// ProcedureMetric
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1080 - /// ProcedureMetric
|
|
1080 + /// `ProcedureMetric`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1096:5
|
|
|
|
|
1096 | /// SecurityControl
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1096 - /// SecurityControl
|
|
1096 + /// `SecurityControl`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1128:5
|
|
|
|
|
1128 | /// SecurityControlType
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1128 - /// SecurityControlType
|
|
1128 + /// `SecurityControlType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1144:5
|
|
|
|
|
1144 | /// ControlImplementationStatus
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1144 - /// ControlImplementationStatus
|
|
1144 + /// `ControlImplementationStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1160:5
|
|
|
|
|
1160 | /// EffectivenessRating
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1160 - /// EffectivenessRating
|
|
1160 + /// `EffectivenessRating`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1176:5
|
|
|
|
|
1176 | /// ControlEvidence
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1176 - /// ControlEvidence
|
|
1176 + /// `ControlEvidence`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1196:5
|
|
|
|
|
1196 | /// SecurityMetrics
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1196 - /// SecurityMetrics
|
|
1196 + /// `SecurityMetrics`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1212:5
|
|
|
|
|
1212 | /// SecurityIncidentMetrics
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1212 - /// SecurityIncidentMetrics
|
|
1212 + /// `SecurityIncidentMetrics`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1228:5
|
|
|
|
|
1228 | /// IncidentTrend
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1228 - /// IncidentTrend
|
|
1228 + /// `IncidentTrend`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1242:5
|
|
|
|
|
1242 | /// TrendDirection
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1242 - /// TrendDirection
|
|
1242 + /// `TrendDirection`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1256:5
|
|
|
|
|
1256 | /// ControlEffectivenessMetrics
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1256 - /// ControlEffectivenessMetrics
|
|
1256 + /// `ControlEffectivenessMetrics`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1272:5
|
|
|
|
|
1272 | /// RiskMetrics
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1272 - /// RiskMetrics
|
|
1272 + /// `RiskMetrics`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1288:5
|
|
|
|
|
1288 | /// ComplianceMetrics
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1288 - /// ComplianceMetrics
|
|
1288 + /// `ComplianceMetrics`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1302:5
|
|
|
|
|
1302 | /// ImprovementAction
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1302 - /// ImprovementAction
|
|
1302 + /// `ImprovementAction`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1324:5
|
|
|
|
|
1324 | /// ActionStatus
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1324 - /// ActionStatus
|
|
1324 + /// `ActionStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1342:5
|
|
|
|
|
1342 | /// ProgressUpdate
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1342 - /// ProgressUpdate
|
|
1342 + /// `ProgressUpdate`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1358:5
|
|
|
|
|
1358 | /// SecurityRiskManager
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1358 - /// SecurityRiskManager
|
|
1358 + /// `SecurityRiskManager`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1371:5
|
|
|
|
|
1371 | /// SecurityRisk
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1371 - /// SecurityRisk
|
|
1371 + /// `SecurityRisk`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1411:5
|
|
|
|
|
1411 | /// RiskCategory
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1411 - /// RiskCategory
|
|
1411 + /// `RiskCategory`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1433:5
|
|
|
|
|
1433 | /// LikelihoodAssessment
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1433 - /// LikelihoodAssessment
|
|
1433 + /// `LikelihoodAssessment`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1447:5
|
|
|
|
|
1447 | /// ImpactAssessment
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1447 - /// ImpactAssessment
|
|
1447 + /// `ImpactAssessment`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1465:5
|
|
|
|
|
1465 | /// RiskStatus
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1465 - /// RiskStatus
|
|
1465 + /// `RiskStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1485:5
|
|
|
|
|
1485 | /// RiskTreatmentPlan
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1485 - /// RiskTreatmentPlan
|
|
1485 + /// `RiskTreatmentPlan`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1507:5
|
|
|
|
|
1507 | /// TreatmentStrategy
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1507 - /// TreatmentStrategy
|
|
1507 + /// `TreatmentStrategy`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1523:5
|
|
|
|
|
1523 | /// TreatmentAction
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1523 - /// TreatmentAction
|
|
1523 + /// `TreatmentAction`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1545:5
|
|
|
|
|
1545 | /// TreatmentActionType
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1545 - /// TreatmentActionType
|
|
1545 + /// `TreatmentActionType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1565:5
|
|
|
|
|
1565 | /// ImplementationTimeline
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1565 - /// ImplementationTimeline
|
|
1565 + /// `ImplementationTimeline`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1579:5
|
|
|
|
|
1579 | /// TreatmentMilestone
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1579 - /// TreatmentMilestone
|
|
1579 + /// `TreatmentMilestone`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1595:5
|
|
|
|
|
1595 | /// ResourceRequirements
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1595 - /// ResourceRequirements
|
|
1595 + /// `ResourceRequirements`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1611:5
|
|
|
|
|
1611 | /// PersonnelRequirement
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1611 - /// PersonnelRequirement
|
|
1611 + /// `PersonnelRequirement`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1627:5
|
|
|
|
|
1627 | /// IncidentResponseSystem
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1627 - /// IncidentResponseSystem
|
|
1627 + /// `IncidentResponseSystem`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1641:5
|
|
|
|
|
1641 | /// SecurityIncident
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1641 - /// SecurityIncident
|
|
1641 + /// `SecurityIncident`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1679:5
|
|
|
|
|
1679 | /// IncidentType
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1679 - /// IncidentType
|
|
1679 + /// `IncidentType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1707:5
|
|
|
|
|
1707 | /// IncidentSeverity
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1707 - /// IncidentSeverity
|
|
1707 + /// `IncidentSeverity`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1723:5
|
|
|
|
|
1723 | /// IncidentStatus
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1723 - /// IncidentStatus
|
|
1723 + /// `IncidentStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1745:5
|
|
|
|
|
1745 | /// IncidentImpact
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1745 - /// IncidentImpact
|
|
1745 + /// `IncidentImpact`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1765:5
|
|
|
|
|
1765 | /// ResponseAction
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1765 - /// ResponseAction
|
|
1765 + /// `ResponseAction`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1785:5
|
|
|
|
|
1785 | /// ResponseActionType
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1785 - /// ResponseActionType
|
|
1785 + /// `ResponseActionType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1807:5
|
|
|
|
|
1807 | /// IncidentEvidence
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1807 - /// IncidentEvidence
|
|
1807 + /// `IncidentEvidence`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1829:5
|
|
|
|
|
1829 | /// CustodyRecord
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1829 - /// CustodyRecord
|
|
1829 + /// `CustodyRecord`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1847:5
|
|
|
|
|
1847 | /// ResponseProcedure
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1847 - /// ResponseProcedure
|
|
1847 + /// `ResponseProcedure`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1867:5
|
|
|
|
|
1867 | /// ResponseStep
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1867 - /// ResponseStep
|
|
1867 + /// `ResponseStep`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1889:5
|
|
|
|
|
1889 | /// DecisionPoint
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1889 - /// DecisionPoint
|
|
1889 + /// `DecisionPoint`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1905:5
|
|
|
|
|
1905 | /// DecisionOption
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1905 - /// DecisionOption
|
|
1905 + /// `DecisionOption`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1919:5
|
|
|
|
|
1919 | /// IncidentPlaybook
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1919 - /// IncidentPlaybook
|
|
1919 + /// `IncidentPlaybook`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1941:5
|
|
|
|
|
1941 | /// BusinessContinuityManager
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1941 - /// BusinessContinuityManager
|
|
1941 + /// `BusinessContinuityManager`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1952:5
|
|
|
|
|
1952 | /// ContinuityPlan
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1952 - /// ContinuityPlan
|
|
1952 + /// `ContinuityPlan`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1976:5
|
|
|
|
|
1976 | /// ResponseTeam
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1976 - /// ResponseTeam
|
|
1976 + /// `ResponseTeam`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:1994:5
|
|
|
|
|
1994 | /// TeamMember
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
1994 - /// TeamMember
|
|
1994 + /// `TeamMember`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2014:5
|
|
|
|
|
2014 | /// ActivationProcedures
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2014 - /// ActivationProcedures
|
|
2014 + /// `ActivationProcedures`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2030:5
|
|
|
|
|
2030 | /// ActivationStep
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2030 - /// ActivationStep
|
|
2030 + /// `ActivationStep`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2048:5
|
|
|
|
|
2048 | /// NotificationProcedure
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2048 - /// NotificationProcedure
|
|
2048 + /// `NotificationProcedure`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2064:5
|
|
|
|
|
2064 | /// RecoveryProcedures
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2064 - /// RecoveryProcedures
|
|
2064 + /// `RecoveryProcedures`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2080:5
|
|
|
|
|
2080 | /// RecoveryPhase
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2080 - /// RecoveryPhase
|
|
2080 + /// `RecoveryPhase`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2098:5
|
|
|
|
|
2098 | /// RecoveryActivity
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2098 - /// RecoveryActivity
|
|
2098 + /// `RecoveryActivity`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2118:5
|
|
|
|
|
2118 | /// RecoveryDependency
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2118 - /// RecoveryDependency
|
|
2118 + /// `RecoveryDependency`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2134:5
|
|
|
|
|
2134 | /// ValidationProcedure
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2134 - /// ValidationProcedure
|
|
2134 + /// `ValidationProcedure`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2150:5
|
|
|
|
|
2150 | /// BCPTestResult
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2150 - /// BCPTestResult
|
|
2150 + /// `BCPTestResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2174:5
|
|
|
|
|
2174 | /// TestResult
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2174 - /// TestResult
|
|
2174 + /// `TestResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2190:5
|
|
|
|
|
2190 | /// TestOutcome
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2190 - /// TestOutcome
|
|
2190 + /// `TestOutcome`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2206:5
|
|
|
|
|
2206 | /// TestIssue
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2206 - /// TestIssue
|
|
2206 + /// `TestIssue`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2228:5
|
|
|
|
|
2228 | /// IssueSeverity
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2228 - /// IssueSeverity
|
|
2228 + /// `IssueSeverity`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2244:5
|
|
|
|
|
2244 | /// AssetManager
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2244 - /// AssetManager
|
|
2244 + /// `AssetManager`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2255:5
|
|
|
|
|
2255 | /// InformationAsset
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2255 - /// InformationAsset
|
|
2255 + /// `InformationAsset`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2289:5
|
|
|
|
|
2289 | /// AssetType
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2289 - /// AssetType
|
|
2289 + /// `AssetType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2311:5
|
|
|
|
|
2311 | /// AssetClassification
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2311 - /// AssetClassification
|
|
2311 + /// `AssetClassification`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2327:5
|
|
|
|
|
2327 | /// ConfidentialityLevel
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2327 - /// ConfidentialityLevel
|
|
2327 + /// `ConfidentialityLevel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2343:5
|
|
|
|
|
2343 | /// IntegrityLevel
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2343 - /// IntegrityLevel
|
|
2343 + /// `IntegrityLevel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2359:5
|
|
|
|
|
2359 | /// AvailabilityLevel
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2359 - /// AvailabilityLevel
|
|
2359 + /// `AvailabilityLevel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2375:5
|
|
|
|
|
2375 | /// ClassificationLevel
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2375 - /// ClassificationLevel
|
|
2375 + /// `ClassificationLevel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2391:5
|
|
|
|
|
2391 | /// AssetValue
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2391 - /// AssetValue
|
|
2391 + /// `AssetValue`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2407:5
|
|
|
|
|
2407 | /// BusinessValue
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2407 - /// BusinessValue
|
|
2407 + /// `BusinessValue`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2423:5
|
|
|
|
|
2423 | /// LegalValue
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2423 - /// LegalValue
|
|
2423 + /// `LegalValue`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2439:5
|
|
|
|
|
2439 | /// ReputationValue
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2439 - /// ReputationValue
|
|
2439 + /// `ReputationValue`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2455:5
|
|
|
|
|
2455 | /// AssetDependency
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2455 - /// AssetDependency
|
|
2455 + /// `AssetDependency`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2469:5
|
|
|
|
|
2469 | /// DependencyStrength
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2469 - /// DependencyStrength
|
|
2469 + /// `DependencyStrength`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2485:5
|
|
|
|
|
2485 | /// SecurityRequirements
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2485 - /// SecurityRequirements
|
|
2485 + /// `SecurityRequirements`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2503:5
|
|
|
|
|
2503 | /// ClassificationScheme
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2503 - /// ClassificationScheme
|
|
2503 + /// `ClassificationScheme`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2519:5
|
|
|
|
|
2519 | /// ClassificationLevelDefinition
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2519 - /// ClassificationLevelDefinition
|
|
2519 + /// `ClassificationLevelDefinition`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2537:5
|
|
|
|
|
2537 | /// MarkingRequirement
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2537 - /// MarkingRequirement
|
|
2537 + /// `MarkingRequirement`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2553:5
|
|
|
|
|
2553 | /// ColorScheme
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2553 - /// ColorScheme
|
|
2553 + /// `ColorScheme`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2567:5
|
|
|
|
|
2567 | /// HandlingProcedure
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2567 - /// HandlingProcedure
|
|
2567 + /// `HandlingProcedure`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2587:5
|
|
|
|
|
2587 | /// SecurityPolicyManager
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2587 - /// SecurityPolicyManager
|
|
2587 + /// `SecurityPolicyManager`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2601:5
|
|
|
|
|
2601 | /// SecurityStandard
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2601 - /// SecurityStandard
|
|
2601 + /// `SecurityStandard`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2621:5
|
|
|
|
|
2621 | /// StandardRequirement
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2621 - /// StandardRequirement
|
|
2621 + /// `StandardRequirement`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2639:5
|
|
|
|
|
2639 | /// ComplianceMeasurement
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2639 - /// ComplianceMeasurement
|
|
2639 + /// `ComplianceMeasurement`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2657:5
|
|
|
|
|
2657 | /// SecurityGuideline
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2657 - /// SecurityGuideline
|
|
2657 + /// `SecurityGuideline`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2693:5
|
|
|
|
|
2693 | /// BestPractice
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2693 - /// BestPractice
|
|
2693 + /// `BestPractice`
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2760:30
|
|
|
|
|
2760 | target_date: Utc::now() + Duration::days(365),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2941:48
|
|
|
|
|
2941 | estimated_cost: Some(Decimal::from(50000)),
|
|
| ^^^^^ help: consider adding suffix: `50_000_i32`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2950:5
|
|
|
|
|
2950 | /// ISO27001Assessment
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2950 - /// ISO27001Assessment
|
|
2950 + /// `ISO27001Assessment`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2977:5
|
|
|
|
|
2977 | /// MaturityLevel
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2977 - /// MaturityLevel
|
|
2977 + /// `MaturityLevel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:2994:5
|
|
|
|
|
2994 | /// ControlImplementationAssessment
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
2994 - /// ControlImplementationAssessment
|
|
2994 + /// `ControlImplementationAssessment`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3011:5
|
|
|
|
|
3011 | /// ComplianceGap
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
3011 - /// ComplianceGap
|
|
3011 + /// `ComplianceGap`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3032:5
|
|
|
|
|
3032 | /// GapPriority
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
3032 - /// GapPriority
|
|
3032 + /// `GapPriority`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3047:5
|
|
|
|
|
3047 | /// ImprovementRecommendation
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
3047 - /// ImprovementRecommendation
|
|
3047 + /// `ImprovementRecommendation`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3070:5
|
|
|
|
|
3070 | /// RecommendationPriority
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
3070 - /// RecommendationPriority
|
|
3070 + /// `RecommendationPriority`
|
|
|
|
|
|
|
warning: you should consider adding a `Default` implementation for `InformationSecurityManagementSystem`
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3086:5
|
|
|
|
|
3086 | / pub fn new() -> Self {
|
|
3087 | | Self {
|
|
3088 | | policies: HashMap::new(),
|
|
3089 | | procedures: HashMap::new(),
|
|
... |
|
|
3118 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
3085 + impl Default for InformationSecurityManagementSystem {
|
|
3086 + fn default() -> Self {
|
|
3087 + Self::new()
|
|
3088 + }
|
|
3089 + }
|
|
|
|
|
|
|
warning: used underscore-prefixed binding
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3129:31
|
|
|
|
|
3129 | risk_methodology: _methodology.clone(),
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
note: binding is defined here
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3126:16
|
|
|
|
|
3126 | pub fn new(_methodology: &RiskMethodology) -> Self {
|
|
| ^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding
|
|
|
|
warning: used underscore-prefixed binding
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3142:21
|
|
|
|
|
3142 | config: _config.clone(),
|
|
| ^^^^^^^
|
|
|
|
|
note: binding is defined here
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3140:16
|
|
|
|
|
3140 | pub fn new(_config: &IncidentResponseConfig) -> Self {
|
|
| ^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding
|
|
|
|
warning: used underscore-prefixed binding
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3157:21
|
|
|
|
|
3157 | config: _config.clone(),
|
|
| ^^^^^^^
|
|
|
|
|
note: binding is defined here
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3155:16
|
|
|
|
|
3155 | pub fn new(_config: &BusinessContinuityConfig) -> Self {
|
|
| ^^^^^^^
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding
|
|
|
|
warning: this could be a `const fn`
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3173:5
|
|
|
|
|
3173 | / pub fn get_continuity_plans(&self) -> &HashMap<String, ContinuityPlan> {
|
|
3174 | | &self.continuity_plans
|
|
3175 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
3173 | pub const fn get_continuity_plans(&self) -> &HashMap<String, ContinuityPlan> {
|
|
| +++++
|
|
|
|
warning: this could be a `const fn`
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3183:5
|
|
|
|
|
3183 | / pub fn get_test_results(&self) -> &Vec<BCPTestResult> {
|
|
3184 | | &self.test_results
|
|
3185 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
3183 | pub const fn get_test_results(&self) -> &Vec<BCPTestResult> {
|
|
| +++++
|
|
|
|
warning: this could be a `const fn`
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3188:5
|
|
|
|
|
3188 | / pub fn get_config(&self) -> &BusinessContinuityConfig {
|
|
3189 | | &self.config
|
|
3190 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
3188 | pub const fn get_config(&self) -> &BusinessContinuityConfig {
|
|
| +++++
|
|
|
|
warning: you should consider adding a `Default` implementation for `AssetManager`
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3194:5
|
|
|
|
|
3194 | / pub fn new() -> Self {
|
|
3195 | | Self {
|
|
3196 | | asset_inventory: HashMap::new(),
|
|
3197 | | classification_scheme: ClassificationScheme {
|
|
... |
|
|
3205 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
3193 + impl Default for AssetManager {
|
|
3194 + fn default() -> Self {
|
|
3195 + Self::new()
|
|
3196 + }
|
|
3197 + }
|
|
|
|
|
|
|
warning: this could be a `const fn`
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3217:5
|
|
|
|
|
3217 | / pub fn get_asset_inventory(&self) -> &HashMap<String, InformationAsset> {
|
|
3218 | | &self.asset_inventory
|
|
3219 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
3217 | pub const fn get_asset_inventory(&self) -> &HashMap<String, InformationAsset> {
|
|
| +++++
|
|
|
|
warning: this could be a `const fn`
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3222:5
|
|
|
|
|
3222 | / pub fn get_classification_scheme(&self) -> &ClassificationScheme {
|
|
3223 | | &self.classification_scheme
|
|
3224 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
3222 | pub const fn get_classification_scheme(&self) -> &ClassificationScheme {
|
|
| +++++
|
|
|
|
warning: this could be a `const fn`
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3232:5
|
|
|
|
|
3232 | / pub fn get_handling_procedures(&self) -> &HashMap<String, HandlingProcedure> {
|
|
3233 | | &self.handling_procedures
|
|
3234 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
|
help: make the function `const`
|
|
|
|
|
3232 | pub const fn get_handling_procedures(&self) -> &HashMap<String, HandlingProcedure> {
|
|
| +++++
|
|
|
|
warning: you should consider adding a `Default` implementation for `SecurityPolicyManager`
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3238:5
|
|
|
|
|
3238 | / pub fn new() -> Self {
|
|
3239 | | Self {
|
|
3240 | | policies: HashMap::new(),
|
|
3241 | | procedures: HashMap::new(),
|
|
... |
|
|
3245 | | }
|
|
| |_____^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
help: try adding this
|
|
|
|
|
3237 + impl Default for SecurityPolicyManager {
|
|
3238 + fn default() -> Self {
|
|
3239 + Self::new()
|
|
3240 + }
|
|
3241 + }
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/iso27001_compliance.rs:3250:5
|
|
|
|
|
3250 | /// ISO27001Error
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
3250 - /// ISO27001Error
|
|
3250 + /// `ISO27001Error`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:51:5
|
|
|
|
|
51 | /// ComplianceConfig
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
51 - /// ComplianceConfig
|
|
51 + /// `ComplianceConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:71:5
|
|
|
|
|
71 | /// MiFIDConfig
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
71 - /// MiFIDConfig
|
|
71 + /// `MiFIDConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:89:5
|
|
|
|
|
89 | /// SOXConfig
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
89 - /// SOXConfig
|
|
89 + /// `SOXConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:105:5
|
|
|
|
|
105 | /// MARConfig
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
105 - /// MARConfig
|
|
105 + /// `MARConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:121:5
|
|
|
|
|
121 | /// DataProtectionConfig
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
121 - /// DataProtectionConfig
|
|
121 + /// `DataProtectionConfig`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:137:5
|
|
|
|
|
137 | /// ComplianceStatus
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
137 - /// ComplianceStatus
|
|
137 + /// `ComplianceStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:155:5
|
|
|
|
|
155 | /// ComplianceResult
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
155 - /// ComplianceResult
|
|
155 + /// `ComplianceResult`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:179:5
|
|
|
|
|
179 | /// ComplianceFinding
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
179 - /// ComplianceFinding
|
|
179 + /// `ComplianceFinding`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:201:5
|
|
|
|
|
201 | /// ComplianceSeverity
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
201 - /// ComplianceSeverity
|
|
201 + /// `ComplianceSeverity`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:219:5
|
|
|
|
|
219 | /// FindingStatus
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
219 - /// FindingStatus
|
|
219 + /// `FindingStatus`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:271:5
|
|
|
|
|
271 | /// ComplianceEngine
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
271 - /// ComplianceEngine
|
|
271 + /// `ComplianceEngine`
|
|
|
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/mod.rs:366:40
|
|
|
|
|
366 | due_date: Some(Utc::now() + Duration::hours(24)),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/mod.rs:380:36
|
|
|
|
|
380 | due_date: Some(Utc::now() + Duration::hours(1)),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/mod.rs:397:32
|
|
|
|
|
397 | due_date: Some(Utc::now() + Duration::days(7)),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/mod.rs:427:32
|
|
|
|
|
427 | due_date: Some(Utc::now() + Duration::days(30)),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/mod.rs:443:32
|
|
|
|
|
443 | due_date: Some(Utc::now() + Duration::days(14)),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/mod.rs:475:32
|
|
|
|
|
475 | due_date: Some(Utc::now() + Duration::days(30)),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/mod.rs:502:32
|
|
|
|
|
502 | due_date: Some(Utc::now() + Duration::days(30)),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: arithmetic operation that can potentially result in unexpected side-effects
|
|
--> trading_engine/src/compliance/mod.rs:523:32
|
|
|
|
|
523 | due_date: Some(Utc::now() + Duration::days(60)),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/mod.rs:544:49
|
|
|
|
|
544 | ComplianceSeverity::Critical => 25.0,
|
|
| ^^^^ help: consider adding suffix: `25.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/mod.rs:545:45
|
|
|
|
|
545 | ComplianceSeverity::High => 15.0,
|
|
| ^^^^ help: consider adding suffix: `15.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/mod.rs:546:47
|
|
|
|
|
546 | ComplianceSeverity::Medium => 8.0,
|
|
| ^^^ help: consider adding suffix: `8.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/mod.rs:547:44
|
|
|
|
|
547 | ComplianceSeverity::Low => 3.0,
|
|
| ^^^ help: consider adding suffix: `3.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: default numeric fallback might occur
|
|
--> trading_engine/src/compliance/mod.rs:548:45
|
|
|
|
|
548 | ComplianceSeverity::Info => 0.0,
|
|
| ^^^ help: consider adding suffix: `0.0_f64`
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
|
|
|
|
warning: floating-point arithmetic detected
|
|
--> trading_engine/src/compliance/mod.rs:552:9
|
|
|
|
|
552 | (100.0 - total_deduction).max(0.0)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_arithmetic
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:583:5
|
|
|
|
|
583 | /// OrderInfo
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
583 - /// OrderInfo
|
|
583 + /// `OrderInfo`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:607:5
|
|
|
|
|
607 | /// ComplianceContext
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
607 - /// ComplianceContext
|
|
607 + /// `ComplianceContext`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:623:5
|
|
|
|
|
623 | /// ClientInfo
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
623 - /// ClientInfo
|
|
623 + /// `ClientInfo`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:639:5
|
|
|
|
|
639 | /// MarketContext
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
639 - /// MarketContext
|
|
639 + /// `MarketContext`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:653:5
|
|
|
|
|
653 | /// ClientType
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
653 - /// ClientType
|
|
653 + /// `ClientType`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:667:5
|
|
|
|
|
667 | /// RiskTolerance
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
667 - /// RiskTolerance
|
|
667 + /// `RiskTolerance`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:681:5
|
|
|
|
|
681 | /// MarketConditions
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
681 - /// MarketConditions
|
|
681 + /// `MarketConditions`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:697:5
|
|
|
|
|
697 | /// TradingSession
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
697 - /// TradingSession
|
|
697 + /// `TradingSession`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:713:5
|
|
|
|
|
713 | /// ComplianceError
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
713 - /// ComplianceError
|
|
713 + /// `ComplianceError`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:737:5
|
|
|
|
|
737 | /// ComplianceViolation
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
737 - /// ComplianceViolation
|
|
737 + /// `ComplianceViolation`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:761:5
|
|
|
|
|
761 | /// ComplianceRegulation
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
761 - /// ComplianceRegulation
|
|
761 + /// `ComplianceRegulation`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:785:5
|
|
|
|
|
785 | /// SOXCompliance
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
785 - /// SOXCompliance
|
|
785 + /// `SOXCompliance`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:806:5
|
|
|
|
|
806 | /// MiFIDCompliance
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
806 - /// MiFIDCompliance
|
|
806 + /// `MiFIDCompliance`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:827:5
|
|
|
|
|
827 | /// ComplianceRule
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
827 - /// ComplianceRule
|
|
827 + /// `ComplianceRule`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:847:5
|
|
|
|
|
847 | /// ComplianceMonitor
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
847 - /// ComplianceMonitor
|
|
847 + /// `ComplianceMonitor`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:871:5
|
|
|
|
|
871 | /// RiskLevel
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
871 - /// RiskLevel
|
|
871 + /// `RiskLevel`
|
|
|
|
|
|
|
warning: item in documentation is missing backticks
|
|
--> trading_engine/src/compliance/mod.rs:887:5
|
|
|
|
|
887 | /// SOXAuditEvent
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
|
help: try
|
|
|
|
|
887 - /// SOXAuditEvent
|
|
887 + /// `SOXAuditEvent`
|
|
|
|
|
|
|
warning: `trading_engine` (lib) generated 2953 warnings
|
|
error: could not compile `trading_engine` (lib) due to 404 previous errors; 2953 warnings emitted
|