Fix a bunch of warnings
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use coremem::{GenericSim, Driver, mat};
|
||||
use coremem::{GenericSim, Driver};
|
||||
use coremem::geom::Index;
|
||||
|
||||
fn main() {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
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 log::trace;
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
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 log::trace;
|
||||
|
||||
fn main() {
|
||||
coremem::init_logging();
|
||||
@@ -20,7 +19,6 @@ fn main() {
|
||||
|
||||
let from_m = |m| (m/feat_size) 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_depth = depth * 0.5;
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use coremem::{GenericSim as _, StaticSim};
|
||||
use coremem::StaticSim;
|
||||
use coremem::render::{ColorTermRenderer, Renderer as _, SerializedFrame};
|
||||
|
||||
use std::fs::{DirEntry, File, read_dir};
|
||||
use std::io::{BufReader, Read as _, stdin};
|
||||
use std::io::BufReader;
|
||||
use std::ops::Deref;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::time::Duration;
|
||||
|
@@ -7,7 +7,7 @@ use crate::render::{self, MultiRenderer, Renderer};
|
||||
use crate::sim::{GenericSim, SimState};
|
||||
use crate::stim::AbstractStimulus;
|
||||
|
||||
use log::{info, debug, trace};
|
||||
use log::{info, trace};
|
||||
use std::path::PathBuf;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::sync::mpsc::{sync_channel, SyncSender, Receiver};
|
||||
|
12
src/lib.rs
12
src/lib.rs
@@ -72,9 +72,9 @@ pub mod consts {
|
||||
pub(crate) fn C() -> Real {
|
||||
super::C.into()
|
||||
}
|
||||
pub(crate) fn C2() -> Real {
|
||||
C() * C()
|
||||
}
|
||||
// pub(crate) fn C2() -> Real {
|
||||
// C() * C()
|
||||
// }
|
||||
pub(crate) fn EPS0() -> Real {
|
||||
super::EPS0.into()
|
||||
}
|
||||
@@ -84,9 +84,9 @@ pub mod consts {
|
||||
pub(crate) fn ZERO() -> Real {
|
||||
0.0.into()
|
||||
}
|
||||
pub(crate) fn ONE() -> Real {
|
||||
1.0.into()
|
||||
}
|
||||
// pub(crate) fn ONE() -> Real {
|
||||
// 1.0.into()
|
||||
// }
|
||||
pub(crate) fn TWO() -> Real {
|
||||
2.0.into()
|
||||
}
|
||||
|
@@ -6,7 +6,6 @@ use dyn_clone::{self, DynClone};
|
||||
use log::trace;
|
||||
|
||||
use ndarray::{Array3, Zip};
|
||||
use ndarray::parallel::prelude::*;
|
||||
use serde::{Serialize, Deserialize};
|
||||
use std::convert::From;
|
||||
use std::iter::Sum;
|
||||
|
@@ -1,9 +1,6 @@
|
||||
use crate::consts;
|
||||
use crate::flt::Flt;
|
||||
use crate::geom::{Coord as _, Index, Meters, Region, Vec3, Vec3u};
|
||||
use crate::sim::GenericSim;
|
||||
|
||||
use log::debug;
|
||||
use crate::geom::{Meters, Region, Vec3};
|
||||
|
||||
pub trait AbstractStimulus: Sync {
|
||||
/// Return the E field which should be added to the provided position/time.
|
||||
@@ -121,7 +118,7 @@ mod test {
|
||||
|
||||
#[test]
|
||||
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_approx_eq!(s.at(0.00025), (10.0, 1.0, -100.0).into());
|
||||
assert_approx_eq!(s.at(0.00050), Vec3::zero());
|
||||
@@ -130,7 +127,7 @@ mod test {
|
||||
|
||||
#[test]
|
||||
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_approx_eq!(s.at(0.00025), (10.0, 1.0, -100.0).into());
|
||||
assert_approx_eq!(s.at(0.00050), Vec3::zero());
|
||||
|
Reference in New Issue
Block a user