Skip to content

Commit

Permalink
add support for cloning
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr Martian committed Aug 1, 2024
1 parent 8213463 commit d944e77
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "s2json"
version = "1.4.0"
version = "1.5.0"
edition = "2021"
authors = ["Craig O'Connor <[email protected]>"]
description = "This library supports the S2JSON 1.0 Specification"
Expand Down
6 changes: 3 additions & 3 deletions rust/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ where
}

/// BBox or BBox3D
#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Copy, Clone, Debug, PartialEq)]
pub enum BBOX {
/// 2D bounding box
BBox(BBox),
Expand Down Expand Up @@ -202,7 +202,7 @@ pub type Polygon3D = Vec<Vec<Point3D>>;
pub type MultiPolygon3D = Vec<Polygon3D>;

/// All possible geometry shapes
#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[derive(Clone, Serialize, Deserialize, Debug, PartialEq)]
pub enum Geometry {
/// Point Shape
Point(PointGeometry),
Expand Down Expand Up @@ -231,7 +231,7 @@ pub enum Geometry {
}

/// BaseGeometry is the a generic geometry type
#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Copy, Clone, Debug, PartialEq)]
pub struct BaseGeometry<G = Geometry, M = MValues, B = BBOX> {
/// The geometry shape
pub coordinates: G,
Expand Down
14 changes: 7 additions & 7 deletions rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl From<u8> for Face {
//? FeatureCollections

/// WG FeatureCollection
#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct FeatureCollection {
/// Collection of WG features
pub features: Vec<Feature>,
Expand All @@ -73,7 +73,7 @@ pub struct FeatureCollection {
}

/// S2 FeatureCollection
#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct S2FeatureCollection {
/// Collection of S2 features
pub features: Vec<S2Feature>,
Expand All @@ -88,7 +88,7 @@ pub struct S2FeatureCollection {
//? Features

/// Component to build either an S2 or WG Feature
#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct Feature<M = ()> {
/// Unique identifier
pub id: Option<u64>,
Expand All @@ -102,7 +102,7 @@ pub struct Feature<M = ()> {
}

/// Component to build either an S2 or WG Feature
#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct S2Feature<M = ()> {
/// Unique identifier
#[serde(skip_serializing_if = "Option::is_none")]
Expand All @@ -126,7 +126,7 @@ pub struct S2Feature<M = ()> {
pub type Attributions = BTreeMap<String, String>;

/// Either an S2 or WG FeatureCollection
#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[serde(untagged)]
pub enum FeatureCollections {
/// An WG FeatureCollection
Expand All @@ -136,7 +136,7 @@ pub enum FeatureCollections {
}

/// Either an S2 or WG Feature
#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[serde(untagged)]
pub enum Features {
/// An WG Feature
Expand All @@ -146,7 +146,7 @@ pub enum Features {
}

/// All major S2JSON types
#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[serde(untagged)]
pub enum JSONCollection {
/// An WG FeatureCollection
Expand Down

0 comments on commit d944e77

Please sign in to comment.