File tree 3 files changed +22
-7
lines changed
3 files changed +22
-7
lines changed Original file line number Diff line number Diff line change 29
29
with :
30
30
toolchain : ${{ matrix.rust }}
31
31
override : true
32
+ components : rustfmt, clippy
32
33
- name : Build
33
34
run : cargo build --verbose
34
35
- name : Run tests with all features
49
50
run : cargo fmt --all --check
50
51
- name : Check clippy
51
52
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
53
65
msrv :
54
66
runs-on : ubuntu-latest
55
67
steps :
Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ use std::fs;
7
7
use test:: Bencher ;
8
8
use unicode_normalization:: UnicodeNormalization ;
9
9
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" ;
13
13
14
14
#[ bench]
15
15
fn bench_is_nfc_ascii ( b : & mut Bencher ) {
Original file line number Diff line number Diff line change 13
13
#[ macro_use]
14
14
extern crate libfuzzer_sys;
15
15
16
- use std:: str:: Chars ;
17
16
use std:: cell:: RefCell ;
18
17
use std:: rc:: Rc ;
18
+ use std:: str:: Chars ;
19
19
use unicode_normalization:: { char:: canonical_combining_class, UnicodeNormalization } ;
20
20
21
21
const MAX_NONSTARTERS : u32 = 30 ;
@@ -43,8 +43,11 @@ impl<'a> Iterator for Counter<'a> {
43
43
fuzz_target ! ( |input: String | {
44
44
let stream_safe = input. chars( ) . stream_safe( ) . collect:: <String >( ) ;
45
45
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
+ } ;
48
51
for _ in counter. nfc( ) {
49
52
// Plus 1: The iterator may consume a starter that begins the next sequence.
50
53
assert!( * value. borrow( ) <= MAX_NONSTARTERS + 1 ) ;
You can’t perform that action at this time.
0 commit comments