You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: mod.rs
    path of file: ./repos/lemmy/crates/api_crud/src/site
    
    the code of the file until where you have to start completion: use lemmy_db_schema::{ListingType, RegistrationMode};
use lemmy_utils::error::{LemmyErrorType, LemmyResult};

pub mod create;
pub mod read;
pub mod update;

/// Checks whether the default post listing type is valid for a site.
pub fn site_default_post_listing_type_check(
  default_post_listing_type: &Option<ListingType>,
) -> LemmyResult<()> {
  if let Some(listing_type) = default_post_listing_type {
    // Only allow all or local as default listing types...
    if listing_type != &ListingType::All && listing_type != &ListingType::Local {
      Err(LemmyErrorType::InvalidDefaultPostListingType)?
    } else {
   
    
  fn test_application_question_check() {
    assert!(
      application_question_check(&Some(String::from("q")), &Some(String::new()), RegistrationMode::RequireApplication).is_err(),
      "Expected application to be invalid because an application is required, current question: {:?}, new question: {:?}",
      "q",
      String::new(),
    );
    assert!(
      application_question_check(&None, &None, RegistrationMode::RequireApplication).is_err(),
      "Expected application to be invalid because an application is required, current question: {:?}, new question: {:?}",
      None::<String>,
      None::<String>
    );

    assert!(
      application_question_check(&None, &None, RegistrationMode::Open).is_ok(),
      "Expected application to be valid because no application required, current question: {:?}, new question: {:?}, mode: {:?}",
      None::<String>,
      None::<String>,
      RegistrationMode::Open
    );
    assert!(
      application_question_check(&None, &Some(String::from("q")), RegistrationMode::RequireApplication).is_ok(),
      "Expected application to be valid because new application provided, current question: {:?}, new question: {:?}, mode: {:?}",
      None::<String>,
      Some(String::from("q")),
      RegistrationMode::RequireApplication
    );
    assert!(
      application_question_check(&Some(String::from("q")), &None, RegistrationMode::RequireApplication).is_ok(),
      "Expected application to be valid because application existed, current question: {:?}, new question: {:?}, mode: {:?}",
      Some(String::from("q")),
      None::<String>,
      RegistrationMode::RequireApplication
    );
  }