summary refs log tree commit diff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorSophie Forrest <git@sophieforrest.com>2024-10-09 14:30:10 +1300
committerSophie Forrest <git@sophieforrest.com>2024-10-09 14:30:10 +1300
commit3d00decabe8ab6c4fc55d57182688cec0fa2509f (patch)
treef87d7fcb0ca267a95884aed46d463a343ea8b2b2 /src/lib.rs
parent0e34785c05825806137d2cfff95db835905986d4 (diff)
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.
Diffstat (limited to '')
-rw-r--r--src/lib.rs4
1 files changed, 4 insertions, 0 deletions
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<nom::error::Error<&'a str>>;
 #[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(),