Skip to main content

no_std_moving_average/
lib.rs

1#![cfg_attr(not(test), no_std)]
2#![cfg_attr(not(test), no_main)]
3#![deny(clippy::pedantic)]
4#![deny(clippy::cargo)]
5#![deny(clippy::absolute_paths)]
6#![deny(clippy::alloc_instead_of_core)]
7#![deny(clippy::allow_attributes)]
8#![deny(clippy::allow_attributes_without_reason)]
9#![allow(
10    clippy::arbitrary_source_item_ordering,
11    reason = "Kelvin Embedded style guide: prefer ordering for logical reasons over alphabetical."
12)]
13#![allow(
14    clippy::arithmetic_side_effects,
15    reason = "Kelvin Embedded style guide: Arithmetic side effects commonly used in embedded systems programming."
16)]
17#![allow(
18    clippy::as_conversions,
19    reason = "clippy::as_conversions explanation lost in history. TODO remove allow and find reason."
20)]
21#![deny(clippy::as_pointer_underscore)]
22#![deny(clippy::as_underscore)]
23#![deny(clippy::assertions_on_constants)]
24#![deny(clippy::big_endian_bytes)]
25#![deny(clippy::byte_char_slices)]
26#![deny(clippy::cfg_not_test)]
27#![deny(clippy::clone_on_ref_ptr)]
28#![deny(clippy::create_dir)]
29#![deny(clippy::dbg_macro)]
30#![deny(clippy::decimal_literal_representation)]
31#![deny(clippy::default_numeric_fallback)]
32#![deny(clippy::default_union_representation)]
33#![deny(clippy::deref_by_slicing)]
34#![deny(clippy::disallowed_script_idents)]
35#![deny(clippy::doc_include_without_cfg)]
36#![allow(
37    clippy::duplicated_attributes,
38    reason = "https://github.com/rust-lang/rust-clippy/issues/13500"
39)]
40#![deny(clippy::else_if_without_else)]
41#![deny(clippy::empty_drop)]
42#![deny(clippy::empty_enum_variants_with_brackets)]
43#![deny(clippy::empty_structs_with_brackets)]
44#![deny(clippy::error_impl_error)]
45#![allow(
46    clippy::exhaustive_enums,
47    reason = "Kelvin Embedded style guide: allowing public enumerants is consistent with a functional style use of enumerations as pure data."
48)]
49#![allow(
50    clippy::exhaustive_structs,
51    reason = "Kelvin Embedded style guide: allowing public field access is consistent with a functional style use of data structures as pure data."
52)]
53#![deny(clippy::exit)]
54#![deny(clippy::expect_used)]
55#![deny(clippy::field_scoped_visibility_modifiers)]
56#![deny(clippy::filetype_is_file)]
57#![deny(clippy::filter_map_bool_then)]
58#![deny(clippy::float_arithmetic)]
59#![deny(clippy::float_cmp_const)]
60#![deny(clippy::fn_to_numeric_cast_any)]
61#![deny(clippy::format_push_string)]
62#![deny(clippy::get_unwrap)]
63#![deny(clippy::host_endian_bytes)]
64#![deny(clippy::if_then_some_else_none)]
65#![deny(clippy::impl_trait_in_params)]
66#![allow(
67    clippy::implicit_return,
68    reason = "Kelvin Embedded Style Guide: Implicit returns are an idiomatic approach that improves code readability."
69)]
70#![allow(clippy::indexing_slicing, reason = "Necessary to allow use of defmt.")]
71#![deny(clippy::infinite_loop)]
72#![deny(clippy::inline_asm_x86_att_syntax)]
73#![allow(
74    clippy::inline_asm_x86_intel_syntax,
75    reason = "clippy::inline_asm_x86_intel_syntax explanation lost in history. TODO remove allow and find reason."
76)]
77#![allow(
78    clippy::integer_division,
79    reason = "Kelvin Embedded Style Guide: Integer division is a normally used operation in embedded systems programming."
80)]
81#![allow(
82    clippy::integer_division_remainder_used,
83    reason = "Kelvin Embedded Style Guide: Integer division is a normally used operation in embedded systems programming."
84)]
85#![deny(clippy::items_after_test_module)]
86#![deny(clippy::iter_over_hash_type)]
87#![deny(clippy::large_include_file)]
88#![deny(clippy::legacy_numeric_constants)]
89#![deny(clippy::let_underscore_must_use)]
90#![deny(clippy::let_underscore_untyped)]
91#![allow(
92    clippy::little_endian_bytes,
93    reason = "Little Endian is both our target and host endianness. Preference is specifying explixit over local."
94)]
95#![deny(clippy::lossy_float_literal)]
96#![deny(clippy::manual_is_finite)]
97#![deny(clippy::manual_is_infinite)]
98#![deny(clippy::manual_is_power_of_two)]
99#![deny(clippy::manual_next_back)]
100#![deny(clippy::manual_ok_or)]
101#![deny(clippy::manual_pattern_char_comparison)]
102#![deny(clippy::manual_rotate)]
103#![deny(clippy::manual_while_let_some)]
104#![deny(clippy::map_all_any_identity)]
105#![deny(clippy::map_err_ignore)]
106#![deny(clippy::map_with_unused_argument_over_ranges)]
107#![deny(clippy::mem_forget)]
108#![allow(
109    clippy::min_ident_chars,
110    reason = "Single characters are useful in small namespaces and should not be mechanically prohibited."
111)]
112#![deny(clippy::missing_assert_message)]
113#![allow(
114    clippy::missing_asserts_for_indexing,
115    reason = "Asserts panic when false, which is prohibited in the embedded system."
116)]
117#![allow(
118    clippy::missing_docs_in_private_items,
119    reason = "clippy::missing_docs_in_private_items explanation lost in history. TODO remove allow and find reason."
120)]
121#![deny(clippy::missing_enforced_import_renames)]
122#![allow(
123    clippy::missing_inline_in_public_items,
124    reason = "clippy::missing_inline_in_public_items explanation lost in history. TODO remove allow and find reason."
125)]
126#![deny(clippy::missing_trait_methods)]
127#![deny(clippy::mixed_attributes_style)]
128#![deny(clippy::mixed_read_write_in_expression)]
129#![deny(clippy::mod_module_files)]
130#![deny(clippy::module_name_repetitions)]
131#![allow(
132    clippy::modulo_arithmetic,
133    reason = "clippy::modulo_arithmetic explanation lost in history. TODO remove allow and find reason."
134)]
135#![allow(
136    clippy::multiple_crate_versions,
137    reason = "clippy::multiple_crate_versions explanation lost in history. TODO remove allow and find reason."
138)]
139#![deny(clippy::multiple_inherent_impl)]
140#![deny(clippy::multiple_unsafe_ops_per_block)]
141#![deny(clippy::mutex_atomic)]
142#![deny(clippy::needless_as_bytes)]
143#![deny(clippy::needless_borrows_for_generic_args)]
144#![deny(clippy::needless_else)]
145#![deny(clippy::needless_pub_self)]
146#![deny(clippy::needless_raw_strings)]
147#![deny(clippy::needless_return_with_question_mark)]
148#![deny(clippy::non_ascii_literal)]
149#![deny(clippy::non_minimal_cfg)]
150#![deny(clippy::non_zero_suggestions)]
151#![deny(clippy::panic)]
152#![deny(clippy::panic_in_result_fn)]
153#![deny(clippy::partial_pub_fields)]
154#![deny(clippy::pathbuf_init_then_push)]
155#![deny(clippy::pattern_type_mismatch)]
156#![deny(clippy::print_stderr)]
157#![deny(clippy::print_stdout)]
158#![deny(clippy::pub_use)]
159#![allow(
160    clippy::pub_with_shorthand,
161    reason = "Denying the reciprocal pub_without_shorthand."
162)]
163#![deny(clippy::pub_without_shorthand)]
164#![allow(
165    clippy::question_mark_used,
166    reason = "Allowed by Kelvin Style Guide. This is idiomatic Rust."
167)]
168#![deny(clippy::rc_buffer)]
169#![deny(clippy::rc_mutex)]
170#![deny(clippy::redundant_feature_names)]
171#![deny(clippy::redundant_type_annotations)]
172#![deny(clippy::ref_patterns)]
173#![deny(clippy::renamed_function_params)]
174#![deny(clippy::rest_pat_in_fully_bound_structs)]
175#![allow(
176    clippy::same_name_method,
177    reason = "TODO reconsider. Due to bitflags! macro"
178)]
179#![deny(clippy::self_named_module_files)]
180#![deny(clippy::semicolon_outside_block)]
181#![allow(
182    clippy::separated_literal_suffix,
183    reason = "clippy::separated_literal_suffix explanation lost in history. TODO remove allow and find reason."
184)]
185#![deny(clippy::shadow_reuse)]
186#![deny(clippy::shadow_same)]
187#![deny(clippy::shadow_unrelated)]
188#![allow(
189    clippy::single_call_fn,
190    reason = "Allowed by Kelvin style guide. This is best practice when creating well refactored code."
191)]
192#![allow(
193    clippy::single_char_lifetime_names,
194    reason = "Allowed by Kelvin style guide. Single character lifetime names are commonly used in idiomatic Rust."
195)]
196#![deny(clippy::std_instead_of_alloc)]
197#![deny(clippy::std_instead_of_core)]
198#![deny(clippy::str_to_string)]
199#![deny(clippy::string_add)]
200#![deny(clippy::string_lit_chars_any)]
201#![deny(clippy::string_slice)]
202#![deny(clippy::string_to_string)]
203#![deny(clippy::suspicious_xor_used_as_pow)]
204#![deny(clippy::tests_outside_test_module)]
205#![deny(clippy::to_string_trait_impl)]
206#![deny(clippy::todo)]
207#![deny(clippy::try_err)]
208#![deny(clippy::undocumented_unsafe_blocks)]
209#![deny(clippy::unimplemented)]
210#![deny(clippy::unnecessary_fallible_conversions)]
211#![deny(clippy::unnecessary_map_or)]
212#![deny(clippy::unnecessary_safety_comment)]
213#![deny(clippy::unnecessary_safety_doc)]
214#![deny(clippy::unnecessary_self_imports)]
215#![deny(clippy::unneeded_field_pattern)]
216#![deny(clippy::unreachable)]
217#![deny(clippy::unseparated_literal_suffix)]
218#![deny(clippy::unused_enumerate_index)]
219#![deny(clippy::unused_result_ok)]
220#![deny(clippy::unused_trait_names)]
221#![deny(clippy::unwrap_in_result)]
222#![deny(clippy::unwrap_used)]
223#![deny(clippy::use_debug)]
224#![deny(clippy::verbose_file_reads)]
225#![deny(clippy::wildcard_enum_match_arm)]
226
227/// Copyright ©2025 Kelvin Systems
228mod moving_average;
229
230#[expect(clippy::useless_attribute, reason = "Working around clippy bug")]
231#[expect(clippy::pub_use, reason = "Exporting without exposing file structure")]
232pub use moving_average::MovingAverage;