Skip to content

Commit 47277db

Browse files
authored
Add nightly toolchain file, update gitignore and simplify find_index_subvector function. (#38)
1 parent 7eb11c1 commit 47277db

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
*.csv
2+
.DS_Store
13
/target

src/.DS_Store

-6 KB
Binary file not shown.

src/utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl<F: RichField> IntTargetWriter for PartialWitness<F> {
4242

4343
// Returns the index where the subvector starts in v, if any.
4444
pub(crate) fn find_index_subvector(v: &[u8], sub: &[u8]) -> Option<usize> {
45-
(0..(v.len() - sub.len())).find(|&i| &v[i..i + sub.len()] == sub)
45+
v.windows(sub.len()).position(|s| s == sub)
4646
}
4747

4848
/// Compute the keccak256 hash of the given data.

toolchain.toml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[toolchain]
2+
channel = "nightly"

0 commit comments

Comments
 (0)