refactor(tvix/cli/refscan): use wu-manber crate with &[u8] support

PR'ed at https://github.com/tvlfyi/wu-manber/pull/1, and now merged.

Change-Id: I8c71e359196396a1d42a3ea2ab7ac15b137b2db0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8992
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
This commit is contained in:
Florian Klink 2023-07-30 00:38:55 +02:00 committed by clbot
parent aa1982c085
commit 737a6ca01e
6 changed files with 15 additions and 29 deletions

View file

@ -311,9 +311,9 @@ mod derivation_builtins {
Default::default()
} else {
let mut refscan = state.reference_scanner();
drv.arguments.iter().for_each(|s| refscan.scan_str(s));
drv.environment.values().for_each(|s| refscan.scan_bytes(s));
refscan.scan_str(&drv.builder);
drv.arguments.iter().for_each(|s| refscan.scan(s));
drv.environment.values().for_each(|s| refscan.scan(s));
refscan.scan(&drv.builder);
refscan.finalise()
}
};
@ -400,7 +400,7 @@ mod derivation_builtins {
.context("evaluating the `content` parameter of builtins.toFile")?;
let mut refscan = state.borrow().reference_scanner();
refscan.scan_str(content.as_str());
refscan.scan(content.as_str());
let refs = {
let paths = state.borrow();
refscan