match self
Self
This commit is contained in:
parent
5cbabbdb37
commit
e7dc834c8b
@ -53,8 +53,8 @@ where
|
|||||||
{
|
{
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
UnbalancedTree::Leaf => write!(f, "."),
|
Self::Leaf => write!(f, "."),
|
||||||
UnbalancedTree::Node(reference) => write!(f, "{}", reference),
|
Self::Node(reference) => write!(f, "{}", reference),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -109,8 +109,8 @@ impl<'a, T: Monad<'a>, A: 'a + Clone> TraversibleBinaryTree<'a, T, A, Unbalanced
|
|||||||
{
|
{
|
||||||
fn refer(&self) -> Option<Rc<dyn TraversibleBinaryReference<'a, T, A, UnbalancedData>>> {
|
fn refer(&self) -> Option<Rc<dyn TraversibleBinaryReference<'a, T, A, UnbalancedData>>> {
|
||||||
match self {
|
match self {
|
||||||
UnbalancedTree::Leaf => None,
|
Self::Leaf => None,
|
||||||
UnbalancedTree::Node(reference) => Some(reference.clone()),
|
Self::Node(reference) => Some(reference.clone()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,16 +20,15 @@ type Oet<'a> = Option<EvalTree<'a>>;
|
|||||||
impl<'a> EvalTree<'a> {
|
impl<'a> EvalTree<'a> {
|
||||||
fn next(self) -> Oet<'a> {
|
fn next(self) -> Oet<'a> {
|
||||||
match self {
|
match self {
|
||||||
EvalTree::Atom(f) => f(),
|
Self::Atom(f) => f(),
|
||||||
EvalTree::Composite(etl, etr) => match *etl {
|
Self::Composite(etl, etr) => match *etl {
|
||||||
EvalTree::Atom(f) => match f() {
|
Self::Atom(f) => match f() {
|
||||||
Some(newleft) => Some(EvalTree::Composite(Box::new(newleft), etr)),
|
Some(newleft) => Some(Self::Composite(Box::new(newleft), etr)),
|
||||||
None => Some(*etr),
|
None => Some(*etr),
|
||||||
},
|
},
|
||||||
EvalTree::Composite(etll, etlr) => Some(EvalTree::Composite(
|
Self::Composite(etll, etlr) => {
|
||||||
etll,
|
Some(Self::Composite(etll, Box::new(Self::Composite(etlr, etr))))
|
||||||
Box::new(EvalTree::Composite(etlr, etr)),
|
}
|
||||||
)),
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ pub type R = TestResults;
|
|||||||
impl R {
|
impl R {
|
||||||
pub fn unwrap(self) {
|
pub fn unwrap(self) {
|
||||||
match self {
|
match self {
|
||||||
TestResults {
|
Self {
|
||||||
success,
|
success,
|
||||||
total,
|
total,
|
||||||
result: Err(e),
|
result: Err(e),
|
||||||
|
@ -12,8 +12,8 @@ pub enum ResolutionError<L, P> {
|
|||||||
impl<L, P> ResolutionError<L, P> {
|
impl<L, P> ResolutionError<L, P> {
|
||||||
pub fn map_parse<Px>(self, f: impl FnOnce(P) -> Px) -> ResolutionError<L, Px> {
|
pub fn map_parse<Px>(self, f: impl FnOnce(P) -> Px) -> ResolutionError<L, Px> {
|
||||||
match self {
|
match self {
|
||||||
ResolutionError::Lookup(l) => ResolutionError::Lookup(l),
|
Self::Lookup(l) => ResolutionError::Lookup(l),
|
||||||
ResolutionError::Parse(p) => ResolutionError::Parse(f(p)),
|
Self::Parse(p) => ResolutionError::Parse(f(p)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,13 +40,13 @@ pub enum CastError<'a> {
|
|||||||
impl<'a> Display for CastError<'a> {
|
impl<'a> Display for CastError<'a> {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
CastError::Typeless(typeless_error) => {
|
Self::Typeless(typeless_error) => {
|
||||||
write!(f, "typeless cast error: {}", typeless_error)
|
write!(f, "typeless cast error: {}", typeless_error)
|
||||||
}
|
}
|
||||||
CastError::AddressIndexOutOfBounds { index, length } => {
|
Self::AddressIndexOutOfBounds { index, length } => {
|
||||||
write!(f, "cast index out of bound: {}>={}", index, length)
|
write!(f, "cast index out of bound: {}>={}", index, length)
|
||||||
}
|
}
|
||||||
CastError::AddressPointMismatch {
|
Self::AddressPointMismatch {
|
||||||
expected,
|
expected,
|
||||||
received,
|
received,
|
||||||
index,
|
index,
|
||||||
|
@ -37,10 +37,10 @@ pub enum PairParseError<ErrorA: Error, ErrorB: Error> {
|
|||||||
impl<ErrorA: Error, ErrorB: Error> Display for PairParseError<ErrorA, ErrorB> {
|
impl<ErrorA: Error, ErrorB: Error> Display for PairParseError<ErrorA, ErrorB> {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
PairParseError::A(error) => {
|
Self::A(error) => {
|
||||||
write!(f, "error while parsing first element of a pair: {}", error)
|
write!(f, "error while parsing first element of a pair: {}", error)
|
||||||
}
|
}
|
||||||
PairParseError::B(error) => {
|
Self::B(error) => {
|
||||||
write!(f, "error while parsing second element of a pair: {}", error)
|
write!(f, "error while parsing second element of a pair: {}", error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,162 +0,0 @@
|
|||||||
use std::rc::Rc;
|
|
||||||
|
|
||||||
use crate::flow::traversible::*;
|
|
||||||
use crate::func::*;
|
|
||||||
use crate::rstd::fallible::*;
|
|
||||||
|
|
||||||
use super::*;
|
|
||||||
|
|
||||||
pub type TPE<'a, Ctx, A> = TreeParseError<ParseError<'a, Ctx, Fctr<'a, Ctx, A>>>;
|
|
||||||
|
|
||||||
pub type TreeFaiure<'a, Ctx, A> =
|
|
||||||
ResolutionError<<Ctx as Context<'a>>::LookupError, TPE<'a, Ctx, A>>;
|
|
||||||
|
|
||||||
pub type SubsetWrapped<'a, Ctx, A> = FallibleWrapped<'a, Ctx, bool, TreeFaiure<'a, Ctx, A>>;
|
|
||||||
|
|
||||||
pub type SubsetMonad<'a, Ctx, A> = FallibleMonad<'a, Ctx, TreeFaiure<'a, Ctx, A>>;
|
|
||||||
|
|
||||||
pub fn subset_pure<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>>(
|
|
||||||
value: bool,
|
|
||||||
) -> SubsetWrapped<'a, Ctx, A> {
|
|
||||||
<SubsetMonad<'a, Ctx, A> as Pure>::pure(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(PartialEq)]
|
|
||||||
enum NodeType {
|
|
||||||
Rb,
|
|
||||||
R,
|
|
||||||
B,
|
|
||||||
}
|
|
||||||
|
|
||||||
type RefData = (NodeType, Hash);
|
|
||||||
|
|
||||||
impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>>
|
|
||||||
TraversibleBinaryNode<'a, SubsetMonad<'a, Ctx, A>, A, RefData> for BNode<'a, Ctx, A>
|
|
||||||
{
|
|
||||||
fn split(&self) -> Split<'a, SubsetMonad<'a, Ctx, A>, A, RefData> {
|
|
||||||
(
|
|
||||||
Rc::new(self.cl.clone()),
|
|
||||||
Rc::new(self.cr.clone()),
|
|
||||||
self.key.clone(),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn to_tree(
|
|
||||||
self: Rc<Self>,
|
|
||||||
) -> Rc<dyn TraversibleBinaryTree<'a, SubsetMonad<'a, Ctx, A>, A, RefData>> {
|
|
||||||
Rc::new(Nullable::from(self))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>>
|
|
||||||
TraversibleBinaryNode<'a, SubsetMonad<'a, Ctx, A>, A, RefData> for RNode<'a, Ctx, A>
|
|
||||||
{
|
|
||||||
fn split(&self) -> Split<'a, SubsetMonad<'a, Ctx, A>, A, RefData> {
|
|
||||||
(
|
|
||||||
Rc::new(self.cl.clone()),
|
|
||||||
Rc::new(self.cr.clone()),
|
|
||||||
self.key.clone(),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn to_tree(
|
|
||||||
self: Rc<Self>,
|
|
||||||
) -> Rc<dyn TraversibleBinaryTree<'a, SubsetMonad<'a, Ctx, A>, A, RefData>> {
|
|
||||||
Rc::new(Nullable::from(self))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>>
|
|
||||||
TraversibleBinaryNode<'a, SubsetMonad<'a, Ctx, A>, A, RefData> for RBNode<'a, Ctx, A>
|
|
||||||
{
|
|
||||||
fn split(&self) -> Split<'a, SubsetMonad<'a, Ctx, A>, A, RefData> {
|
|
||||||
match self {
|
|
||||||
RBNode::R(r) => r.split(),
|
|
||||||
RBNode::B(b) => b.split(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn to_tree(
|
|
||||||
self: Rc<Self>,
|
|
||||||
) -> Rc<dyn TraversibleBinaryTree<'a, SubsetMonad<'a, Ctx, A>, A, RefData>> {
|
|
||||||
Rc::new(Nullable::from(self))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>>
|
|
||||||
TraversibleBinaryReference<'a, SubsetMonad<'a, Ctx, A>, A, RefData>
|
|
||||||
for Point<'a, Ctx, BNode<'a, Ctx, A>>
|
|
||||||
{
|
|
||||||
fn resolve(
|
|
||||||
&self,
|
|
||||||
) -> Wrap<
|
|
||||||
'a,
|
|
||||||
Rc<dyn TraversibleBinaryNode<'a, SubsetMonad<'a, Ctx, A>, A, RefData>>,
|
|
||||||
SubsetMonad<'a, Ctx, A>,
|
|
||||||
> {
|
|
||||||
<SubsetMonad<'a, Ctx, A> as Functor>::fmap(Ctx::stuff(self.resolve()), |resolved| {
|
|
||||||
resolved as Rc<dyn TraversibleBinaryNode<'a, _, _, _>>
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
fn data(&self) -> RefData {
|
|
||||||
(NodeType::B, self.point)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>>
|
|
||||||
TraversibleBinaryReference<'a, SubsetMonad<'a, Ctx, A>, A, RefData>
|
|
||||||
for Point<'a, Ctx, RNode<'a, Ctx, A>>
|
|
||||||
{
|
|
||||||
fn resolve(
|
|
||||||
&self,
|
|
||||||
) -> Wrap<
|
|
||||||
'a,
|
|
||||||
Rc<dyn TraversibleBinaryNode<'a, SubsetMonad<'a, Ctx, A>, A, RefData>>,
|
|
||||||
SubsetMonad<'a, Ctx, A>,
|
|
||||||
> {
|
|
||||||
<SubsetMonad<'a, Ctx, A> as Functor>::fmap(Ctx::stuff(self.resolve()), |resolved| {
|
|
||||||
resolved as Rc<dyn TraversibleBinaryNode<'a, _, _, _>>
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
fn data(&self) -> RefData {
|
|
||||||
(NodeType::R, self.point)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>>
|
|
||||||
TraversibleBinaryReference<'a, SubsetMonad<'a, Ctx, A>, A, RefData>
|
|
||||||
for Point<'a, Ctx, RBNode<'a, Ctx, A>>
|
|
||||||
{
|
|
||||||
fn resolve(
|
|
||||||
&self,
|
|
||||||
) -> Wrap<
|
|
||||||
'a,
|
|
||||||
Rc<dyn TraversibleBinaryNode<'a, SubsetMonad<'a, Ctx, A>, A, RefData>>,
|
|
||||||
SubsetMonad<'a, Ctx, A>,
|
|
||||||
> {
|
|
||||||
<SubsetMonad<'a, Ctx, A> as Functor>::fmap(Ctx::stuff(self.resolve()), |resolved| {
|
|
||||||
resolved as Rc<dyn TraversibleBinaryNode<'a, _, _, _>>
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
fn data(&self) -> RefData {
|
|
||||||
(NodeType::Rb, self.point)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>, T: Mentionable<'a, Ctx>, D: 'a + PartialEq>
|
|
||||||
TraversibleBinaryTree<'a, SubsetMonad<'a, Ctx, A>, A, D> for Nullable<'a, Ctx, T>
|
|
||||||
where
|
|
||||||
Point<'a, Ctx, T>: TraversibleBinaryReference<'a, SubsetMonad<'a, Ctx, A>, A, D>,
|
|
||||||
{
|
|
||||||
fn refer(
|
|
||||||
&self,
|
|
||||||
) -> Option<Rc<dyn TraversibleBinaryReference<'a, SubsetMonad<'a, Ctx, A>, A, D>>> {
|
|
||||||
match self {
|
|
||||||
Nullable::Null(_) => None,
|
|
||||||
Nullable::NotNull(point) => Some(Rc::new(point.clone())),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -22,8 +22,8 @@ pub struct NullableFactory<F> {
|
|||||||
impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>> Serializable for Nullable<'a, Ctx, A> {
|
impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>> Serializable for Nullable<'a, Ctx, A> {
|
||||||
fn serialize(&self, serializer: &mut dyn Serializer) {
|
fn serialize(&self, serializer: &mut dyn Serializer) {
|
||||||
serializer.write(match self {
|
serializer.write(match self {
|
||||||
Nullable::Null(_) => &HASH_ZEROS,
|
Self::Null(_) => &HASH_ZEROS,
|
||||||
Nullable::NotNull(point) => &point.point,
|
Self::NotNull(point) => &point.point,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -33,10 +33,10 @@ impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>> Mentionable<'a, Ctx> for Nul
|
|||||||
|
|
||||||
fn factory(&self) -> Self::Fctr {
|
fn factory(&self) -> Self::Fctr {
|
||||||
match self {
|
match self {
|
||||||
Nullable::Null(factory) => NullableFactory {
|
Self::Null(factory) => NullableFactory {
|
||||||
factory: factory.clone(),
|
factory: factory.clone(),
|
||||||
},
|
},
|
||||||
Nullable::NotNull(point) => NullableFactory {
|
Self::NotNull(point) => NullableFactory {
|
||||||
factory: point.origin.factory(),
|
factory: point.origin.factory(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -44,8 +44,8 @@ impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>> Mentionable<'a, Ctx> for Nul
|
|||||||
|
|
||||||
fn points_typed(&self, points: &mut impl TakesPoints<'a, Ctx>) {
|
fn points_typed(&self, points: &mut impl TakesPoints<'a, Ctx>) {
|
||||||
match self {
|
match self {
|
||||||
Nullable::Null(_) => {}
|
Self::Null(_) => {}
|
||||||
Nullable::NotNull(point) => points.take(point),
|
Self::NotNull(point) => points.take(point),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,8 +102,8 @@ impl WithLengthAndWidth<RenderedLong> {
|
|||||||
impl RenderedWide {
|
impl RenderedWide {
|
||||||
fn any(self) -> RenderedAny {
|
fn any(self) -> RenderedAny {
|
||||||
match self {
|
match self {
|
||||||
RenderedWide::Common(common) => RenderedAny::Common(common),
|
Self::Common(common) => RenderedAny::Common(common),
|
||||||
RenderedWide::Wide(vec) => RenderedAny::Wide(vec),
|
Self::Wide(vec) => RenderedAny::Wide(vec),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -111,8 +111,8 @@ impl RenderedWide {
|
|||||||
impl RenderedLong {
|
impl RenderedLong {
|
||||||
fn any(self) -> RenderedAny {
|
fn any(self) -> RenderedAny {
|
||||||
match self {
|
match self {
|
||||||
RenderedLong::Common(common) => RenderedAny::Common(common),
|
Self::Common(common) => RenderedAny::Common(common),
|
||||||
RenderedLong::Long(vec) => RenderedAny::Long(vec),
|
Self::Long(vec) => RenderedAny::Long(vec),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -191,10 +191,10 @@ impl RenderedCommon {
|
|||||||
impl RenderedCommon {
|
impl RenderedCommon {
|
||||||
fn rectangles(self, vec: &mut Vec<(usize, usize)>, t: usize, c: usize) {
|
fn rectangles(self, vec: &mut Vec<(usize, usize)>, t: usize, c: usize) {
|
||||||
match self {
|
match self {
|
||||||
RenderedCommon::Empty => {}
|
Self::Empty => {}
|
||||||
RenderedCommon::Resolution => vec.push((t, c)),
|
Self::Resolution => vec.push((t, c)),
|
||||||
RenderedCommon::Event(_) => {}
|
Self::Event(_) => {}
|
||||||
RenderedCommon::Action { rendered, .. } => rendered.rectangles(vec, t, c),
|
Self::Action { rendered, .. } => rendered.rectangles(vec, t, c),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ pub struct TraceBox {
|
|||||||
impl Trace {
|
impl Trace {
|
||||||
fn fmt_parallel(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt_parallel(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
Trace::Parallel(a, b) => {
|
Self::Parallel(a, b) => {
|
||||||
write!(f, "{} | {}", ParallelBox(a), ParallelBox(b))
|
write!(f, "{} | {}", ParallelBox(a), ParallelBox(b))
|
||||||
}
|
}
|
||||||
trace => write!(f, "{}", trace),
|
trace => write!(f, "{}", trace),
|
||||||
@ -29,7 +29,7 @@ impl Trace {
|
|||||||
|
|
||||||
fn fmt_sequential(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt_sequential(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
Trace::Sequential { first, second } => {
|
Self::Sequential { first, second } => {
|
||||||
write!(f, "{} > {}", SequentialBox(first), SequentialBox(second))
|
write!(f, "{} > {}", SequentialBox(first), SequentialBox(second))
|
||||||
}
|
}
|
||||||
trace => write!(f, "{}", trace),
|
trace => write!(f, "{}", trace),
|
||||||
|
@ -18,15 +18,15 @@ enum TraceAny<'a> {
|
|||||||
impl Trace {
|
impl Trace {
|
||||||
fn any(&self) -> TraceAny<'_> {
|
fn any(&self) -> TraceAny<'_> {
|
||||||
match self {
|
match self {
|
||||||
Trace::Pure => TraceAny::Common(TraceCommon::Pure),
|
Self::Pure => TraceAny::Common(TraceCommon::Pure),
|
||||||
Trace::InvolvesOneResolution => TraceAny::Common(TraceCommon::InvolvesOneResolution),
|
Self::InvolvesOneResolution => TraceAny::Common(TraceCommon::InvolvesOneResolution),
|
||||||
Trace::Event(event) => TraceAny::Common(TraceCommon::Event(event)),
|
Self::Event(event) => TraceAny::Common(TraceCommon::Event(event)),
|
||||||
Trace::Wrapped { name, trace } => TraceAny::Common(TraceCommon::Wrapped {
|
Self::Wrapped { name, trace } => TraceAny::Common(TraceCommon::Wrapped {
|
||||||
name,
|
name,
|
||||||
trace: &trace.trace,
|
trace: &trace.trace,
|
||||||
}),
|
}),
|
||||||
Trace::Parallel(a, b) => TraceAny::Parallel(&a.trace, &b.trace),
|
Self::Parallel(a, b) => TraceAny::Parallel(&a.trace, &b.trace),
|
||||||
Trace::Sequential { first, second } => TraceAny::Sequential {
|
Self::Sequential { first, second } => TraceAny::Sequential {
|
||||||
first: &first.trace,
|
first: &first.trace,
|
||||||
second: &second.trace,
|
second: &second.trace,
|
||||||
},
|
},
|
||||||
@ -67,9 +67,9 @@ fn from_parallel(
|
|||||||
impl<'a> TraceAny<'a> {
|
impl<'a> TraceAny<'a> {
|
||||||
fn render(&'a self) -> WithLengthAndWidth<RenderedAny> {
|
fn render(&'a self) -> WithLengthAndWidth<RenderedAny> {
|
||||||
match self {
|
match self {
|
||||||
TraceAny::Common(common) => common.render().map(RenderedAny::Common),
|
Self::Common(common) => common.render().map(RenderedAny::Common),
|
||||||
TraceAny::Parallel(a, b) => from_parallel(a, b).map(RenderedAny::Wide),
|
Self::Parallel(a, b) => from_parallel(a, b).map(RenderedAny::Wide),
|
||||||
TraceAny::Sequential { first, second } => {
|
Self::Sequential { first, second } => {
|
||||||
from_sequential(first, second).map(RenderedAny::Long)
|
from_sequential(first, second).map(RenderedAny::Long)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -80,9 +80,9 @@ impl<'a> TraceAny<'a> {
|
|||||||
vec: &mut WithLengthAndWidth<Vec<WithLengthAndWidth<RenderedWide>>>,
|
vec: &mut WithLengthAndWidth<Vec<WithLengthAndWidth<RenderedWide>>>,
|
||||||
) {
|
) {
|
||||||
match self {
|
match self {
|
||||||
TraceAny::Common(common) => common.render().map(RenderedWide::Common).push_into(vec),
|
Self::Common(common) => common.render().map(RenderedWide::Common).push_into(vec),
|
||||||
TraceAny::Parallel(a, b) => from_parallel(a, b).map(RenderedWide::Wide).push_into(vec),
|
Self::Parallel(a, b) => from_parallel(a, b).map(RenderedWide::Wide).push_into(vec),
|
||||||
TraceAny::Sequential { first, second } => {
|
Self::Sequential { first, second } => {
|
||||||
first.any().render_into_long(vec);
|
first.any().render_into_long(vec);
|
||||||
second.any().render_into_long(vec);
|
second.any().render_into_long(vec);
|
||||||
}
|
}
|
||||||
@ -94,12 +94,12 @@ impl<'a> TraceAny<'a> {
|
|||||||
vec: &mut WithLengthAndWidth<Vec<WithLengthAndWidth<RenderedLong>>>,
|
vec: &mut WithLengthAndWidth<Vec<WithLengthAndWidth<RenderedLong>>>,
|
||||||
) {
|
) {
|
||||||
match self {
|
match self {
|
||||||
TraceAny::Common(common) => common.render().map(RenderedLong::Common).push_into(vec),
|
Self::Common(common) => common.render().map(RenderedLong::Common).push_into(vec),
|
||||||
TraceAny::Parallel(a, b) => {
|
Self::Parallel(a, b) => {
|
||||||
a.any().render_into_wide(vec);
|
a.any().render_into_wide(vec);
|
||||||
b.any().render_into_wide(vec);
|
b.any().render_into_wide(vec);
|
||||||
}
|
}
|
||||||
TraceAny::Sequential { first, second } => from_sequential(first, second)
|
Self::Sequential { first, second } => from_sequential(first, second)
|
||||||
.map(RenderedLong::Long)
|
.map(RenderedLong::Long)
|
||||||
.push_into(vec),
|
.push_into(vec),
|
||||||
}
|
}
|
||||||
@ -109,10 +109,10 @@ impl<'a> TraceAny<'a> {
|
|||||||
impl<'a> TraceCommon<'a> {
|
impl<'a> TraceCommon<'a> {
|
||||||
fn render(&'a self) -> WithLengthAndWidth<RenderedCommon> {
|
fn render(&'a self) -> WithLengthAndWidth<RenderedCommon> {
|
||||||
match self {
|
match self {
|
||||||
TraceCommon::Pure => RenderedCommon::empty(),
|
Self::Pure => RenderedCommon::empty(),
|
||||||
TraceCommon::InvolvesOneResolution => RenderedCommon::resolution(),
|
Self::InvolvesOneResolution => RenderedCommon::resolution(),
|
||||||
TraceCommon::Event(event) => RenderedCommon::event(event),
|
Self::Event(event) => RenderedCommon::event(event),
|
||||||
TraceCommon::Wrapped { name, trace } => trace.any().render().wrap(name),
|
Self::Wrapped { name, trace } => trace.any().render().wrap(name),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user