clippy
This commit is contained in:
parent
c6d3b86237
commit
b25d1eb0c6
|
@ -167,9 +167,7 @@ fn get_transfer_for_pair(
|
|||
.filter(|x| x.source_plate == source_name && x.destination_plate == destination_name)
|
||||
.peekable();
|
||||
|
||||
if filtered_records.peek().is_none() {
|
||||
return None;
|
||||
}
|
||||
filtered_records.peek()?;
|
||||
|
||||
let mut source_wells: HashSet<Well> = HashSet::new();
|
||||
let mut destination_wells: HashSet<Well> = HashSet::new();
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
pub fn mangle_headers(data: &str) -> String {
|
||||
let (header, rows) = data.split_at(data.find('\n').unwrap());
|
||||
let fields = header.trim().split(",");
|
||||
let fields = header.trim().split(',');
|
||||
let mut modified_headers: Vec<String> = Vec::new();
|
||||
for field in fields {
|
||||
if let Some(f) = detect_field(field) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{plate::PlateFormat, transfer::Transfer, util::num_to_letters};
|
||||
use crate::{plate::PlateFormat, util::num_to_letters};
|
||||
|
||||
/// Represents a single line of a CSV picklist.
|
||||
/// In practice, this is generated from the deserialize intermediate.
|
||||
|
|
|
@ -296,11 +296,11 @@ fn auto_callback(
|
|||
Closure::<dyn FnMut(_)>::new(move |_| {
|
||||
let res = auto(&records);
|
||||
main_dispatch.reduce_mut(|state| {
|
||||
state.source_plates.extend(res.sources.into_iter());
|
||||
state.source_plates.extend(res.sources);
|
||||
state
|
||||
.destination_plates
|
||||
.extend(res.destinations.into_iter());
|
||||
state.transfers.extend(res.transfers.into_iter());
|
||||
.extend(res.destinations);
|
||||
state.transfers.extend(res.transfers);
|
||||
});
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
#![allow(non_snake_case)]
|
||||
|
||||
use js_sys::Function;
|
||||
|
||||
use wasm_bindgen::{prelude::*, JsCast};
|
||||
use web_sys::{
|
||||
FileReader, HtmlButtonElement, HtmlDialogElement, HtmlElement, HtmlFormElement,
|
||||
HtmlInputElement, HtmlOptionElement, HtmlSelectElement,
|
||||
HtmlDialogElement, HtmlFormElement, HtmlOptionElement, HtmlSelectElement,
|
||||
};
|
||||
|
||||
use yew::prelude::*;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use plate_tool_lib::{plate::PlateType, plate_instances::PlateInstance};
|
||||
use plate_tool_lib::{plate::PlateType};
|
||||
use uuid::Uuid;
|
||||
use wasm_bindgen::{prelude::*, JsCast};
|
||||
use web_sys::{
|
||||
HtmlDialogElement, HtmlElement, HtmlFormElement, HtmlInputElement, HtmlOptionElement,
|
||||
HtmlDialogElement, HtmlElement, HtmlOptionElement,
|
||||
HtmlSelectElement,
|
||||
};
|
||||
|
||||
|
@ -203,7 +203,7 @@ fn find_plate_type(main_dispatch: Dispatch<MainState>, id: Uuid) -> Option<Plate
|
|||
.iter()
|
||||
.any(|x| x.get_uuid() == id)
|
||||
{
|
||||
return Some(PlateType::Source);
|
||||
Some(PlateType::Source)
|
||||
} else if main_dispatch
|
||||
.get()
|
||||
.destination_plates
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#![allow(non_snake_case)]
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::ops::Deref;
|
||||
use plate_tool_lib::transfer_region::TransferRegion;
|
||||
|
||||
|
||||
use plate_tool_lib::transfer_volume::TransferVolume;
|
||||
use yew::prelude::*;
|
||||
use yewdux::prelude::*;
|
||||
|
@ -281,7 +281,7 @@ fn count_plate_usage(transfer: &Transfer, well: &Well) -> Option<u32> {
|
|||
}
|
||||
|
||||
let map = transfer.transfer_region.calculate_map();
|
||||
map(*well).and_then(|list| Some(list.len() as u32))
|
||||
map(*well).map(|list| list.len() as u32)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
use plate_tool_lib::plate::PlateFormat;
|
||||
use uuid::Uuid;
|
||||
use wasm_bindgen::JsCast;
|
||||
use web_sys::{HtmlDialogElement, HtmlInputElement};
|
||||
|
||||
use web_sys::{HtmlDialogElement};
|
||||
use yew::prelude::*;
|
||||
use yewdux::prelude::*;
|
||||
|
||||
use crate::components::callbacks::{main_window_callbacks, tree_callbacks};
|
||||
use crate::components::callbacks::{tree_callbacks};
|
||||
use crate::components::new_plate_dialog::NewPlateDialogType;
|
||||
use crate::components::states::{CurrentTransfer, MainState};
|
||||
|
||||
|
@ -164,16 +164,14 @@ fn PlateInfoModal(props: &PlateInfoModalProps) -> Html {
|
|||
None => "Not Found".to_string(),
|
||||
};
|
||||
let plate_format = plate.map(|p| p.plate.plate_format);
|
||||
let plate_formats = vec![
|
||||
PlateFormat::W6,
|
||||
let plate_formats = [PlateFormat::W6,
|
||||
PlateFormat::W12,
|
||||
PlateFormat::W24,
|
||||
PlateFormat::W48,
|
||||
PlateFormat::W96,
|
||||
PlateFormat::W384,
|
||||
PlateFormat::W1536,
|
||||
PlateFormat::W3456,
|
||||
];
|
||||
PlateFormat::W3456];
|
||||
let plate_format_options = plate_formats.iter().map(|v| {
|
||||
let selected = Some(v) == plate_format.as_ref();
|
||||
html! {
|
||||
|
|
Loading…
Reference in New Issue