geolocate 0.2.4

A CLI for geolocation data providers
use std::fmt::Display;

#[derive(Debug)]
pub struct ProviderNameValidationError;

impl Display for ProviderNameValidationError {
  fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
    write!(f, "-n | --name has to be `ip2location` or `ipgeolocation")
  }
}

impl std::error::Error for ProviderNameValidationError {}

#[derive(Debug)]
pub struct DefaultFieldValidationError;

impl Display for DefaultFieldValidationError {
  fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
    write!(
      f,
      "-d | --default has to be `ip2location` or `ipgeolocation"
    )
  }
}

impl std::error::Error for DefaultFieldValidationError {}

#[derive(Debug)]
pub struct BuildError;

impl Display for BuildError {
  fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
    write!(f, "Failed to build")
  }
}

impl std::error::Error for BuildError {}