提交 696fad18 authored 作者: Serhij S's avatar Serhij S

docs and more tests

上级 c3640f8d
...@@ -38,3 +38,32 @@ jobs: ...@@ -38,3 +38,32 @@ jobs:
-A clippy::uninlined_format_args \ -A clippy::uninlined_format_args \
-A clippy::no_effect_underscore_binding \ -A clippy::no_effect_underscore_binding \
-A clippy::large_futures -A clippy::large_futures
derive-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: cargo test
run: cd roboplc-derive && cargo test --verbose --all-features --all-targets
derive-fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: cargo fmt
run: cd roboplc-derive && cargo fmt --check
derive-clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: cargo clippy
run: |
cd roboplc-derive && cargo clippy --all-targets -- -W clippy::all -W clippy::pedantic \
-A clippy::used-underscore-binding \
-A clippy::doc_markdown \
-A clippy::needless_pass_by_value \
-A clippy::must_use_candidate \
-A clippy::return_self_not_must_use \
-A clippy::missing_errors_doc \
-A clippy::single_match \
-A clippy::uninlined_format_args \
-A clippy::no_effect_underscore_binding \
-A clippy::large_futures
[package] [package]
name = "roboplc" name = "roboplc"
version = "0.1.7" version = "0.1.8"
edition = "2021" edition = "2021"
authors = ["Serhij S. <div@altertech.com>"] authors = ["Serhij S. <div@altertech.com>"]
license = "Apache-2.0" license = "Apache-2.0"
...@@ -27,7 +27,7 @@ oneshot = { version = "0.1.6", default-features = false, features = ["std"] } ...@@ -27,7 +27,7 @@ oneshot = { version = "0.1.6", default-features = false, features = ["std"] }
parking_lot = "0.12.1" parking_lot = "0.12.1"
pin-project = "1.1.5" pin-project = "1.1.5"
rmodbus = { version = "0.9.2" } rmodbus = { version = "0.9.2" }
roboplc-derive = { version = "0.1.1" } roboplc-derive = { version = "0.1.2" }
serde = { version = "1.0.197", features = ["derive", "rc"] } serde = { version = "1.0.197", features = ["derive", "rc"] }
serial = "0.4.0" serial = "0.4.0"
sysinfo = "0.30.6" sysinfo = "0.30.6"
......
...@@ -212,7 +212,7 @@ fn parse_delivery_policy(s: Option<&str>) -> proc_macro2::TokenStream { ...@@ -212,7 +212,7 @@ fn parse_delivery_policy(s: Option<&str>) -> proc_macro2::TokenStream {
/// Automatically implements the `WorkerOptions` trait for a worker struct /// Automatically implements the `WorkerOptions` trait for a worker struct
/// ///
/// Provides an attribute #[worker_opts] to specify the worker options. The attribute can be /// Provides an attribute `worker_opts` to specify the worker options. The attribute can be
/// specifieid multiple times. /// specifieid multiple times.
/// ///
/// Atrribute arguments: /// Atrribute arguments:
......
...@@ -153,11 +153,11 @@ pub trait DataDeliveryPolicy ...@@ -153,11 +153,11 @@ pub trait DataDeliveryPolicy
where where
Self: Sized, Self: Sized,
{ {
/// Delivery policy /// Delivery policy, the default is [`DeliveryPolicy::Always`]
fn delivery_policy(&self) -> DeliveryPolicy { fn delivery_policy(&self) -> DeliveryPolicy {
DeliveryPolicy::Always DeliveryPolicy::Always
} }
/// Priority, for ordered /// Priority, for ordered, lower is better, the default is 100
fn priority(&self) -> usize { fn priority(&self) -> usize {
100 100
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论