@@ -306,22 +306,22 @@ impl TmcCore {
306306 /// submission_url,
307307 /// Path::new("./exercises/python/123"),
308308 /// Some("my python solution".to_string()),
309- /// Language::Eng).unwrap();
309+ /// Some( Language::Eng) ).unwrap();
310310 /// ```
311311 pub fn paste (
312312 & self ,
313313 submission_url : Url ,
314314 submission_path : & Path ,
315315 paste_message : Option < String > ,
316- locale : Language ,
316+ locale : Option < Language > ,
317317 ) -> Result < NewSubmission > {
318318 // compress
319319 let compressed = task_executor:: compress_project ( submission_path) ?;
320320 let mut file = NamedTempFile :: new ( ) . map_err ( CoreError :: TempFile ) ?;
321321 file. write_all ( & compressed)
322322 . map_err ( |e| CoreError :: FileWrite ( file. path ( ) . to_path_buf ( ) , e) ) ?;
323323
324- self . post_submission_to_paste ( submission_url, file. path ( ) , paste_message, Some ( locale) )
324+ self . post_submission_to_paste ( submission_url, file. path ( ) , paste_message, locale)
325325 }
326326
327327 /// Checks the coding style for the project.
@@ -499,20 +499,15 @@ impl TmcCore {
499499 submission_url : Url ,
500500 submission_path : & Path ,
501501 message_for_reviewer : String ,
502- locale : Language ,
502+ locale : Option < Language > ,
503503 ) -> Result < NewSubmission > {
504504 // compress
505505 let compressed = task_executor:: compress_project ( submission_path) ?;
506506 let mut file = NamedTempFile :: new ( ) . map_err ( CoreError :: TempFile ) ?;
507507 file. write_all ( & compressed)
508508 . map_err ( |e| CoreError :: FileWrite ( file. path ( ) . to_path_buf ( ) , e) ) ?;
509509
510- self . post_submission_for_review (
511- submission_url,
512- file. path ( ) ,
513- message_for_reviewer,
514- Some ( locale) ,
515- )
510+ self . post_submission_for_review ( submission_url, file. path ( ) , message_for_reviewer, locale)
516511 }
517512
518513 /// Downloads the model solution from the given url.
@@ -719,7 +714,7 @@ mod test {
719714 submission_url,
720715 Path :: new ( "tests/data/exercise" ) ,
721716 Some ( "abcdefg" . to_string ( ) ) ,
722- Language :: from_639_3 ( "eng" ) . unwrap ( ) ,
717+ Some ( Language :: Eng ) ,
723718 )
724719 . unwrap ( ) ;
725720 assert_eq ! (
@@ -978,7 +973,7 @@ mod test {
978973 submission_url,
979974 Path :: new ( "tests/data/exercise" ) ,
980975 "abcdefg" . to_string ( ) ,
981- Language :: from_639_3 ( "eng" ) . unwrap ( ) ,
976+ Some ( Language :: Eng ) ,
982977 )
983978 . unwrap ( ) ;
984979 assert_eq ! (
0 commit comments