diff --git a/Cargo.toml b/Cargo.toml index 4602caa..5e058e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,19 +16,29 @@ license = "MIT" [workspace.dependencies] ##### no-std ##### -# General utility -thiserror = "1.0.*" +# Error handling +[workspace.dependencies.thiserror] +version = "1.0.*" +# Concurrency +[workspace.dependencies.crossbeam] +version = "0.8.*" +default-features = false # Units of measurement -uom = "0.34.*" +[workspace.dependencies.uom] +version = "0.34.*" # Logging -tracing = "0.1.*" +[workspace.dependencies.tracing] +version = "0.1.*" # Serialization -parity-scale-codec = "3.4.*" +[workspace.dependencies.parity-scale-codec] +version = "3.4.*" ##### std ##### # Async -futures-lite = "1.12.*" -async-io = "1.13.*" +[workspace.dependencies.futures-lite] +version = "1.13.*" +[workspace.dependencies.async-io] +version = "1.13.*" [package] name = "physical" @@ -40,6 +50,7 @@ readme.workspace = true license.workspace = true [dependencies] -thiserror.workspace = true -uom.workspace = true -parity-scale-codec.workspace = true \ No newline at end of file +thiserror = { workspace = true } +crossbeam = { workspace = true } +uom = { workspace = true } +parity-scale-codec = { workspace = true } \ No newline at end of file diff --git a/src/cell.rs b/node/src/cell.rs similarity index 72% rename from src/cell.rs rename to node/src/cell.rs index 0fe56eb..8b84137 100644 --- a/src/cell.rs +++ b/node/src/cell.rs @@ -11,3 +11,9 @@ impl<'a, T: Copy> CellView<'a, T> { self.0.get() } } + +impl<'a, T: Copy> From<&'a Cell> for CellView<'a, T> { + fn from(value: &'a Cell) -> Self { + CellView(value) + } +} diff --git a/node/src/lib.rs b/node/src/lib.rs index 7d12d9a..cf06c83 100644 --- a/node/src/lib.rs +++ b/node/src/lib.rs @@ -1,14 +1 @@ -pub fn add(left: usize, right: usize) -> usize { - left + right -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn it_works() { - let result = add(2, 2); - assert_eq!(result, 4); - } -} +mod cell; diff --git a/rustfmt.toml b/rustfmt.toml index 3d362b7..8eb903c 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,3 +1,8 @@ +imports_granularity="Module" format_strings=true wrap_comments=true -comment_width=100 \ No newline at end of file +match_block_trailing_comma=true +enum_discrim_align_threshold=25 +fn_call_width=100 +comment_width=100 +single_line_if_else_max_width=100 \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index c72a786..1ef6109 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,2 @@ #![no_std] -mod cell;