Fix a bunch of warnings

This commit is contained in:
2020-12-07 22:55:24 -08:00
parent e0056d8c85
commit f5f90a7a15
8 changed files with 15 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
use coremem::{GenericSim, Driver, mat}; use coremem::{GenericSim, Driver};
use coremem::geom::Index; use coremem::geom::Index;
fn main() { fn main() {

View File

@@ -1,5 +1,5 @@
use coremem::{Driver, Flt, mat, meas}; use coremem::{Driver, Flt, mat, meas};
use coremem::geom::{Coord, CylinderZ, Index, Meters, Vec2, Vec3}; use coremem::geom::{CylinderZ, Index, Meters, Vec2, Vec3};
use coremem::stim::{Stimulus, Sinusoid}; use coremem::stim::{Stimulus, Sinusoid};
use log::trace; use log::trace;

View File

@@ -1,7 +1,6 @@
use coremem::{Driver, Flt, mat, meas}; use coremem::{Driver, Flt, mat, meas};
use coremem::geom::{Coord, Index, Meters, Sphere, Torus, Vec2, Vec3}; use coremem::geom::{Index, Meters, Torus, Vec3};
use coremem::stim::{CurlStimulus, Sinusoid}; use coremem::stim::{CurlStimulus, Sinusoid};
use log::trace;
fn main() { fn main() {
coremem::init_logging(); coremem::init_logging();
@@ -20,7 +19,6 @@ fn main() {
let from_m = |m| (m/feat_size) as u32; let from_m = |m| (m/feat_size) as u32;
let m_to_um = |px| (px * 1e6) as u32; let m_to_um = |px| (px * 1e6) as u32;
// let to_m = |px| px as Flt * feat_size;
let half_width = width * 0.5; let half_width = width * 0.5;
let half_depth = depth * 0.5; let half_depth = depth * 0.5;

View File

@@ -1,8 +1,8 @@
use coremem::{GenericSim as _, StaticSim}; use coremem::StaticSim;
use coremem::render::{ColorTermRenderer, Renderer as _, SerializedFrame}; use coremem::render::{ColorTermRenderer, Renderer as _, SerializedFrame};
use std::fs::{DirEntry, File, read_dir}; use std::fs::{DirEntry, File, read_dir};
use std::io::{BufReader, Read as _, stdin}; use std::io::BufReader;
use std::ops::Deref; use std::ops::Deref;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::time::Duration; use std::time::Duration;

View File

@@ -7,7 +7,7 @@ use crate::render::{self, MultiRenderer, Renderer};
use crate::sim::{GenericSim, SimState}; use crate::sim::{GenericSim, SimState};
use crate::stim::AbstractStimulus; use crate::stim::AbstractStimulus;
use log::{info, debug, trace}; use log::{info, trace};
use std::path::PathBuf; use std::path::PathBuf;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use std::sync::mpsc::{sync_channel, SyncSender, Receiver}; use std::sync::mpsc::{sync_channel, SyncSender, Receiver};

View File

@@ -72,9 +72,9 @@ pub mod consts {
pub(crate) fn C() -> Real { pub(crate) fn C() -> Real {
super::C.into() super::C.into()
} }
pub(crate) fn C2() -> Real { // pub(crate) fn C2() -> Real {
C() * C() // C() * C()
} // }
pub(crate) fn EPS0() -> Real { pub(crate) fn EPS0() -> Real {
super::EPS0.into() super::EPS0.into()
} }
@@ -84,9 +84,9 @@ pub mod consts {
pub(crate) fn ZERO() -> Real { pub(crate) fn ZERO() -> Real {
0.0.into() 0.0.into()
} }
pub(crate) fn ONE() -> Real { // pub(crate) fn ONE() -> Real {
1.0.into() // 1.0.into()
} // }
pub(crate) fn TWO() -> Real { pub(crate) fn TWO() -> Real {
2.0.into() 2.0.into()
} }

View File

@@ -6,7 +6,6 @@ use dyn_clone::{self, DynClone};
use log::trace; use log::trace;
use ndarray::{Array3, Zip}; use ndarray::{Array3, Zip};
use ndarray::parallel::prelude::*;
use serde::{Serialize, Deserialize}; use serde::{Serialize, Deserialize};
use std::convert::From; use std::convert::From;
use std::iter::Sum; use std::iter::Sum;

View File

@@ -1,9 +1,6 @@
use crate::consts; use crate::consts;
use crate::flt::Flt; use crate::flt::Flt;
use crate::geom::{Coord as _, Index, Meters, Region, Vec3, Vec3u}; use crate::geom::{Meters, Region, Vec3};
use crate::sim::GenericSim;
use log::debug;
pub trait AbstractStimulus: Sync { pub trait AbstractStimulus: Sync {
/// Return the E field which should be added to the provided position/time. /// Return the E field which should be added to the provided position/time.
@@ -121,7 +118,7 @@ mod test {
#[test] #[test]
fn sinusoid() { fn sinusoid() {
let mut s = Sinusoid::new((10.0, 1.0, -100.0).into(), 1000.0); let s = Sinusoid::new((10.0, 1.0, -100.0).into(), 1000.0);
assert_eq!(s.at(0.0), Vec3::zero()); assert_eq!(s.at(0.0), Vec3::zero());
assert_approx_eq!(s.at(0.00025), (10.0, 1.0, -100.0).into()); assert_approx_eq!(s.at(0.00025), (10.0, 1.0, -100.0).into());
assert_approx_eq!(s.at(0.00050), Vec3::zero()); assert_approx_eq!(s.at(0.00050), Vec3::zero());
@@ -130,7 +127,7 @@ mod test {
#[test] #[test]
fn sinusoid_from_wavelength() { fn sinusoid_from_wavelength() {
let mut s = Sinusoid::from_wavelength((10.0, 1.0, -100.0).into(), 0.001); let s = Sinusoid::from_wavelength((10.0, 1.0, -100.0).into(), 0.001);
assert_eq!(s.at(0.0), Vec3::zero()); assert_eq!(s.at(0.0), Vec3::zero());
assert_approx_eq!(s.at(0.00025), (10.0, 1.0, -100.0).into()); assert_approx_eq!(s.at(0.00025), (10.0, 1.0, -100.0).into());
assert_approx_eq!(s.at(0.00050), Vec3::zero()); assert_approx_eq!(s.at(0.00050), Vec3::zero());