Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
PootisHunter committed Jul 10, 2024
1 parent 4ff64a2 commit 686d13e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ impl CourseIdentifier {
#[derive(Deserialize)]
pub struct Weeks {
pub tasks: Vec<WeeksTasks>,
pub number: i32,
pub number: u8,
pub theme: String,
}

impl Weeks {
pub fn new(tasks: Vec<WeeksTasks>, number: i32, theme: String) -> Weeks {
pub fn new(tasks: Vec<WeeksTasks>, number: u8, theme: String) -> Weeks {
Weeks {
tasks,
number,
Expand Down Expand Up @@ -169,7 +169,7 @@ pub fn toml_content(file_content: String) -> Result<CourseConfiguration, Box<dyn
let course_config: CourseConfiguration = toml::from_str(&file_content)?;
Ok(course_config)
}

//TODO: FINISH
pub fn check_toml(course_config: CourseConfiguration) -> Result<bool, Box<dyn Error>> {
let course = course_config;
let id = course.course_identifier.identifier.as_str();
Expand All @@ -180,11 +180,11 @@ pub fn check_toml(course_config: CourseConfiguration) -> Result<bool, Box<dyn Er
let byte_value = u8::from_str_radix(&byte_str, 16).unwrap();
result[i] = byte_value;
}
let course_id = Uuid::from_bytes(result);
let _course_id = Uuid::from_bytes(result);
let course_name = course.course_identifier.name;
if course_name.is_empty() {
panic!("Empty course name");
}

// Continue
return Ok(true);
}

0 comments on commit 686d13e

Please sign in to comment.