From 947ecc285805a1e2a425cec04f1d510cc34f8081 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 19 Jun 2023 13:32:31 +0200 Subject: [PATCH 1/4] Update documentation of `fj` --- crates/fj/src/args.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/fj/src/args.rs b/crates/fj/src/args.rs index 01d9bb809..747bd775a 100644 --- a/crates/fj/src/args.rs +++ b/crates/fj/src/args.rs @@ -4,6 +4,16 @@ use fj_core::algorithms::approx::{InvalidTolerance, Tolerance}; use fj_math::Scalar; /// Standardized CLI for Fornjot models +/// +/// This is completely optional, as models are just Rust code and don't need any +/// kind of CLI interface. It is useful, however, to provide a standardized +/// interface for viewing and exporting models, and is used for Fornjot's +/// example models and the testing infrastructure they are part of. +/// +/// You might not want to use this struct directly. [`handle_model`] Provides a +/// more high-level and convenient interface. +/// +/// [`handle_model`]: crate::handle_model() #[derive(clap::Parser)] pub struct Args { /// Export model to this path From 0366ac1bb9795239d7dd998c4a1b2e5db9bf3b8e Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 19 Jun 2023 13:34:36 +0200 Subject: [PATCH 2/4] Rename `window::Error` to `WindowError` --- crates/fj-window/src/display.rs | 2 +- crates/fj-window/src/window.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/fj-window/src/display.rs b/crates/fj-window/src/display.rs index a6d67a517..3acfd7548 100644 --- a/crates/fj-window/src/display.rs +++ b/crates/fj-window/src/display.rs @@ -121,7 +121,7 @@ pub fn display(model: Model, invert_zoom: bool) -> Result<(), Error> { pub enum Error { /// Error initializing window #[error("Error initializing window")] - WindowInit(#[from] window::Error), + WindowInit(#[from] window::WindowError), /// Error initializing graphics #[error("Error initializing graphics")] diff --git a/crates/fj-window/src/window.rs b/crates/fj-window/src/window.rs index 8808c8ac5..736f34dd2 100644 --- a/crates/fj-window/src/window.rs +++ b/crates/fj-window/src/window.rs @@ -6,7 +6,7 @@ pub struct Window(winit::window::Window); impl Window { /// Create an instance of `Window` from the given `EventLoop` - pub fn new(event_loop: &EventLoop) -> Result { + pub fn new(event_loop: &EventLoop) -> Result { let window = WindowBuilder::new() .with_title("Fornjot") .with_maximized(true) @@ -57,4 +57,4 @@ impl Screen for Window { /// Error initializing window #[derive(Debug, thiserror::Error)] #[error("Error initializing window")] -pub struct Error(#[from] pub winit::error::OsError); +pub struct WindowError(#[from] pub winit::error::OsError); From 9057567673bef7c26fe9a9e7c530330696e06fd4 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 19 Jun 2023 13:36:12 +0200 Subject: [PATCH 3/4] Add missing re-export `WindowError` is used in the public `fj_window::Error` type. --- crates/fj-window/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/fj-window/src/lib.rs b/crates/fj-window/src/lib.rs index 5b9f8b7a1..bbd295a2c 100644 --- a/crates/fj-window/src/lib.rs +++ b/crates/fj-window/src/lib.rs @@ -13,4 +13,7 @@ mod display; mod window; -pub use self::display::{display, Error}; +pub use self::{ + display::{display, Error}, + window::WindowError, +}; From 81f3252ea65f7f6499520f2a890efe7efb513506 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 19 Jun 2023 14:02:19 +0200 Subject: [PATCH 4/4] Fix typo in documentation --- crates/fj-math/src/line.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/fj-math/src/line.rs b/crates/fj-math/src/line.rs index c46821983..1e598ae49 100644 --- a/crates/fj-math/src/line.rs +++ b/crates/fj-math/src/line.rs @@ -79,7 +79,7 @@ impl Line { /// Access the direction of the line /// /// The length of this vector defines the unit of the line's curve - /// coordinate system. The coordinate `1.` is always were the direction + /// coordinate system. The coordinate `1.` is always where the direction /// vector points, from `origin`. pub fn direction(&self) -> Vector { self.direction