File tree Expand file tree Collapse file tree 3 files changed +22
-7
lines changed Expand file tree Collapse file tree 3 files changed +22
-7
lines changed Original file line number Diff line number Diff line change 2929 with :
3030 toolchain : ${{ matrix.rust }}
3131 override : true
32+ components : rustfmt, clippy
3233 - name : Build
3334 run : cargo build --verbose
3435 - name : Run tests with all features
4950 run : cargo fmt --all --check
5051 - name : Check clippy
5152 if : matrix.rust == 'stable'
52- run : cargo clippy --all-features --all --verbose
53+ run : cargo clippy --all-features --lib --tests --examples --verbose
54+ - name : Check benchmarks with clippy
55+ if : matrix.rust == 'nightly'
56+ run : cargo clippy --all-features --benches --verbose
57+ - name : Check fuzz tests with clippy
58+ if : matrix.rust == 'stable'
59+ working-directory : fuzz
60+ run : cargo clippy --all-features --all-targets --verbose
61+ - name : Check fuzz tests formatting
62+ if : matrix.rust == 'stable'
63+ working-directory : fuzz
64+ run : cargo fmt --all --check
5365 msrv :
5466 runs-on : ubuntu-latest
5567 steps :
Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ use std::fs;
77use test:: Bencher ;
88use unicode_normalization:: UnicodeNormalization ;
99
10- const ASCII : & ' static str = "all types of normalized" ;
11- const NFC : & ' static str = "Introducci\u{00f3} n a Unicode.pdf" ;
12- const NFD : & ' static str = "Introduccio\u{0301} n a Unicode.pdf" ;
10+ const ASCII : & str = "all types of normalized" ;
11+ const NFC : & str = "Introducci\u{00f3} n a Unicode.pdf" ;
12+ const NFD : & str = "Introduccio\u{0301} n a Unicode.pdf" ;
1313
1414#[ bench]
1515fn bench_is_nfc_ascii ( b : & mut Bencher ) {
Original file line number Diff line number Diff line change 1313#[ macro_use]
1414extern crate libfuzzer_sys;
1515
16- use std:: str:: Chars ;
1716use std:: cell:: RefCell ;
1817use std:: rc:: Rc ;
18+ use std:: str:: Chars ;
1919use unicode_normalization:: { char:: canonical_combining_class, UnicodeNormalization } ;
2020
2121const MAX_NONSTARTERS : u32 = 30 ;
@@ -43,8 +43,11 @@ impl<'a> Iterator for Counter<'a> {
4343fuzz_target ! ( |input: String | {
4444 let stream_safe = input. chars( ) . stream_safe( ) . collect:: <String >( ) ;
4545
46- let mut value = Rc :: new( RefCell :: new( 0 ) ) ;
47- let counter = Counter { iter: stream_safe. chars( ) , value: Rc :: clone( & mut value) } ;
46+ let value = Rc :: new( RefCell :: new( 0 ) ) ;
47+ let counter = Counter {
48+ iter: stream_safe. chars( ) ,
49+ value: Rc :: clone( & value) ,
50+ } ;
4851 for _ in counter. nfc( ) {
4952 // Plus 1: The iterator may consume a starter that begins the next sequence.
5053 assert!( * value. borrow( ) <= MAX_NONSTARTERS + 1 ) ;
You can’t perform that action at this time.
0 commit comments