wooorm/levenshtein-rs

It is inlined when the two strings are know-const ?

Closed this issue · 2 comments

Hi,

All is in the question : when the program is compiled, it is optimized ?
By example this

fn main() {
    for _ in 0..10 {
        println!(
            "{}",
            levenshtein("othertest", "mytest")
        );
    }
}

to this ?

fn main() {
    for _ in 0..10 {
        println!("{}",5);
    }
}

I am not sure if Rust does that. This sounds like a question about Rust. Not about this package specifically.

I tried it out https://rust.godbolt.org/z/ve3Gacad6

Rust currently does not have the capabilities to run the levenshtein function at compile time.