#async #refactoring #automated #extract #convert

async_refactor

A library for automated async code refactoring in Rust

5 releases

0.1.4 Nov 21, 2024
0.1.3 Nov 21, 2024
0.1.2 Nov 6, 2024
0.1.1 Nov 6, 2024
0.1.0 Nov 6, 2024

#480 in Procedural macros

Download history 339/week @ 2024-11-05 6/week @ 2024-11-12 277/week @ 2024-11-19 12/week @ 2024-11-26

298 downloads per month

MIT license

3KB

async_refactor

A library for automated async code refactoring in Rust.

Features

  • Extract async functions from code snippets.
  • Convert synchronous functions to async.

Installation

To use async_refactor, add the following to your Cargo.toml:

[dependencies]
async_refactor = "0.1.0"

Usage

use async_refactor::async_refactor;

fn main() {
    let code = "let x = 5;";
    
    let extracted_async = async_refactor::extract_async_function(code, "my_async_func");
    println!("{}", extracted_async);
}

License

This project is licensed under the MIT License

Running the Project

  1. Build the project:
    cargo build
    

Run the tests:

cargo test

Author

bensatlantik

Dependencies

~1.5MB
~37K SLoC