Skip to content

Commit 4427b07

Browse files
committed
Fix API documentation issues
1 parent dbe45d9 commit 4427b07

8 files changed

Lines changed: 36 additions & 26 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CoursePointer Changelog
22

3+
## v0.3.1
4+
5+
- Fix issues with rust docs.
6+
37
## v0.3.0
48

59
- Made the `course` module a public library that can be used to build courses

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "coursepointer"
33
description = "Converts waypoints into Garmin FIT course points"
4-
version = "0.3.0"
4+
version = "0.3.1"
55
edition = "2024"
66
rust-version = "1.85"
77
default-run = "coursepointer"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "coursepointer"
3-
version = "0.3.0"
3+
version = "0.3.1"
44
description = "Add your description here"
55
requires-python = ">=3.13"
66
dependencies = [

src/course.rs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@
4949
//!
5050
//! # Units of measure
5151
//!
52-
//! Courses and related types here us zero-cost unit of measure types from
52+
//! Courses and related types here use zero-cost unit of measure types from
5353
//! [dimensioned](https://docs.rs/dimensioned/latest/dimensioned/) to avoid type
54-
//! confusion of speed and distance quantities, and analogous types implemented
55-
//! here for angular degrees.
54+
//! confusion of speed and distance quantities, and analogous types are
55+
//! implemented here for angular degrees.
5656
//!
5757
//! You can obtain a dimensional quantity by multiplying a constant representing
5858
//! the unit of measure, for example:
@@ -157,13 +157,21 @@ impl Default for CourseSetOptions {
157157
}
158158

159159
impl CourseSetOptions {
160+
/// Sets the threshold distance for course point interception
161+
///
162+
/// Sets a distance, in meters, below which a waypoint may be considered to
163+
/// "intercept" a route, turning it into a course point.
160164
pub fn with_threshold(self, threshold: Meter<f64>) -> Self {
161165
Self {
162166
threshold,
163167
strategy: self.strategy,
164168
}
165169
}
166170

171+
/// Set strategy for handling duplicate intercepts
172+
///
173+
/// Controls how waypoints that intercept the route multiple times (within
174+
/// the threshold) are handled.
167175
pub fn with_strategy(self, strategy: InterceptStrategy) -> Self {
168176
Self {
169177
threshold: self.threshold,
@@ -172,7 +180,7 @@ impl CourseSetOptions {
172180
}
173181
}
174182

175-
/// A set of [`Course`]s and their associated course points.
183+
/// A collection of [`Course`]s and their associated course points.
176184
pub struct CourseSet {
177185
/// Courses with any associated course points.
178186
pub courses: Vec<Course>,
@@ -664,8 +672,8 @@ impl<'a> SegmentedCourseBuilder<'a> {
664672
/// A course record
665673
///
666674
/// Represents a single point along a course, analogous to a route point or a
667-
/// track point. However, a course record additionally contains the points'
668-
/// cumulative distances along the course.
675+
/// track point. However, in contrast with a route point, a course record
676+
/// additionally contains the points' cumulative distances along the course.
669677
#[derive(Clone, PartialEq, Debug)]
670678
pub struct Record {
671679
/// Position including optional elevation
@@ -715,8 +723,8 @@ impl TryFrom<Waypoint<GeoPoint>> for Waypoint<GeoAndXyzPoint> {
715723
pub struct CoursePoint {
716724
/// Position of the point's interception with the course
717725
///
718-
/// Note that this is calculated as interception from the waypoint, so the
719-
/// course point's position can be different from that of the original
726+
/// Note that this is calculated as the interception from the waypoint, so
727+
/// the course point's position can be different from that of the original
720728
/// waypoint.
721729
pub point: GeoPoint,
722730

src/fit.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ impl DefinitionFrame {
322322
}
323323
}
324324

325-
/// Course point types
325+
/// Sport types
326326
///
327327
/// Names and numeric values manually copied from Profile.xlsx in FIT SDK
328328
/// 21.171.00.
@@ -749,7 +749,7 @@ fn timedelta_from_seconds(s: Second<f64>) -> Result<TimeDelta> {
749749
))
750750
}
751751

752-
/// Options for writing a FIT course.
752+
/// Options for writing a FIT course
753753
#[derive(Clone, Debug)]
754754
pub struct FitCourseOptions {
755755
speed: MeterPerSecond<f64>,
@@ -761,7 +761,7 @@ pub struct FitCourseOptions {
761761
}
762762

763763
impl FitCourseOptions {
764-
/// Write the fit file using the given speed for record timestamps
764+
/// Write the FIT file using the given speed for record timestamps
765765
///
766766
/// This has the effect of setting the speed of the Virtual Partner on
767767
/// compatible Garmin devices.
@@ -772,16 +772,16 @@ impl FitCourseOptions {
772772

773773
/// Set the timestamp at which the course starts
774774
///
775-
/// Controls the timestamps on lap and record messages. An arbitrary but
776-
/// consistent time will be used if left unset.
775+
/// Controls the timestamps on lap and record messages. An arbitrary, but
776+
/// consistent and reproducible, time will be used if left unset.
777777
pub fn with_start_time(mut self, start_time: DateTime<Utc>) -> Self {
778778
self.start_time = start_time;
779779
self
780780
}
781781

782782
/// Set the course's sport
783783
///
784-
/// Defaults to Cycling if unset.
784+
/// Defaults to `cycling` if unset.
785785
pub fn with_sport(mut self, sport: Sport) -> Self {
786786
self.sport = sport;
787787
self
@@ -798,17 +798,17 @@ impl FitCourseOptions {
798798

799799
/// Set the software version to encode
800800
///
801-
/// This goes in the `file_creator` message's `software_version` field.
802-
/// Zero by default.
801+
/// This goes in the `file_creator` message's `software_version` field. Zero
802+
/// by default.
803803
pub fn with_software_version(mut self, software_version: u16) -> Self {
804804
self.software_version = software_version;
805805
self
806806
}
807807

808-
/// Set the software version to encode
808+
/// Set the hardware version to encode
809809
///
810-
/// This goes in the `file_creator` message's `software_version` field.
811-
/// Zero by default.
810+
/// This goes in the `file_creator` message's `hardware_version` field. Zero
811+
/// by default.
812812
pub fn with_hardware_version(mut self, hardware_version: u8) -> Self {
813813
self.hardware_version = hardware_version;
814814
self

src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@
4242
//!
4343
//! - `full-geolib` causes cxx_build to build all GeographicLib sources instead
4444
//! of a hand-picked subset. This is mainly useful when experimenting with
45-
//! new FFI additions, otherwise it simply slows the build down. This is just
46-
//! for convenience when hacking on this crate and experimenting with adding
47-
//! new FFIs, and would merely increase build time if enabled on main.
45+
//! new FFI additions, otherwise it simply slows the build down.
4846
4947
mod algorithm;
5048
pub mod course;

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)