From 3d00decabe8ab6c4fc55d57182688cec0fa2509f Mon Sep 17 00:00:00 2001 From: Sophie Forrest Date: Wed, 9 Oct 2024 14:30:10 +1300 Subject: feat: add corequisites field This currently stores no information as no parser exists for it. I will accept contributions for this, as it will likely take me a while to get around to implementing. The ideal goal we're aiming for would be to rewrite all the parsing logic in nom. The only parser left is the "coursepoints" / requirements parser. This parser has proven to be particularly difficult and resistant to rewrites. I expect this will take weeks, if not months to get around to. But, as mentioned, contributions are very welcome. --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 89c43f1..25f6ea6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,6 +24,9 @@ type NomError<'a> = nom::Err>; #[derive(Clone, Debug, Deserialize, Serialize)] #[non_exhaustive] pub struct Course<'a> { + /// Courses that must be taken at the same time as this course. + pub corequisites: Vec<&'a str>, + /// Description of the course. pub description: Option<&'a str>, @@ -170,6 +173,7 @@ impl<'a> Course<'a> { impl Default for Course<'_> { fn default() -> Self { Self { + corequisites: Vec::default(), description: Option::default(), offered: true, points: f32::default(), -- cgit 1.4.1