Skip to content

Instantly share code, notes, and snippets.

View hammett's full-sized avatar

hamilton verissimo hammett

View GitHub Profile
@hammett
hammett / main.rs
Created July 30, 2017 19:20
rust experiment: dumb reverse index
fn main() {
use reverse_index::*;
let s1 = "Often, a simple if/else isn’t enough, because you have more than two possible options. Also, conditions can get quite complex. Rust has has a keyword, match, that allows you to replace complicated if/else groupings with something more powerful. It is match. Check it out:";
let s2 = "Strings are ordered lexicographically by their byte values. This orders Unicode code points based more on their positions in the code charts. This is not necessarily the same as alphabetical order, which varies by language and locale. Sorting strings according to culturally-accepted standards requires locale-specific data that is outside the scope of the str type";
let doc1 = parse(&s1);
let doc2 = parse(&s2);
let query = "simple more";
{
"rust.mode": "legacy",
"rust.rustup": {
// "toolchain": "stable-x86_64-pc-windows-msvc"
"toolchain": "stable-x86_64-pc-windows-gnu"
},
"editor.renderWhitespace": "none"
}