rust_refactor

Crates.iorust_refactor
lib.rsrust_refactor
version0.1.1
sourcesrc
created_at2024-11-06 19:25:12.458904
updated_at2024-11-10 11:51:59.539
descriptionA library for automated code refactoring in Rust.
homepage
repositoryhttps://github.com/Rust-Libraries-Binaries/rust_refactor.git
max_upload_size
id1438706
size3,417
Ben Santora (bensatlantik)

documentation

README

Archived Repository

This repository was a gift from me to the Rust and open-source community. It is no longer actively maintained and has been archived. Feel free to fork and continue development on your own.

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

Ben Santora

Commit count: 6

cargo fmt