File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ pub struct ChallengeConfig {
157157 directory : PathBuf ,
158158
159159 #[ serde( default = "default_difficulty" ) ]
160- difficulty : i64 ,
160+ difficulty : String ,
161161
162162 flag : FlagType ,
163163
@@ -222,8 +222,12 @@ impl ChallengeConfig {
222222 }
223223}
224224
225- fn default_difficulty ( ) -> i64 {
226- 1
225+ fn default_difficulty ( ) -> String {
226+ // temporary hack to get default from repo config. will revisit when
227+ // renaming challenge -> difficulty_class
228+ get_config ( )
229+ . map ( |c| c. defaults . difficulty . to_string ( ) )
230+ . unwrap_or ( "" . to_string ( ) )
227231}
228232
229233#[ derive( Debug , PartialEq , Serialize , Deserialize ) ]
Original file line number Diff line number Diff line change @@ -99,7 +99,9 @@ pub async fn render_frontend_info(
9999 let points = get_config ( ) ?
100100 . points
101101 . iter ( )
102- . find ( |point_category| point_category. difficulty == chal. difficulty . to_string ( ) )
102+ // note: this weird to_string() will be fixed when the challenge difficulty
103+ // moves to point_category string. this is in a weird inbetween rn
104+ . find ( |point_category| point_category. difficulty == chal. difficulty )
103105 . ok_or ( anyhow ! ( "challenge points are missing in config" ) ) ?;
104106
105107 let chal_data = FrontendChalData {
You can’t perform that action at this time.
0 commit comments