This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[cfg(test)] | |
mod tests { | |
use twox_hash::XxHash32; | |
use std::hash::Hasher; | |
fn xxhash32<T: AsRef<[u8]>>(buf: T) -> u64 { | |
let mut xx = XxHash32::default(); | |
xx.write(buf.as_ref()); | |
xx.finish() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <clang-c/Index.h> | |
#include <cstdlib> | |
#include <iostream> | |
/* | |
* Compile with: | |
* g++ complete.cc -o complete -lclang -L/usr/lib/llvm | |
* Run with: | |
* LIBCLANG_TIMING=1 ./complete file.cc line column [clang args...] | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec fact = function | |
0 -> 1 | |
| n -> n * fact (n - 1) |