Skip to content

Commit

Permalink
Minor doc fixups (#640)
Browse files Browse the repository at this point in the history
- Clean up some docs warnings
- Add `#![cfg_attr(docsrs, feature(doc_auto_cfg))]` to `lib.rs` to turn
on feature flags in docs.rs, e.g. this from **stac-rs**:

<img
src=https://github.com/geoarrow/geoarrow-rs/assets/58314/fe542aea-d36a-4119-89a5-06b32fb5be2d
height=100>
  • Loading branch information
gadomski authored May 22, 2024
1 parent 4a4fd78 commit 6c0f80b
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 12 deletions.
3 changes: 0 additions & 3 deletions src/algorithm/broadcasting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
//!
//! The objects in this module are enums with two variants: `Scalar` and `Array`. Create an object
//! with the variant desired for your operation.
//!
//! For simplicity, the `Scalar` variants of the geometry broadcasting enums, such as
//! [`BroadcastablePoint`] accept a [`geo`] object, not a GeoArrow scalar object.
// mod geometry;
// mod linestring;
Expand Down
2 changes: 1 addition & 1 deletion src/algorithm/broadcasting/primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use arrow_array::types::ArrowPrimitiveType;
use arrow_array::PrimitiveArray;
use arrow_buffer::ArrowNativeType;

/// An enum over primitive types defined by [`arrow2::types::NativeType`]. These include u8, i32,
/// An enum over primitive types defined by [`ArrowPrimitiveType`]. These include u8, i32,
/// f64, etc.
///
/// [`IntoIterator`] is implemented for this, where it will iterate over the `Array` variant
Expand Down
2 changes: 1 addition & 1 deletion src/algorithm/geo/within.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use geo::Within as _Within;
/// assert!(! point!(x: 0.0, y: 0.0).is_within(&line_string));
/// ```
///
/// `Within` is equivalent to [`Contains`] with the arguments swapped.
/// `Within` is equivalent to [`Contains`](geo::Contains) with the arguments swapped.
///
/// ```
/// use geo::{point, line_string};
Expand Down
2 changes: 1 addition & 1 deletion src/algorithm/polylabel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::GeometryArrayTrait;
/// The calculation uses an iterative grid-based algorithm, ported from the original [JavaScript
/// implementation](https://github.com/mapbox/polylabel).
///
/// This binds to the existing Rust implementation in [polylabel].
/// This binds to the existing Rust implementation in [mod@polylabel].
pub trait Polylabel {
type Output;

Expand Down
2 changes: 1 addition & 1 deletion src/array/geometrycollection/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ impl<'a, O: OffsetSizeTrait> GeometryCollectionBuilder<O> {
self.geom_offsets.reserve_exact(additional.geom_capacity);
}

/// Extract the low-level APIs from the [`LineStringBuilder`].
/// Extract the low-level APIs from the [`GeometryCollectionBuilder`].
pub fn into_inner(
self,
) -> (
Expand Down
2 changes: 1 addition & 1 deletion src/array/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub enum Edges {
/// A GeoArrow metadata object following the extension metadata [defined by the GeoArrow
/// specification](https://geoarrow.org/extension-types).
///
/// This is serialized to JSON when a [`geoarrow`] array is exported to an [`arrow`] array and
/// This is serialized to JSON when a [`geoarrow`](self) array is exported to an [`arrow`] array and
/// deserialized when imported from an [`arrow`] array.
#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct ArrayMetadata {
Expand Down
2 changes: 1 addition & 1 deletion src/array/rect/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::GeometryArrayTrait;
/// but is included here for parity with georust/geo, and to save memory for the output of
/// `bounds()`.
///
/// Internally this is implemented as a FixedSizeList[4], laid out as minx, miny, maxx, maxy.
/// Internally this is implemented as a FixedSizeList, laid out as minx, miny, maxx, maxy.
#[derive(Debug, Clone, PartialEq)]
pub struct RectArray {
// Always GeoDataType::Rect
Expand Down
2 changes: 1 addition & 1 deletion src/io/geojson/geojson_writer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Vendored from geozero under the MIT/Apache 2 license until
//! https://github.com/georust/geozero/pull/208 is merged and released.
//! <https://github.com/georust/geozero/pull/208> is merged and released.
use geozero::error::Result;
use geozero::{ColumnValue, CoordDimensions, FeatureProcessor, GeomProcessor, PropertyProcessor};
Expand Down
2 changes: 1 addition & 1 deletion src/io/geozero/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Implements the geometry and dataset conversion APIs defined by the [`geozero`][::geozero]
//! Implements the geometry and dataset conversion APIs defined by the [`geozero`]
//! crate.
mod api;
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! A Rust implementation of the [GeoArrow](https://github.com/geoarrow/geoarrow) specification,
//! plus algorithms implemented on and returning these GeoArrow arrays.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

pub use trait_::GeometryArrayTrait;

pub mod algorithm;
Expand Down
2 changes: 1 addition & 1 deletion src/trait_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pub trait GeometryArrayTrait: std::fmt::Debug + Send + Sync {
///
/// # Validity
///
/// An [`ArrayAccessor`] must always return a well-defined value for an index that is
/// An [`GeometryArrayAccessor`] must always return a well-defined value for an index that is
/// within the bounds `0..Array::len`, including for null indexes where [`Array::is_null`] is true.
///
/// The value at null indexes is unspecified, and implementations must not rely on a specific
Expand Down

0 comments on commit 6c0f80b

Please sign in to comment.