pub fn neighbor(hash_str: &str, direction: Direction) -> Result<String, GeohashError> {
    let (coord, lon_err, lat_err) = decode(hash_str)?;
    let (dlat, dlng) = direction.to_tuple();
    let neighbor_coord = Coordinate {
        x: coord.x + 2f64 * lon_err.abs() * dlng,
        y: coord.y + 2f64 * lat_err.abs() * dlat,
    };
    encode(neighbor_coord, hash_str.len())
}
/// Find neighboring geohashes for the given geohash and direction.
Find neighboring geohashes for the given geohash and direction.
Find neighboring geohashes for the given geohash and direction .
pub fn neighbor(hash_str: &str, direction: Direction) -> Result<String, GeohashError> {
    let (coord, lon_err, lat_err) = decode(hash_str)?;
    let (dlat, dlng) = direction.to_tuple();
    let neighbor_coord = Coordinate {
        x: coord.x + 2f64 * lon_err.abs() * dlng,
        y: coord.y + 2f64 * lat_err.abs() * dlat,
    };
    encode(neighbor_coord, hash_str.len())
}
pub fn neighbor ( hash_str : & str , direction : Direction ) -> Result < String , GeohashError > { let ( coord , lon_err , lat_err ) = decode ( hash_str ) ? ; let ( dlat , dlng ) = direction . to_tuple ( ) ; let neighbor_coord = Coordinate { x : coord . x + 2f64 * lon_err . abs ( ) * dlng , y : coord . y + 2f64 * lat_err . abs ( ) * dlat , } ; encode ( neighbor_coord , hash_str . len ( ) ) }
Find neighboring geohashes for the given geohash and direction.
Find neighboring geohashes for the given geohash and direction .
hash_str
&str
direction
Direction