fmt
This commit is contained in:
@ -714,8 +714,10 @@ impl EdgeDisplay {
|
||||
Box::new(move |i, n| {
|
||||
let mut accumulator = String::new();
|
||||
for b in &self.base {
|
||||
let f = b
|
||||
.match_edge_display(Arc::clone(&translator), common.clone());
|
||||
let f = b.match_edge_display(
|
||||
Arc::clone(&translator),
|
||||
common.clone(),
|
||||
);
|
||||
accumulator.push_str(&(f)(i, n));
|
||||
}
|
||||
accumulator
|
||||
@ -862,7 +864,11 @@ impl NodeColorConditional {
|
||||
use super::format_helpers::node_formatter::*;
|
||||
match self {
|
||||
| Self::ContextConditional(ContextColorConditional::Nill) =>
|
||||
format_nill(Arc::clone(&original_graph), color.to_string(), star),
|
||||
format_nill(
|
||||
Arc::clone(&original_graph),
|
||||
color.to_string(),
|
||||
star,
|
||||
),
|
||||
| Self::ContextConditional(
|
||||
ContextColorConditional::RecursiveIdentifier(s),
|
||||
) => format_recursive_identifier(
|
||||
@ -920,7 +926,11 @@ impl NodeColorConditional {
|
||||
use super::format_helpers::positive_node_formatter::*;
|
||||
match self {
|
||||
| Self::ContextConditional(ContextColorConditional::Nill) =>
|
||||
format_nill(Arc::clone(&original_graph), color.to_string(), star),
|
||||
format_nill(
|
||||
Arc::clone(&original_graph),
|
||||
color.to_string(),
|
||||
star,
|
||||
),
|
||||
| Self::ContextConditional(
|
||||
ContextColorConditional::RecursiveIdentifier(s),
|
||||
) => format_recursive_identifier(
|
||||
|
||||
@ -32,7 +32,9 @@ where
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, Default)]
|
||||
#[derive(
|
||||
Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, Default,
|
||||
)]
|
||||
pub enum Process {
|
||||
#[default]
|
||||
Nill,
|
||||
@ -242,7 +244,9 @@ impl PrintableWithTranslator for Process {
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, Default)]
|
||||
#[derive(
|
||||
Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, Default,
|
||||
)]
|
||||
pub enum PositiveProcess {
|
||||
#[default]
|
||||
Nill,
|
||||
|
||||
@ -316,8 +316,8 @@ impl Reaction {
|
||||
pub fn into_positive_reactions(
|
||||
reactions: &[Self],
|
||||
) -> Vec<PositiveReaction> {
|
||||
let reactions =
|
||||
reactions.iter()
|
||||
let reactions = reactions
|
||||
.iter()
|
||||
.filter(|r| !r.reactants.is_empty() || !r.inhibitors.is_empty())
|
||||
.cloned()
|
||||
.collect::<Vec<Self>>();
|
||||
@ -325,7 +325,6 @@ impl Reaction {
|
||||
let mut res = vec![];
|
||||
let old_reactions = &reactions;
|
||||
|
||||
|
||||
let all_products = Reaction::all_products(old_reactions);
|
||||
for el in all_products {
|
||||
let p = Reaction::all_reactions_with_product(old_reactions, &el);
|
||||
|
||||
@ -237,7 +237,7 @@ impl Set {
|
||||
inhibitors: &[Set],
|
||||
) -> Result<Vec<PositiveSet>, String> {
|
||||
if reactants.is_empty() && inhibitors.is_empty() {
|
||||
return Ok(vec![])
|
||||
return Ok(vec![]);
|
||||
}
|
||||
if reactants.len() != inhibitors.len() {
|
||||
return Err(format!(
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use super::set::PositiveSet;
|
||||
use super::system::BasicSystem;
|
||||
use crate::system::ExtensionsSystem;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[test]
|
||||
fn one_transition() {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
use std::fmt::Debug;
|
||||
use std::ops::{Index, IndexMut};
|
||||
use std::sync::Arc;
|
||||
use std::slice::SliceIndex;
|
||||
use std::sync::Arc;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user