wordtreefoundation / ngram-tools

Fast Rust-based toolkit for ngram processing
6 stars 1 forks source link

Deprecated Range Patterns #2

Open dtcoughlin opened 3 years ago

dtcoughlin commented 3 years ago

I'm getting the following error when trying to compile the library with cargo 1.49.0:

warning:...` range patterns are deprecated --> src/pipeline/normalize.rs:32:17 32 b'A'...b'Z' => CharType::Letter(*this_char + 32), ^^^ help: use ..= for an inclusive range

= note: #[warn(ellipsis_inclusive_range_patterns)] on by default

warning: ... range patterns are deprecated --> src/pipeline/normalize.rs:33:17 | 33 | b'a'...b'z' => CharType::Letter(*this_char), | ^^^ help: use ..= for an inclusive range

warning: trait objects without an explicit dyn are deprecated --> src/server.rs:13:31 13 fn ping(&self, call: &mut Call_Ping, ping: String) -> varlink::Result<()> { ^^^^^^^^^ help: use dyn: dyn Call_Ping

= note: #[warn(bare_trait_objects)] on by default

warning: trait objects without an explicit dyn are deprecated --> src/server.rs:18:33 | 18 | fn lookup(&self, call: &mut Call_Lookup, ngram: String) -> varlink::Result<()> { | ^^^^^^^^^^^ help: use dyn: dyn Call_Lookup

warning: trait objects without an explicit dyn are deprecated --> src/server.rs:28:37 | 28 | fn lookup_all(&self, call: &mut Call_LookupAll, ngrams: Vec) -> varlink::Result<()> { | ^^^^^^^^^^^^^^ help: use dyn: dyn Call_LookupAll

warning: trait objects without an explicit dyn are deprecated --> src/client.rs:8:45 | 8 | type Result = std::result::Result<T, Box>; | ^^^^^^^^^^^^^^^^^ help: use dyn: dyn std::error::Error

warning: trait objects without an explicit dyn are deprecated --> src/org_wordtree_ngrams.rs:87:21 | 87 | let mut s: &StdError = self; | ^^^^^^^^ help: use dyn: dyn StdError

warning: trait objects without an explicit dyn are deprecated --> src/org_wordtree_ngrams.rs:183:33 | 183 | fn lookup(&self, call: &mut Call_Lookup, r#ngram: String) -> varlink::Result<()>; | ^^^^^^^^^^^ help: use dyn: dyn Call_Lookup

warning: trait objects without an explicit dyn are deprecated --> src/org_wordtree_ngrams.rs:184:37 | 184 | fn lookup_all(&self, call: &mut Call_LookupAll, r#ngrams: Vec) -> varlink::Result<()>; | ^^^^^^^^^^^^^^ help: use dyn: dyn Call_LookupAll

warning: trait objects without an explicit dyn are deprecated --> src/org_wordtree_ngrams.rs:185:31 | 185 | fn ping(&self, call: &mut Call_Ping, r#ping: String) -> varlink::Result<()>; | ^^^^^^^^^ help: use dyn: dyn Call_Ping

warning: trait objects without an explicit dyn are deprecated --> src/org_wordtree_ngrams.rs:189:26 | 189 | _bufreader: &mut BufRead, | ^^^^^^^ help: use dyn: dyn BufRead

warning: trait objects without an explicit dyn are deprecated --> src/org_wordtree_ngrams.rs:240:16 | 240 | inner: Box<VarlinkInterface + Send + Sync>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use dyn: dyn VarlinkInterface + Send + Sync

warning: trait objects without an explicit dyn are deprecated --> src/org_wordtree_ngrams.rs:243:23 | 243 | pub fn new(inner: Box<VarlinkInterface + Send + Sync>) -> VarlinkInterfaceProxy { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use dyn: dyn VarlinkInterface + Send + Sync

warning: trait objects without an explicit dyn are deprecated --> src/org_wordtree_ngrams.rs:256:25 | 256 | bufreader: &mut BufRead, | ^^^^^^^ help: use dyn: dyn BufRead

warning: trait objects without an explicit dyn are deprecated --> src/org_wordtree_ngrams.rs:275:52 | 275 | self.inner.lookup(call as &mut Call_Lookup, args.r#ngram) | ^^^^^^^^^^^ help: use dyn: dyn Call_Lookup

warning: trait objects without an explicit dyn are deprecated --> src/org_wordtree_ngrams.rs:293:50 | 293 | .lookup_all(call as &mut Call_LookupAll, args.r#ngrams) | ^^^^^^^^^^^^^^ help: use dyn: dyn Call_LookupAll

warning: trait objects without an explicit dyn are deprecated --> src/org_wordtree_ngrams.rs:310:50 | 310 | self.inner.ping(call as &mut Call_Ping, args.r#ping) | ^^^^^^^^^ help: use dyn: dyn Call_Ping

warning: unused variable: window_size --> src/pipeline.rs:97:5 97 window_size: usize, ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: _window_size

= note: #[warn(unused_variables)] on by default

warning: 18 warnings emitted`

canadaduane commented 3 years ago

Thanks for the report. I don't have time to work on this right now, but I'll keep the issue open in case someone else does (or I do, at a later date).

dtcoughlin commented 3 years ago

Thank you. I thought that was preventing me from running the program (I have never used Cargo / Rust before). It turned out that I needed to execute the ngrams command from ./target/debug/. The program did exactly what I needed – I was analyzing a large number of legal opinions to extract relevant theories / law. Thank you for making the tool available.

Daniel

-- Daniel Coughlin Coughlin Law Office, LLC Mail: 821 Main St, PO Box 116, Sabetha, KS 66534 Phone: 785.284.2843 Fax: 785.285.6285

canadaduane commented 3 years ago

What a cool use of ngram-tools! Thanks for letting me know.