diff --git a/src/uvh5.rs b/src/uvh5.rs index e27dd21..d43c682 100644 --- a/src/uvh5.rs +++ b/src/uvh5.rs @@ -99,14 +99,14 @@ where // append the version string if it is not already there. if !history - .replace(" ", "") - .replace("\n", "") - .contains(&print_version_str().replace(" ", "").replace("\n", "")) + .replace(' ', "") + .replace('\n', "") + .contains(&print_version_str().replace(' ', "").replace('\n', "")) { history.push_str(&print_version_str()); } - let vis_units: VisUnit = match header.link_exists(&"vis_units".to_string()) { + let vis_units: VisUnit = match header.link_exists("vis_units") { true => VisUnit::from_str( &header .dataset("vis_units")? @@ -136,15 +136,14 @@ where )?; let antenna_diameters: Option> = - match header.link_exists(&"antenna_diameters".to_string()) { + match header.link_exists("antenna_diameters") { true => Some(header.dataset("antenna_diameters")?.read::()?), false => None, }; let uvplane_reference_time: Option = read_scalar::(&header, "uvplane_reference_time")?; - let eq_coeffs: Option> = match header.link_exists(&"eq_coeffs".to_string()) - { + let eq_coeffs: Option> = match header.link_exists("eq_coeffs") { true => Some(header.dataset("eq_coeffs")?.read::()?), false => None, }; @@ -233,11 +232,10 @@ where ndim => return Err(format!("Incompatible dimensions of freq array: {:}", ndim).into()), }; - let spw_id_array: Array = - match header.link_exists(&"flex_spw_id_array".to_string()) { - true => header.dataset("flex_spw_id_array")?.read::()?, - false => Array::::zeros(meta.nfreqs as usize), - }; + let spw_id_array: Array = match header.link_exists("flex_spw_id_array") { + true => header.dataset("flex_spw_id_array")?.read::()?, + false => Array::::zeros(meta.nfreqs as usize), + }; let polarization_array: Array = header.dataset("polarization_array")?.read::()?; let integration_time: Array = @@ -526,9 +524,9 @@ where let mut hist_out = self.meta.history.clone(); // append the version string if it is not already there. if !hist_out - .replace(" ", "") - .replace("\n", "") - .contains(&print_version_str().replace(" ", "").replace("\n", "")) + .replace(' ', "") + .replace('\n', "") + .contains(&print_version_str().replace(' ', "").replace('\n', "")) { hist_out.push_str(&print_version_str()); }