Compiling zmatrix v0.2.27 (/Users/treagzhao/Documents/Workspace/zmatrix)
warning: unused import: `error`
--> src/dense/initial.rs:1:20
|
1 | use crate::dense::{error, Matrix};
| ^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `array_init::array_init`
--> src/dense/initial.rs:2:5
|
2 | use array_init::array_init;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `util`
--> src/dense/operation.rs:1:27
|
1 | use crate::dense::{error, util, Matrix};
| ^^^^
warning: unused import: `approx::assert_relative_eq`
--> src/dense/operation.rs:2:5
|
2 | use approx::assert_relative_eq;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `array_init::array_init`
--> src/dense/operation.rs:3:5
|
3 | use array_init::array_init;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `rayon::prelude::*`
--> src/dense/operation.rs:5:5
|
5 | use rayon::prelude::*;
| ^^^^^^^^^^^^^^^^^
warning: unused imports: `Arc` and `mpsc`
--> src/dense/operation.rs:9:17
|
9 | use std::sync::{mpsc, Arc};
| ^^^^ ^^^
warning: unused import: `std::thread`
--> src/dense/operation.rs:10:5
|
10 | use std::thread;
| ^^^^^^^^^^^
warning: unused imports: `IntoParallelIterator` and `ParallelBridge`
--> src/dense/shape.rs:4:22
|
4 | use rayon::prelude::{IntoParallelIterator, ParallelBridge};
| ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
warning: unused imports: `Arc`, `Mutex`, and `RwLock`
--> src/dense/shape.rs:7:17
|
7 | use std::sync::{Arc, Mutex, RwLock};
| ^^^ ^^^^^ ^^^^^^
warning: unused imports: `AtomicPtr` and `Ordering`
--> src/dense/shape.rs:8:25
|
8 | use std::sync::atomic::{AtomicPtr, Ordering};
| ^^^^^^^^^ ^^^^^^^^
warning: unused import: `std::thread`
--> src/dense/shape.rs:9:5
|
9 | use std::thread;
| ^^^^^^^^^^^
warning: unused import: `array_init::array_init`
--> src/dense/shape.rs:10:5
|
10 | use array_init::array_init;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `Sub`
--> src/dense/util.rs:4:26
|
4 | use std::ops::{Add, Mul, Sub};
| ^^^
warning: unused imports: `Not` and `Sub`
--> src/dense.rs:8:26
|
8 | use std::ops::{Add, Mul, Not, Sub};
| ^^^ ^^^
warning: unused imports: `Arc` and `mpsc`
--> src/dense.rs:9:17
|
9 | use std::sync::{mpsc, Arc};
| ^^^^ ^^^
warning: unused import: `std::thread`
--> src/dense.rs:10:5
|
10 | use std::thread;
| ^^^^^^^^^^^
warning: unused import: `crate::physics::basic`
--> src/physics/basic.rs:1:5
|
1 | use crate::physics::basic;
| ^^^^^^^^^^^^^^^^^^^^^
warning: unused imports: `Acceleration`, `Mass`, and `Velocity`
--> src/physics/basic/energy.rs:2:5
|
2 | Acceleration, Coef, Distance, Energy, EnergyType, Force, Mass, PhysicalQuantity, Velocity,
| ^^^^^^^^^^^^ ^^^^ ^^^^^^^^
warning: unused import: `approx::assert_relative_eq`
--> src/physics/basic/energy.rs:4:5
|
4 | use approx::assert_relative_eq;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `approx::assert_relative_eq`
--> src/physics/basic/force.rs:4:5
|
4 | use approx::assert_relative_eq;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `approx::assert_relative_eq`
--> src/physics/basic/magnetic_angular_velocity.rs:4:5
|
4 | use approx::assert_relative_eq;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `approx::assert_relative_eq`
--> src/physics/basic/magnetic_moment.rs:4:5
|
4 | use approx::assert_relative_eq;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `approx::assert_relative_eq`
--> src/physics/basic/mass.rs:4:5
|
4 | use approx::assert_relative_eq;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused imports: `AngularMomentumType`, `MassType`, and `Mass`
--> src/physics/basic/momentum.rs:3:46
|
3 | use crate::physics::basic::{AngularMomentum, AngularMomentumType, Coef, Distance, Mass, MassType, Momentum, MomentumType, PhysicalQuantity};
| ^^^^^^^^^^^^^^^^^^^ ^^^^ ^^^^^^^^
warning: unused import: `approx::assert_relative_eq`
--> src/physics/basic/power.rs:4:5
|
4 | use approx::assert_relative_eq;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `approx::assert_relative_eq`
--> src/physics/basic/torque.rs:4:5
|
4 | use approx::assert_relative_eq;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `Mass`
--> src/physics/basic/vector/distance.rs:2:52
|
2 | AngularMomentum, Coef, Distance, DistanceType, Mass, Momentum, Vector3, Velocity,
| ^^^^
warning: unused import: `super::*`
--> src/physics/basic/vector/magnetic_angular_velocity.rs:1:5
|
1 | use super::*;
| ^^^^^^^^
warning: unused import: `Div`
--> src/physics/basic/vector/magnetic_induction.rs:1:16
|
1 | use std::ops::{Div, Mul};
| ^^^
warning: unused import: `crate::utils::float`
--> src/physics/basic/vector.rs:18:5
|
18 | use crate::utils::float;
| ^^^^^^^^^^^^^^^^^^^
warning: unused import: `crate::physics::basic::VelocityType::LightSpeed`
--> src/physics/basic/velocity.rs:3:5
|
3 | use crate::physics::basic::VelocityType::LightSpeed;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `DistanceType`
--> src/physics/basic/volume.rs:3:51
|
3 | use crate::physics::basic::{Area, Coef, Distance, DistanceType, PhysicalQuantity, Volume, VolumeType};
| ^^^^^^^^^^^^
warning: variant `g` should have an upper camel case name
--> src/physics/basic.rs:196:5
|
196 | g,
| ^ help: convert the identifier to upper camel case: `G`
|
= note: `#[warn(non_camel_case_types)]` on by default
warning: unused import: `super::*`
--> src/spatial_geometry/cos_matrix.rs:1:5
|
1 | use super::*;
| ^^^^^^^^
warning: unused import: `sgn2_64`
--> src/spatial_geometry/cos_matrix.rs:6:32
|
6 | use crate::utils::float::{sgn, sgn2_64};
| ^^^^^^^
warning: unused import: `super::*`
--> src/spatial_geometry/quaternion.rs:1:5
|
1 | use super::*;
| ^^^^^^^^
warning: unused import: `rayon::iter::ParallelIterator`
--> src/dense/operation.rs:4:5
|
4 | use rayon::iter::ParallelIterator;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `PhysicalQuantity`
--> src/spatial_geometry/cos_matrix.rs:4:44
|
4 | use crate::physics::basic::{Angular, Coef, PhysicalQuantity, Vector3, VectorQuantity};
| ^^^^^^^^^^^^^^^^
warning: unused import: `rayon::iter::ParallelIterator`
--> src/dense/shape.rs:3:5
|
3 | use rayon::iter::ParallelIterator;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: value assigned to `ceof` is never read
--> src/dense/util.rs:122:13
|
122 | let mut ceof: i8 = 0;
| ^^^^
|
= help: maybe it is overwritten before being read?
= note: `#[warn(unused_assignments)]` on by default
warning: unused variable: `key`
--> src/dense/util.rs:128:9
|
128 | let key = print_permutation(permutation);
| ^^^ help: if this is intentional, prefix it with an underscore: `_key`
|
= note: `#[warn(unused_variables)]` on by default
warning: variable does not need to be mutable
--> src/dense.rs:25:13
|
25 | let mut digits: u8 = 0;
| ----^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: variable does not need to be mutable
--> src/physics/basic/vector/angular.rs:102:13
|
102 | let mut result: Vector3<Angular> = Vector3::new(
| ----^^^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/physics/basic/vector/angular.rs:111:13
|
111 | let mut result: Vector3<Angular> = Vector3::new(
| ----^^^^^^
| |
| help: remove this `mut`
warning: value assigned to `x` is never read
--> src/spatial_geometry/cos_matrix.rs:485:17
|
485 | let mut x: Angular = Angular::default();
| ^
|
= help: maybe it is overwritten before being read?
warning: field `digits` is never read
--> src/dense.rs:17:5
|
12 | pub struct Matrix<const ROWS: usize, const COLS: usize, T>
| ------ field in this struct
...
17 | digits: u8,
| ^^^^^^
|
= note: `Matrix` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
warning: struct `CalculateResult` is never constructed
--> src/dense/util.rs:8:12
|
8 | pub struct CalculateResult<T>
| ^^^^^^^^^^^^^^^
warning: function `convert_to_f64` is never used
--> src/dense/util.rs:17:8
|
17 | pub fn convert_to_f64<T>(value: T) -> Result<f64, error::OperationError>
| ^^^^^^^^^^^^^^
warning: function `calculate_in_threads` is never used
--> src/dense/util.rs:60:8
|
60 | pub fn calculate_in_threads<'a, const ROWS: usize, const COLS: usize, T, F>(
| ^^^^^^^^^^^^^^^^^^^^
warning: function `calculate_multi` is never used
--> src/dense/util.rs:93:8
|
93 | pub fn calculate_multi<const A_ROWS: usize, const A_COLS: usize, const B_COLS: usize, T>(
| ^^^^^^^^^^^^^^^
warning: constant `LIGHT_SPEED` is never used
--> src/physics/basic/distance.rs:5:7
|
5 | const LIGHT_SPEED: f64 = 299792458.0;
| ^^^^^^^^^^^
warning: method `T` should have a snake case name
--> src/dense/shape.rs:26:12
|
26 | pub fn T(&self) -> Matrix<COLS, ROWS, T> {
| ^ help: convert the identifier to snake case: `t`
|
= note: `#[warn(non_snake_case)]` on by default
warning: `zmatrix` (lib) generated 53 warnings (run `cargo fix --lib -p zmatrix` to apply 39 suggestions)
warning: unused import: `Energy`
--> examples/example_torque.rs:1:49
|
1 | use zmatrix::physics::basic::{Torque, Distance, Energy, PhysicalQuantity};
| ^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `Acceleration`
--> examples/example_energy.rs:1:65
|
1 | use zmatrix::physics::basic::{Energy, Distance, Mass, Velocity, Acceleration, PhysicalQuantity};
| ^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `Energy`
--> examples/example_magnetic_moment.rs:1:66
|
1 | use zmatrix::physics::basic::{MagneticMoment, MagneticInduction, Energy, PhysicalQuantity};
| ^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused variable: `acc`
--> examples/example_physics.rs:20:9
|
20 | let acc:Acceleration = velocity / time;
| ^^^ help: if this is intentional, prefix it with an underscore: `_acc`
|
= note: `#[warn(unused_variables)]` on by default
warning: unused variable: `angular_accel`
--> examples/example_physics.rs:25:9
|
25 | let angular_accel:AngularAcceleration = omg / time;
| ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_angular_accel`
warning: unused variable: `area`
--> examples/example_physics.rs:28:9
|
28 | let area:Area = dis * dis;
| ^^^^ help: if this is intentional, prefix it with an underscore: `_area`
warning: unused variable: `pos_vector`
--> examples/example_physics.rs:33:9
|
33 | let pos_vector:Vector3<Distance> = Vector3::new(
| ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_pos_vector`
warning: function `calculate` is never used
--> examples/example_physics.rs:16:4
|
16 | fn calculate() {
| ^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: function `exmples_vector3` is never used
--> examples/example_physics.rs:32:4
|
32 | fn exmples_vector3(){
| ^^^^^^^^^^^^^^^
warning: unused import: `Area`
--> src/physics/basic/magnetic_moment.rs:342:52
|
342 | use crate::physics::basic::{MagneticInduction, Area};
| ^^^^
warning: duplicated attribute
--> src/physics/basic/vector/angular_velocity.rs:95:5
|
95 | #[test]
| ^^^^^^^
|
= note: `#[warn(duplicate_macro_attributes)]` on by default
warning: unused import: `std::any::TypeId`
--> src/physics/basic/velocity.rs:318:9
|
318 | use std::any::TypeId;
| ^^^^^^^^^^^^^^^^
warning: duplicated attribute
--> src/utils/float.rs:51:5
|
51 | #[test]
| ^^^^^^^
warning: unused import: `rayon::prelude`
--> src/dense/operation.rs:5:5
|
5 | use rayon::prelude::*;
| ^^^^^^^^^^^^^^
warning: unused variable: `expected`
--> src/dense/operation.rs:518:13
|
518 | let expected: [i32; 0] = [];
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_expected`
|
= note: `#[warn(unused_variables)]` on by default
warning: unused variable: `result`
--> src/dense/operation.rs:870:13
|
870 | let result = matrix.clamp(3.0, 2.0);
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_result`
warning: unused variable: `data`
--> src/dense/shape.rs:185:13
|
185 | let data = (1..=100).collect::<Vec<_>>();
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
warning: unused variable: `key`
--> src/dense/util.rs:128:9
|
128 | let key = print_permutation(permutation);
| ^^^ help: if this is intentional, prefix it with an underscore: `_key`
warning: unused variable: `vec`
--> src/dense/util.rs:286:19
|
286 | if let Ok(vec) = res {
| ^^^ help: if this is intentional, prefix it with an underscore: `_vec`
warning: unused variable: `d2`
--> src/physics/basic/acceleration.rs:378:13
|
378 | let d2 = d1.as_any().downcast_ref::<Acceleration>().unwrap();
| ^^ help: if this is intentional, prefix it with an underscore: `_d2`
warning: unused variable: `d2`
--> src/physics/basic/angular_acceleration.rs:371:13
|
371 | let d2 = dw.downcast_ref::<AngularAcceleration>().unwrap();
| ^^ help: if this is intentional, prefix it with an underscore: `_d2`
warning: unused variable: `d3`
--> src/physics/basic/angular_velocity.rs:506:13
|
506 | let d3 = d2.downcast_ref::<AngularVelocity>().unwrap();
| ^^ help: if this is intentional, prefix it with an underscore: `_d3`
warning: unused variable: `a`
--> src/physics/basic/area.rs:444:13
|
444 | let a: &Area = any.downcast_ref::<Area>().unwrap();
| ^ help: if this is intentional, prefix it with an underscore: `_a`
warning: unused variable: `c`
--> src/physics/basic/coef.rs:379:13
|
379 | let c = result.downcast_ref::<Coef>().unwrap();
| ^ help: if this is intentional, prefix it with an underscore: `_c`
warning: unused variable: `result`
--> src/physics/basic/magnetic_induction.rs:372:13
|
372 | let result = convert_gauss_value(1.0, MagneticInductionType::Tesla, MagneticInductionType::KiloGauss).unwrap();
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_result`
warning: unused variable: `result`
--> src/physics/basic/magnetic_induction.rs:378:13
|
378 | let result = convert_gauss_value(1.0, MagneticInductionType::KiloGauss, MagneticInductionType::Tesla).unwrap();
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_result`
warning: unused variable: `result`
--> src/physics/basic/magnetic_induction.rs:400:13
|
400 | let result = convert_tesla_value(1.0, MagneticInductionType::Tesla, MagneticInductionType::KiloGauss).unwrap();
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_result`
warning: unused variable: `result`
--> src/physics/basic/magnetic_induction.rs:406:13
|
406 | let result = convert_tesla_value(1.0, MagneticInductionType::KiloGauss, MagneticInductionType::Tesla).unwrap();
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_result`
warning: unused variable: `a`
--> src/physics/basic/magnetic_induction.rs:464:13
|
464 | let a = any.downcast_ref::<MagneticInduction>().unwrap();
| ^ help: if this is intentional, prefix it with an underscore: `_a`
warning: unused variable: `m2`
--> src/physics/basic/mass.rs:215:13
|
215 | let m2 = m1.as_g();
| ^^ help: if this is intentional, prefix it with an underscore: `_m2`
warning: unused variable: `p_zero`
--> src/physics/basic/power.rs:876:13
|
876 | let p_zero = Power::from_watt(0.0);
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_p_zero`
warning: unused variable: `unit_name`
--> src/physics/basic/power.rs:895:21
|
895 | for (power, unit_name) in units {
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_unit_name`
warning: unused variable: `ti`
--> src/physics/basic/vector/angular.rs:1086:14
|
1086 | let (ti, tj, tk) = (1u8, 2u8, 3u8); // 这里与上面 seq 一致为 Y(2) Z(3) X(1)? 修正如下:
| ^^ help: if this is intentional, prefix it with an underscore: `_ti`
warning: unused variable: `tj`
--> src/physics/basic/vector/angular.rs:1086:18
|
1086 | let (ti, tj, tk) = (1u8, 2u8, 3u8); // 这里与上面 seq 一致为 Y(2) Z(3) X(1)? 修正如下:
| ^^ help: if this is intentional, prefix it with an underscore: `_tj`
warning: unused variable: `tk`
--> src/physics/basic/vector/angular.rs:1086:22
|
1086 | let (ti, tj, tk) = (1u8, 2u8, 3u8); // 这里与上面 seq 一致为 Y(2) Z(3) X(1)? 修正如下:
| ^^ help: if this is intentional, prefix it with an underscore: `_tk`
warning: unused variable: `input`
--> src/physics/basic/vector.rs:733:17
|
733 | let mut input = [1f32, 4f32, 9f32];
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_input`
warning: variable does not need to be mutable
--> src/physics/basic/vector.rs:733:13
|
733 | let mut input = [1f32, 4f32, 9f32];
| ----^^^^^
| |
| help: remove this `mut`
warning: unused variable: `a`
--> src/physics/basic/velocity.rs:498:13
|
498 | let a = v_any.downcast_ref::<Velocity>().unwrap();
| ^ help: if this is intentional, prefix it with an underscore: `_a`
warning: unused variable: `v`
--> src/physics/basic/volume.rs:254:13
|
254 | let v = b.as_any().downcast_ref::<Volume>().unwrap();
| ^ help: if this is intentional, prefix it with an underscore: `_v`
warning: unused variable: `d`
--> src/physics/basic.rs:615:13
|
615 | let d = g.as_any().downcast_ref::<Acceleration>().unwrap();
| ^ help: if this is intentional, prefix it with an underscore: `_d`
warning: unused variable: `d`
--> src/physics/basic.rs:618:13
|
618 | let d = g.as_any().downcast_ref::<Area>().unwrap();
| ^ help: if this is intentional, prefix it with an underscore: `_d`
warning: `zmatrix` (example "example_magnetic_moment") generated 1 warning (run `cargo fix --example "example_magnetic_moment"` to apply 1 suggestion)
warning: `zmatrix` (example "example_energy") generated 1 warning (run `cargo fix --example "example_energy"` to apply 1 suggestion)
warning: `zmatrix` (example "example_torque") generated 1 warning (run `cargo fix --example "example_torque"` to apply 1 suggestion)
warning: `zmatrix` (example "example_physics") generated 6 warnings
warning: function `test_norm_square_basic` is never used
--> src/physics/basic/vector.rs:1057:8
|
1057 | fn test_norm_square_basic() {
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused imports: `Energy`, `MagneticInduction`, `Mass`, `Power`, `Torque`, `VectorQuantity`, and `Volume`
--> examples/example_vector_quantity_restriction.rs:1:31
|
1 | use zmatrix::physics::basic::{VectorQuantity, Distance, Velocity, Force, Torque, MagneticInduction, Vector3, Mass, Energy, Power, Volume};
| ^^^^^^^^^^^^^^ ^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^ ^^^^^^ ^^^^^ ^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: function `test_T` should have a snake case name
--> src/dense/shape.rs:110:8
|
110 | fn test_T() {
| ^^^^^^ help: convert the identifier to snake case: `test_t`
warning: unused import: `zmatrix::dense`
--> examples/examples_dense.rs:1:5
|
1 | use zmatrix::dense;
| ^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused `Result` that must be used
--> examples/examples_dense.rs:61:5
|
61 | m1.set(1, 1, 12);
| ^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
61 | let _ = m1.set(1, 1, 12);
| +++++++
warning: variable `delta_B` should have a snake case name
--> src/physics/basic/vector/magnetic_angular_velocity.rs:1622:13
|
1622 | let delta_B = b - b_prev;
| ^^^^^^^ help: convert the identifier to snake case: `delta_b`
warning: `zmatrix` (example "example_vector_quantity_restriction") generated 1 warning (run `cargo fix --example "example_vector_quantity_restriction"` to apply 1 suggestion)
warning: `zmatrix` (example "examples_dense") generated 2 warnings (run `cargo fix --example "examples_dense"` to apply 1 suggestion)
warning: `zmatrix` (lib test) generated 75 warnings (40 duplicates) (run `cargo fix --lib -p zmatrix --tests` to apply 3 suggestions)
Finished `test` profile [unoptimized + debuginfo] target(s) in 1.33s
Running unittests src/lib.rs (target/debug/deps/zmatrix-0317ef656e62916a)
Doc-tests zmatrix
warning: variant `g` should have an upper camel case name
--> src/physics/basic.rs:196:5
|
196 | g,
| ^ help: convert the identifier to upper camel case: `G`
|
= note: `#[warn(non_camel_case_types)]` on by default
warning: 1 warning emitted