-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a8aaed
commit 444b9b6
Showing
6 changed files
with
1,354 additions
and
33 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,21 +1,37 @@ | |||
use glob::glob; | #[cfg(not(target_arch = "wasm32"))] | ||
use range_set_blaze::prelude::*; | mod native { | ||
use std::{ | use glob::glob; | ||
error::Error, | use range_set_blaze::prelude::*; | ||
fs::File, | use std::{ | ||
io::{BufRead, BufReader}, | error::Error, | ||
}; | fs::File, | ||
io::{BufRead, BufReader}, | |||
}; | |||
|
|
||
fn main() -> Result<(), Box<dyn Error>> { | pub(crate) fn inner() -> Result<(), Box<dyn Error>> { | ||
let mut all_exps = RangeSetBlaze::from_iter([0..=99_999_999]); | let mut all_exps = RangeSetBlaze::from_iter([0..=99_999_999]); | ||
|
|
||
for path in glob("examples/cluster_file.*.tsv")? { | for path in glob("examples/cluster_file.*.tsv")? { | ||
let exp_nums: RangeSetBlaze<_> = BufReader::new(File::open(path?)?) | let exp_nums: RangeSetBlaze<_> = BufReader::new(File::open(path?)?) | ||
.lines() | .lines() | ||
.filter_map(|line| line.ok()?.split_once('\t')?.0.parse::<u32>().ok()) | .filter_map(|line| line.ok()?.split_once('\t')?.0.parse::<u32>().ok()) | ||
.collect(); | .collect(); | ||
all_exps = all_exps - exp_nums; | all_exps = all_exps - exp_nums; | ||
} | |||
println!("{all_exps}"); | |||
Ok(()) | |||
} | } | ||
println!("{all_exps}"); | } | ||
Ok(()) |
|
||
#[cfg(target_arch = "wasm32")] | |||
mod wasm { | |||
// Code here will only be compiled when the target architecture is WASM. | |||
pub fn inner() {} | |||
} | |||
|
|||
fn main() { | |||
#[cfg(not(target_arch = "wasm32"))] | |||
native::inner().unwrap(); | |||
#[cfg(target_arch = "wasm32")] | |||
wasm::inner(); | |||
} | } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.