Skip to content
Snippets Groups Projects
Commit 13268718 authored by Udo Eisenbarth's avatar Udo Eisenbarth :speech_balloon:
Browse files

code cleanup

parent 07796347
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,7 @@ fn main() {
}
fn read_and_parse_model(path: &Path) -> Result<OpticScenery> {
print!("\nReading model...");
let contents = fs::read_to_string(&path).map_err(|e| {
let contents = fs::read_to_string(path).map_err(|e| {
OpossumError::Console(format!(
"cannot read file {} : {}",
path.display(),
......
......@@ -5,7 +5,7 @@ use crate::error::OpossumError;
use crate::lightdata::{DataEnergy, LightData};
use crate::optic_ports::OpticPorts;
use crate::optical::{LightResult, Optical};
use crate::properties::{Properties, Property, Proptype};
use crate::properties::{Properties, Property};
use crate::spectrum::Spectrum;
use std::collections::HashMap;
......@@ -34,18 +34,8 @@ pub struct IdealFilter {
fn create_default_props() -> Properties {
let mut props = Properties::default();
props.set(
"name",
Property {
prop: Proptype::String("group".into()),
},
);
props.set(
"inverted",
Property {
prop: Proptype::Bool(false),
},
);
props.set("name", "ideal filter".into());
props.set("inverted", false.into());
props
}
......
......@@ -27,12 +27,7 @@ pub struct Source {
}
fn create_default_props() -> Properties {
let mut props = Properties::default();
props.set(
"name",
Property {
prop: Proptype::String("source".into()),
},
);
props.set("name", "source".into());
props.set(
"light data",
Property {
......@@ -66,12 +61,7 @@ impl Source {
/// ```
pub fn new(name: &str, light: LightData) -> Self {
let mut props = create_default_props();
props.set(
"name",
Property {
prop: Proptype::String(name.into()),
},
);
props.set("name", name.into());
props.set(
"light data",
Property {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment