Skip to content

Commit a09fe68

Browse files
authored
Merge pull request #417 from newAM/box-case
Add test for box_pool with CamelCase types
2 parents 7cd2625 + 23b9219 commit a09fe68

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1818
### Fixed
1919

2020
- Fixed clippy lints.
21+
- Fixed `box_pool!` emitting clippy lints for `CamelCase` and `SNAKE_CASE`.
2122

2223
## [v0.8.0] - 2023-11-07
2324

src/pool/boxed.rs

+9
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,14 @@ use super::treiber::{NonNullPtr, Stack, UnionNode};
9595
#[macro_export]
9696
macro_rules! box_pool {
9797
($name:ident: $data_type:ty) => {
98+
#[allow(non_camel_case_types)]
9899
pub struct $name;
99100

100101
impl $crate::pool::boxed::BoxPool for $name {
101102
type Data = $data_type;
102103

103104
fn singleton() -> &'static $crate::pool::boxed::BoxPoolImpl<$data_type> {
105+
#[allow(non_upper_case_globals)]
104106
static $name: $crate::pool::boxed::BoxPoolImpl<$data_type> =
105107
$crate::pool::boxed::BoxPoolImpl::new();
106108

@@ -555,4 +557,11 @@ mod tests {
555557
assert!(once.is_ok());
556558
assert!(twice.is_ok());
557559
}
560+
561+
#[test]
562+
fn box_pool_case() {
563+
// https://github.com/rust-embedded/heapless/issues/411
564+
box_pool!(CamelCaseType: u128);
565+
box_pool!(SCREAMING_SNAKE_CASE_TYPE: u128);
566+
}
558567
}

0 commit comments

Comments
 (0)