8000 GitHub - andylokandy/recursive: Easy recursion in Rust, without stack overflows.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

andylokandy/recursive

 
 

Repository files navigation

Recursive

With recursive you can easily make (indirectly) recursive functions without worrying about stack overflows by marking them as #[recursive]:

use recursive::recursive;

#[recursive]
fn sum(nums: &[u64]) -> u64 {
    if let Some((head, tail)) = nums.split_first() {
        head + sum(tail)
    } else {
        0
    }
}

Functions marked with #[recursive] will automatically grow the stack size if it is too small when called. See the crate docs for details.

License

recursive is licensed under the MIT license.

About

Easy recursion in Rust, without stack overflows.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%
0