Moved CellView to Node.

Dependency layout adjustments.
rustfmt modifications.
This commit is contained in:
Zachary Sunforge
2023-04-09 08:03:41 -07:00
parent d9bc0a8da8
commit feebce2b07
5 changed files with 34 additions and 26 deletions

View File

@ -16,19 +16,29 @@ license = "MIT"
[workspace.dependencies] [workspace.dependencies]
##### no-std ##### ##### no-std #####
# General utility # Error handling
thiserror = "1.0.*" [workspace.dependencies.thiserror]
version = "1.0.*"
# Concurrency
[workspace.dependencies.crossbeam]
version = "0.8.*"
default-features = false
# Units of measurement # Units of measurement
uom = "0.34.*" [workspace.dependencies.uom]
version = "0.34.*"
# Logging # Logging
tracing = "0.1.*" [workspace.dependencies.tracing]
version = "0.1.*"
# Serialization # Serialization
parity-scale-codec = "3.4.*" [workspace.dependencies.parity-scale-codec]
version = "3.4.*"
##### std ##### ##### std #####
# Async # Async
futures-lite = "1.12.*" [workspace.dependencies.futures-lite]
async-io = "1.13.*" version = "1.13.*"
[workspace.dependencies.async-io]
version = "1.13.*"
[package] [package]
name = "physical" name = "physical"
@ -40,6 +50,7 @@ readme.workspace = true
license.workspace = true license.workspace = true
[dependencies] [dependencies]
thiserror.workspace = true thiserror = { workspace = true }
uom.workspace = true crossbeam = { workspace = true }
parity-scale-codec.workspace = true uom = { workspace = true }
parity-scale-codec = { workspace = true }

View File

@ -11,3 +11,9 @@ impl<'a, T: Copy> CellView<'a, T> {
self.0.get() self.0.get()
} }
} }
impl<'a, T: Copy> From<&'a Cell<T>> for CellView<'a, T> {
fn from(value: &'a Cell<T>) -> Self {
CellView(value)
}
}

View File

@ -1,14 +1 @@
pub fn add(left: usize, right: usize) -> usize { mod cell;
left + right
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}

View File

@ -1,3 +1,8 @@
imports_granularity="Module"
format_strings=true format_strings=true
wrap_comments=true wrap_comments=true
match_block_trailing_comma=true
enum_discrim_align_threshold=25
fn_call_width=100
comment_width=100 comment_width=100
single_line_if_else_max_width=100

View File

@ -1,3 +1,2 @@
#![no_std] #![no_std]
mod cell;