mirror of
https://github.com/bvanroll/unnamed_chatgpt_project.git
synced 2025-08-29 12:02:45 +00:00
interessant projectjen
This commit is contained in:
@@ -7,3 +7,7 @@ edition = "2018"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0.91"
|
||||
rfd = "0.10.0"
|
||||
chatgpt_rs = "0.6.0"
|
@@ -1,3 +1,37 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
use std::fs::File;
|
||||
use std::io::{BufReader, Read};
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct MiniHuman {
|
||||
name: String,
|
||||
gender: String,
|
||||
}
|
||||
#[derive(Serialize)]
|
||||
struct Human {
|
||||
firstName: String,
|
||||
lastName: String,
|
||||
gender: String,
|
||||
age: String,
|
||||
country: String,
|
||||
bio: String,
|
||||
job: String,
|
||||
}
|
||||
fn main() {
|
||||
let current_path = std::env::current_dir().unwrap();
|
||||
let res = rfd::FileDialog::new().set_directory(¤t_path).pick_file().unwrap();
|
||||
let mut file = File::open(res.as_path()).unwrap();
|
||||
let mut json_string:String = String::new();
|
||||
file.read_to_string(&mut json_string).unwrap();
|
||||
let MiniHumans: Vec<MiniHuman> = serde_json::from_str(&json_string).unwrap();
|
||||
while MiniHumans.len() > 1 {
|
||||
let firstName: String = getRngName(&MiniHumans);
|
||||
let lastName: String = getRngName(&MiniHumans);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fn getRngName(miniHumans: &Vec<MiniHuman>) -> String {
|
||||
return "".to_string()
|
||||
}
|
Reference in New Issue
Block a user