nmlgc
06afc1879b
Implicitly convert &str to [u8] for compatibility with existing usage code
...
Thanks to stephaneyfx from the #rust IRC channel for showing me that
this needs separate type parameters on the functions in order to
compile.
The only API change that can't be helped are the `line_junk` and
`char_junk` function pointers in the Differ struct, which now take
`&&str` and `&char` parameters, respectively. This is probably for the
better, since `char_junk` now operates on Unicode scalar values rather
than the single UTF-8 bytes disguised as `&str` that were previously
retrieved via the unsafe `slice_unchecked()` function.
2018-07-05 21:46:43 +02:00
nmlgc
6fd59b0c08
Make SequenceMatcher generic over all slice types
2018-07-03 20:28:11 +02:00
nmlgc
de82e46021
Apply all Clippy lints that don't break the API
2018-07-02 20:09:51 +02:00
nmlgc
282c139cc0
Remove generic types from Differ
...
The entire implementation pretty much only makes sense for string
slices, and that was all the original code supported anyway.
2018-07-01 18:41:22 +02:00
nmlgc
e2bbf92e4c
chain_second_seq(): Filter out junk and popular elements in a more idiomatic way
2018-06-30 12:40:50 +02:00
nmlgc
63e214364a
Remove second_sequence_popular from the SequenceMatcher struct.
...
It's never read from.
2018-06-29 11:58:31 +02:00
nmlgc
e36a1d4645
Fix mutability warnings
2018-06-28 13:19:50 +02:00
nmlgc
a053cc079a
Run cargo fmt
2018-06-15 11:54:48 +02:00
Dima Kudosh
41c8240cb7
Replaced Vec with HashSet for second_sequence_popular
2018-03-24 18:01:27 +03:00
Armin Ronacher
76384c2568
Fixed a bug with subtraction in the opcode code
2017-07-12 20:14:01 +02:00
Dima Kudosh
07de887127
Reformat code with rustfmt
2017-02-26 19:32:22 +03:00
Shawn Walker-Salas
5975412d97
Update sequencematcher.rs
2017-01-11 22:32:21 -08:00
Dima Kudosh
16fc483ea1
Remove warnings
2016-03-01 15:00:07 +03:00
Dima Kudosh
963a917bf7
Remove Sequence trait implementation for array
2016-02-29 14:39:28 +03:00
Dima Kudosh
0035a1b816
Change spaces to tab
2016-02-29 14:05:31 +03:00
Dima Kudosh
208671babd
Add example
2016-02-28 22:33:35 +03:00
Dima Kudosh
a99af75280
Add ability to specify user-defined functions for matcher
2016-02-28 21:35:03 +03:00
Dima Kudosh
0fa2c80be0
Add unified diff and tests for it
2016-02-28 18:24:03 +03:00
Dima Kudosh
2d309c0ba4
Add new tests, fix bugs with Differ
2016-02-28 17:38:44 +03:00
Dima Kudosh
792515fb0d
Change algorithm for finding largest common sequence, change SequenceMatcher to generic
2016-02-27 21:55:43 +03:00
Dima Kudosh
43a88b17b2
Add function to get grouping opcodes for sequence matcher struct
2016-02-18 13:59:47 +03:00
Dima Kudosh
38cc286ba2
Partly implement differ struce, add Opcode struct
2016-02-17 21:03:12 +03:00
Dima Kudosh
6bd7dc4b84
Add ability to calculate ratio
2016-02-15 14:54:32 +03:00
Dima Kudosh
329dc4419a
Fix bug with last match in get_matching_blocks. Add opcodes
2016-02-15 14:42:01 +03:00
Dima Kudosh
26d8f5f78e
Add ability to get all common sequences
2016-02-15 13:51:29 +03:00
Dima Kudosh
302257e54a
Add Sequence Matcher, add ability to find largest common sequence
2016-02-13 13:38:17 +03:00