Skip to content

Commit

Permalink
refactor how system.rs imports blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
User344 committed Dec 26, 2024
1 parent 0cda080 commit 96fef1d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
19 changes: 12 additions & 7 deletions lib/protoflow-blocks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,18 @@ pub use types::*;

pub use protoflow_core::{SystemBuilding, SystemExecution};

include!("blocks/core.rs"); // CoreBlocks
include!("blocks/flow.rs"); // FlowBlocks
include!("blocks/hash.rs"); // HashBlocks
include!("blocks/io.rs"); // IoBlocks
include!("blocks/math.rs"); // MathBlocks
include!("blocks/sys.rs"); // SysBlocks
include!("blocks/text.rs"); // TextBlocks
pub mod blocks {
use super::*;

include!("blocks/core.rs"); // CoreBlocks
include!("blocks/flow.rs"); // FlowBlocks
include!("blocks/hash.rs"); // HashBlocks
include!("blocks/io.rs"); // IoBlocks
include!("blocks/math.rs"); // MathBlocks
include!("blocks/sys.rs"); // SysBlocks
include!("blocks/text.rs"); // TextBlocks
}
pub use blocks::*;

pub trait AllBlocks:
CoreBlocks + FlowBlocks + HashBlocks + IoBlocks + MathBlocks + SysBlocks + TextBlocks
Expand Down
6 changes: 2 additions & 4 deletions lib/protoflow-blocks/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
#![allow(dead_code)]

use crate::{
blocks::*,
prelude::{fmt, Arc, Box, Bytes, FromStr, Rc, String, ToString},
types::{DelayType, Encoding},
AllBlocks, Buffer, ConcatStrings, Const, CoreBlocks, Count, Decode, DecodeCsv, DecodeHex,
DecodeJson, Delay, Drop, Encode, EncodeCsv, EncodeHex, EncodeJson, FlowBlocks, HashBlocks,
IoBlocks, MathBlocks, Random, ReadDir, ReadEnv, ReadFile, ReadStdin, SplitString, SysBlocks,
TextBlocks, WriteFile, WriteStderr, WriteStdout,
AllBlocks, CoreBlocks, FlowBlocks, HashBlocks, IoBlocks, MathBlocks, SysBlocks, TextBlocks,
};
#[cfg(all(feature = "std", feature = "serde"))]
use crate::{ReadSocket, WriteSocket};
Expand Down

0 comments on commit 96fef1d

Please sign in to comment.