Skip to content

Commit 0b5504a

Browse files
committed
feat: updated readme and examples
1 parent af02f50 commit 0b5504a

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

README.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,34 @@
22

33
`auto-rust` is an experimental project that aims to automatically generate Rust code with LLM (Large Language Models) during compilation, utilizing procedural macros.
44

5+
## ⚠️ Warning
6+
7+
Please note that Auto-Rust is currently under development and is not yet suitable for production use. While you are welcome to try it out and provide feedback, we caution that it may have an incomplete implementation and may not function as intended.
8+
9+
## Installation
10+
11+
```toml
12+
[dependencies]
13+
auto-rust = "0.1.0"
14+
```
15+
516
## Example
617

718
```rust
8-
use auto_rust::implement;
19+
use auto_rust::auto_implement;
920

10-
implement!(fn is_email(input: Into<String>) -> bool);
21+
#[auto_implement]
22+
#[doc = "This function calculates if the input is a valid email address without use regex."]
23+
fn is_email(input: String) -> bool {
24+
todo!()
25+
}
1126

1227
fn main() {
13-
let result = is_email("hello@minsky.cc");
14-
assert_eq!(result, true);
15-
16-
let result = is_email("hello@minsky");
17-
assert_eq!(result, false);
28+
let result = is_email("bregyminsky.cc".to_string());
29+
println!("result: {}", result);
1830
}
1931
```
32+
33+
## Contributing
34+
35+
Contributions are welcome. Feel free to open an issue if you have any questions or want to suggest an improvement.

examples/pi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ use auto_rust::auto_implement;
22

33
#[auto_implement]
44
/// This function calculates pi with a reliable algorithm.
5-
fn calculate_pi_with_n_decimals(n: u32) -> f64 {
5+
fn calculate_pi_with_n_iterations(n: u32) -> f64 {
66
todo!()
77
}
88

99
fn main() {
10-
let result = calculate_pi_with_n_decimals(100);
10+
let result = calculate_pi_with_n_iterations(100);
1111
println!("pi: {}", result);
1212
// assert_eq!(result, 3.0418396189294032);
1313
}

examples/simple.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
use auto_rust::implement;
1+
use auto_rust::auto_implement;
22

3-
implement!(fn my_ip() -> String);
3+
#[auto_implement]
4+
fn my_ip() -> String {
5+
todo!()
6+
}
47

58
fn main() {
69
let result = my_ip();

0 commit comments

Comments
 (0)