Skip to content

Commit

Permalink
no need to gate encoding behind std
Browse files Browse the repository at this point in the history
  • Loading branch information
KillingSpark committed Oct 12, 2024
1 parent b067615 commit b1f6041
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/encoding/block_header.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::blocks::block::BlockType;
use std::vec::Vec;
use alloc::vec::Vec;

#[derive(Debug)]
pub struct BlockHeader {
Expand Down Expand Up @@ -40,7 +40,7 @@ impl BlockHeader {
mod tests {
use super::BlockHeader;
use crate::{blocks::block::BlockType, decoding::block_decoder};
use std::vec::Vec;
use alloc::vec::Vec;

#[test]
fn block_header_serialize() {
Expand Down
2 changes: 1 addition & 1 deletion src/encoding/blocks/raw.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::vec::Vec;
use alloc::vec::Vec;

/// Write the data from input into output. The data is not compressed.
pub(crate) fn compress_raw_block(input: &[u8], output: &mut Vec<u8>) {
Expand Down
4 changes: 2 additions & 2 deletions src/encoding/frame_encoder.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Utilities and interfaces for encoding an entire frame.
use alloc::vec::Vec;
use core::convert::TryInto;
use std::vec::Vec;

use super::{block_header::BlockHeader, blocks::compress_raw_block, frame_header::FrameHeader};

Expand Down Expand Up @@ -126,7 +126,7 @@ impl<'input> FrameCompressor<'input> {
mod tests {
use super::FrameCompressor;
use crate::frame::MAGIC_NUM;
use std::vec::Vec;
use alloc::vec::Vec;

#[test]
fn frame_starts_with_magic_num() {
Expand Down
4 changes: 2 additions & 2 deletions src/encoding/frame_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::encoding::{
util::{find_min_size, minify_val},
};
use crate::frame;
use std::vec::Vec;
use alloc::vec::Vec;

/// A header for a single Zstandard frame.
///
Expand Down Expand Up @@ -164,7 +164,7 @@ fn minify_val_fcs(val: u64) -> Vec<u8> {
mod tests {
use super::FrameHeader;
use crate::frame::{read_frame_header, FrameDescriptor};
use std::vec::Vec;
use alloc::vec::Vec;

#[test]
fn frame_header_descriptor_decode() {
Expand Down
2 changes: 1 addition & 1 deletion src/encoding/util.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::vec::Vec;
use alloc::vec::Vec;

/// Returns the minimum number of bytes needed to represent this value, as
/// either 1, 2, 4, or 8 bytes. A value of 0 will still return one byte.
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ macro_rules! vprintln {

pub mod blocks;
pub mod decoding;
#[cfg(feature = "std")]
pub mod encoding;
pub mod frame;
pub mod frame_decoder;
Expand Down

0 comments on commit b1f6041

Please sign in to comment.