Skip to content

Commit

Permalink
Switch to features
Browse files Browse the repository at this point in the history
  • Loading branch information
aannleax committed May 10, 2024
1 parent 9b98208 commit c921228
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[build]
[features]
# See https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html
# Required for https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.FileSystemSyncAccessHandle.html
rustflags = ["--cfg=web_sys_unstable_apis"]
default = ["web_sys_unstable_apis"]
2 changes: 2 additions & 0 deletions nemo-physical/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ default = ["timing"]
# If this feature is not enabled, all time measurements will display zero instead
timing = ["dep:howlong"]
stringpairdictionary = []
check_column_sorting = []
js = []

[[bin]]
name = "dict-bench"
Expand Down
2 changes: 1 addition & 1 deletion nemo-physical/src/columnar/column/rle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ where
/// If multiple candidates exist, the iterator should be advanced to the first such value.
fn seek(&mut self, value: Self::Item) -> Option<Self::Item> {
// seek only works correctly if column is sorted; we are just checking this here
#[cfg(check_column_sorting)]
#[cfg(feature = "check_column_sorting")]
debug_assert!(
self.column.is_empty()
|| self
Expand Down
3 changes: 3 additions & 0 deletions nemo-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ web-sys = { version = "0.3.64", features = [ "Blob", "FileReaderSync", "FileSyst

[dev-dependencies]
wasm-bindgen-test = "0.3"

[features]
web_sys_unstable_apis = []
8 changes: 4 additions & 4 deletions nemo-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,18 +188,18 @@ pub struct NemoEngine {
engine: nemo::execution::DefaultExecutionEngine,
}

#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "web_sys_unstable_apis")]
fn std_io_error_from_js_value(js_value: JsValue, prefix: &str) -> std::io::Error {
std::io::Error::new(
std::io::ErrorKind::Other,
format!("{prefix}: {js_value:#?}"),
)
}

#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "web_sys_unstable_apis")]
struct SyncAccessHandleWriter(web_sys::FileSystemSyncAccessHandle);

#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "web_sys_unstable_apis")]
impl std::io::Write for SyncAccessHandleWriter {
fn write(&mut self, buf: &[u8]) -> Result<usize, std::io::Error> {
let buf: Vec<_> = buf.into();
Expand Down Expand Up @@ -309,7 +309,7 @@ impl NemoEngine {
Ok(results)
}

#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "web_sys_unstable_apis")]
#[wasm_bindgen(js_name = "savePredicate")]
pub fn write_result_to_sync_access_handle(
&mut self,
Expand Down

0 comments on commit c921228

Please sign in to comment.