Skip to content

feat: Update dependencies and improve formatting for Cartesian and Sp…#8

Merged
VPRamon merged 2 commits intomainfrom
extend-format
Feb 26, 2026
Merged

feat: Update dependencies and improve formatting for Cartesian and Sp…#8
VPRamon merged 2 commits intomainfrom
extend-format

Conversation

@VPRamon
Copy link
Member

@VPRamon VPRamon commented Feb 26, 2026

This pull request introduces a significant enhancement to the formatting capabilities of coordinate and vector types throughout the codebase. The main focus is to ensure that all coordinate types (XYZ, Direction, Position, Vector) properly respect Rust's formatting traits (Display, LowerExp, UpperExp), allowing users to customize string representations (e.g., precision, scientific notation) consistently. Additionally, tests have been added to verify these behaviors, and a dependency update is included.

Formatting improvements for coordinate and vector types:

  • Implemented LowerExp and UpperExp formatting traits for XYZ<T>, Direction<F>, Position<C, F, U>, and Vector<F, U>, ensuring that all types now respect precision and scientific notation format specifiers in their string outputs. (src/cartesian/xyz.rs, src/cartesian/direction.rs, src/cartesian/position.rs, src/cartesian/vector.rs, src/ellipsoidal/position.rs, src/spherical/direction.rs, src/spherical/position.rs) [1] [2] [3] [4] [5] [6] [7]

  • Refactored Display implementations for all coordinate types to use generic formatting, instead of hardcoded precision, for improved flexibility and consistency. (src/cartesian/xyz.rs, src/cartesian/direction.rs, src/cartesian/position.rs, src/cartesian/vector.rs, src/ellipsoidal/position.rs, src/spherical/direction.rs, src/spherical/position.rs) [1] [2] [3] [4] [5] [6] [7]

Testing enhancements:

  • Added and updated tests to verify that all coordinate and vector types correctly honor format specifiers, including custom precision and scientific notation. (src/cartesian/xyz.rs, src/cartesian/direction.rs, src/cartesian/position.rs, src/cartesian/vector.rs, src/ellipsoidal/position.rs, src/spherical/direction.rs, src/spherical/position.rs) [1] [2] [3] [4] [5] [6] [7]

Dependency and workspace updates:

  • Updated the qtty dependency from version 0.3.0 to 0.4.0 in Cargo.toml, and added a [workspace] section for workspace support. [1] [2]

Minor code cleanup:

  • Simplified parsing logic in affn-derive/src/lib.rs by replacing a match statement with an if let construct. [1] [2]

These changes make the codebase more robust and user-friendly by allowing flexible formatting of coordinate and vector types, improving test coverage, and keeping dependencies up to date.

@VPRamon VPRamon self-assigned this Feb 26, 2026
@github-actions
Copy link

github-actions bot commented Feb 26, 2026

Code Coverage

Package Line Rate Complexity Health
src.spherical 91% 0
src.ellipsoidal 70% 0
src.frames 93% 0
src 100% 0
src.cartesian 96% 0
src.ops 100% 0
Summary 93% (2647 / 2848) 0

@VPRamon VPRamon merged commit 481f790 into main Feb 26, 2026
5 checks passed
@VPRamon VPRamon deleted the extend-format branch February 26, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant