Skip to content
Myr

enabled.rs

This file

Path

crates/core/index/enabled.rs

16 lines · 434 bytes · Rust

Last changed by

index: add some initial indexing scaffoldingAndrew Gallantbefore adoption8372866

History of this file

Take it

1use crate::flags::{HiArgs, SearchMode};23pub(crate) fn write(args: &HiArgs) -> anyhow::Result<()> {4    let _index = args.index_write()?;5    Ok(())6}78pub(crate) fn read(args: &HiArgs, mode: SearchMode) -> anyhow::Result<bool> {9    let _index = args.index_read()?;10    // Do an exhaustive search for now.11    if args.threads() == 1 {12        crate::search(args, mode)13    } else {14        crate::search_parallel(args, mode)15    }16}