rust_refactor

Crates.iorust_refactor
lib.rsrust_refactor
version0.1.2
sourcesrc
created_at2024-11-06 19:25:12.458904
updated_at2024-11-21 01:47:00.303704
descriptionA library for automated code refactoring in Rust.
homepage
repository
max_upload_size
id1438706
size3,043
Ben Santora (bensatlantik)

documentation

README

rust_refactor

A library for automated code refactoring in Rust.

Features

  • Extract functions from code snippets.
  • Rename variables throughout a codebase.

Installation

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

[dependencies]
rust_refactor = "0.1.0"

Usage

use rust_refactor::refactor;

fn main() {
    let code = "let x = 5; x + 1";
    
    let extracted = refactor::extract_function(code, "my_func");
    println!("{}", extracted);
    
    let renamed = refactor::rename_variable(code, "x", "y");
    println!("{}", renamed);
}

License

This project is licensed under the MIT License

Running the Project

  1. Build the project:
    cargo build
    

Author

bensatlantik

Commit count: 0

cargo fmt