Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Better docs of feature flags.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Sep 9, 2021
1 parent 6ee185c commit 7ef92fa
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ jobs:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: nightly
profile: minimal
override: true
components: rustfmt, rust-src

- name: Build Documentation
run: cargo doc --features full --no-deps
run: cargo doc --lib --features full --no-deps
env:
RUSTDOCFLAGS: --cfg docsrs

- name: Deploy
if: github.ref == 'refs/heads/main'
Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ flate2 = "1"
doc-comment = "0.3"
crossbeam-channel = "0.5.1"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[features]
default = []
full = [
Expand Down
1 change: 1 addition & 0 deletions src/compute/aggregate/simd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ pub use native::*;
#[cfg(feature = "simd")]
mod packed;
#[cfg(feature = "simd")]
#[cfg_attr(docsrs, doc(cfg(feature = "simd")))]
pub use packed::*;
1 change: 1 addition & 0 deletions src/compute/cast/primitive_to.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ where
}

#[cfg(feature = "chrono-tz")]
#[cfg_attr(docsrs, doc(cfg(feature = "chrono-tz")))]
fn chrono_tz_timestamp_to_utf8<O: Offset>(
from: &PrimitiveArray<i64>,
time_unit: TimeUnit,
Expand Down
3 changes: 3 additions & 0 deletions src/compute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ mod utils;
pub mod window;

#[cfg(feature = "regex")]
#[cfg_attr(docsrs, doc(cfg(feature = "regex")))]
pub mod like;
#[cfg(feature = "regex")]
#[cfg_attr(docsrs, doc(cfg(feature = "regex")))]
pub mod regex_match;

#[cfg(feature = "merge_sort")]
#[cfg_attr(docsrs, doc(cfg(feature = "merge_sort")))]
pub mod merge_sort;
2 changes: 2 additions & 0 deletions src/io/ipc/compression.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
use crate::error::Result;

#[cfg(feature = "io_ipc_compression")]
#[cfg_attr(docsrs, doc(cfg(feature = "io_ipc_compression")))]
pub fn decompress_lz4(input_buf: &[u8], output_buf: &mut [u8]) -> Result<()> {
use std::io::Read;
let mut decoder = lz4::Decoder::new(input_buf)?;
decoder.read_exact(output_buf).map_err(|e| e.into())
}

#[cfg(feature = "io_ipc_compression")]
#[cfg_attr(docsrs, doc(cfg(feature = "io_ipc_compression")))]
pub fn decompress_zstd(input_buf: &[u8], output_buf: &mut [u8]) -> Result<()> {
use std::io::Read;
let mut decoder = zstd::Decoder::new(input_buf)?;
Expand Down
6 changes: 6 additions & 0 deletions src/io/mod.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
//! Interact with different formats such as Arrow, CSV, parquet, etc.
#[cfg(feature = "io_csv")]
#[cfg_attr(docsrs, doc(cfg(feature = "io_csv")))]
pub mod csv;

#[cfg(feature = "io_json")]
#[cfg_attr(docsrs, doc(cfg(feature = "io_json")))]
pub mod json;

#[cfg(feature = "io_ipc")]
#[cfg_attr(docsrs, doc(cfg(feature = "io_ipc")))]
pub mod ipc;

#[cfg(feature = "io_json_integration")]
#[cfg_attr(docsrs, doc(cfg(feature = "io_json_integration")))]
pub mod json_integration;

#[cfg(feature = "io_parquet")]
#[cfg_attr(docsrs, doc(cfg(feature = "io_parquet")))]
pub mod parquet;

#[cfg(feature = "io_print")]
#[cfg_attr(docsrs, doc(cfg(feature = "io_print")))]
pub mod print;
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Doc provided by README
#![cfg_attr(docsrs, feature(doc_cfg))]

pub mod alloc;
#[macro_use]
pub mod array;
Expand All @@ -12,6 +14,7 @@ pub mod trusted_len;
pub mod types;

#[cfg(feature = "compute")]
#[cfg_attr(docsrs, doc(cfg(feature = "compute")))]
pub mod compute;
pub mod io;
pub mod record_batch;
Expand Down
1 change: 1 addition & 0 deletions src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ mod lexical;
pub use lexical::*;

#[cfg(feature = "benchmarks")]
#[cfg_attr(docsrs, doc(cfg(feature = "benchmarks")))]
pub mod bench_util;

0 comments on commit 7ef92fa

Please sign in to comment.