Introduce alloc feature for optional allocation
Wrap heap-allocated types and service generation in the `alloc` feature flag to support environments without a memory allocator.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
#![no_std]
|
||||
|
||||
#[cfg(feature = "alloc")]
|
||||
extern crate alloc;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
extern crate std;
|
||||
|
||||
@@ -438,6 +441,8 @@ impl<'a> Iterator for RawFieldIterator<'a> {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
#[cfg(feature = "alloc")]
|
||||
use alloc::{vec, vec::{Vec}};
|
||||
|
||||
#[test]
|
||||
fn test_varint_read_write() {
|
||||
|
||||
Reference in New Issue
Block a user