### Run an Example Source: https://github.com/chargetrip/supercluster-rs/blob/main/CONTRIBUTING.md Executes a specific example provided in the 'examples' directory of the Supercluster project. Replace 'example_name' with the actual file name (without .rs). ```sh cargo run --example example_name ``` -------------------------------- ### Basic Supercluster Usage in Rust Source: https://github.com/chargetrip/supercluster-rs/blob/main/README.md An example of how to initialize and use the Supercluster crate in Rust. It covers setting configuration options, creating a cluster instance, loading features, and retrieving a tile. ```rust use supercluster::{ CoordinateSystem, Supercluster, SuperclusterError }; fn main() -> Result<(), SuperclusterError> { // Set the configuration settings let options = Supercluster::builder() .radius(40.0) .extent(512.0) .min_points(2) .max_zoom(16) .coordinate_system(CoordinateSystem::LatLng) .build(); // Create a new instance with the specified configuration settings let mut cluster = Supercluster::new(options); // Create a a list of features let features = Supercluster::feature_builder() .add_point(vec![0.0, 0.0]) .build(); // Load a list of features into the supercluster let index = cluster.load(features)?; index.get_tile(0, 0.0, 0.0)?; Ok(()) } ``` -------------------------------- ### Generate Documentation Source: https://github.com/chargetrip/supercluster-rs/blob/main/CONTRIBUTING.md Generates HTML documentation for the Supercluster project and automatically opens it in the default web browser. ```bash cargo doc --open ``` -------------------------------- ### Run All Benchmarks Source: https://github.com/chargetrip/supercluster-rs/blob/main/CONTRIBUTING.md Executes all benchmark tests defined within the 'benches' directory of the Supercluster project. ```sh cd benches # Run all benchmarks cargo bench ``` -------------------------------- ### Run Specific Benchmark File Source: https://github.com/chargetrip/supercluster-rs/blob/main/CONTRIBUTING.md Executes benchmarks specifically from the 'benches/supercluster_bench.rs' file. ```sh cargo bench --bench supercluster_bench ``` -------------------------------- ### Format Code with Rustfmt Source: https://github.com/chargetrip/supercluster-rs/blob/main/CONTRIBUTING.md Applies code formatting to the entire project according to Rustfmt standards. ```rust cargo fmt ``` -------------------------------- ### Build Supercluster Project Source: https://github.com/chargetrip/supercluster-rs/blob/main/CONTRIBUTING.md Compiles the Supercluster Rust project. This command builds the entire project and its dependencies. ```rust cargo build ``` -------------------------------- ### Clone Supercluster Repository Source: https://github.com/chargetrip/supercluster-rs/blob/main/CONTRIBUTING.md Clones the Supercluster Rust project repository to your local machine. This is the first step before making any changes. ```sh git clone git@github.com:chargetrip/supercluster-rs.git ``` -------------------------------- ### Run All Tests Source: https://github.com/chargetrip/supercluster-rs/blob/main/CONTRIBUTING.md Executes all tests within the Supercluster project, including those enabled by all features. ```rust cargo test --all-features ``` -------------------------------- ### Lint Code with Clippy Source: https://github.com/chargetrip/supercluster-rs/blob/main/CONTRIBUTING.md Runs the Clippy linter to check for common mistakes and enforce Rust best practices. It checks all targets and features, and flags warnings as errors. ```rust cargo clippy --locked --all-targets --all-features --no-deps -- -D warnings ``` -------------------------------- ### Add Supercluster with Features to Cargo.toml Source: https://github.com/chargetrip/supercluster-rs/blob/main/README.md Demonstrates how to include optional features like logging, serialization, and cluster metadata when adding the supercluster crate to Cargo.toml. ```toml [dependencies] supercluster = { version = "3.0.4", features = ["log", "serde", "cluster_metadata"] } ``` -------------------------------- ### Run Tests with Specific Feature Source: https://github.com/chargetrip/supercluster-rs/blob/main/CONTRIBUTING.md Runs tests in the Supercluster project that are enabled by the 'cluster_metadata' feature. ```rust cargo test --features cluster_metadata ``` -------------------------------- ### Push Changes Source: https://github.com/chargetrip/supercluster-rs/blob/main/CONTRIBUTING.md Pushes your committed changes from your local branch to your forked repository on GitHub. ```sh git push origin my-feature-branch ``` -------------------------------- ### Add Supercluster to Cargo.toml Source: https://github.com/chargetrip/supercluster-rs/blob/main/README.md Specifies how to add the supercluster crate as a dependency in your project's Cargo.toml file. ```toml [dependencies] supercluster = "3.0.4" ``` -------------------------------- ### Commit Changes Source: https://github.com/chargetrip/supercluster-rs/blob/main/CONTRIBUTING.md Commits your staged changes with a descriptive message. Following a conventional commit message format is recommended. ```sh git commit -m "feat: description of my changes" ``` -------------------------------- ### Create New Branch Source: https://github.com/chargetrip/supercluster-rs/blob/main/CONTRIBUTING.md Creates a new Git branch for your feature or bug fix. It's a best practice to work on a separate branch for each contribution. ```sh git checkout -b my-feature-branch ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.