From 5be52485f4f14ae7d0040bef27ed696bf4772530 Mon Sep 17 00:00:00 2001 From: moonagent Date: Thu, 14 Aug 2025 06:54:12 +0000 Subject: [PATCH 1/2] style: update code format --- src/algorithms/capture.mbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/capture.mbt b/src/algorithms/capture.mbt index fbb7ae6..3aff322 100644 --- a/src/algorithms/capture.mbt +++ b/src/algorithms/capture.mbt @@ -21,7 +21,7 @@ /// /// A simple wrapper around Array[DiffOp] that implements the DiffHook interface /// This allows it to collect operations from any diff algorithm -type Capture Array[DiffOp] derive(Default) +struct Capture(Array[DiffOp]) derive(Default) /// ================================================================================ /// CONSTRUCTION METHODS From 29ae665f861c63d6bb7bdfd552ec82535e71ee73 Mon Sep 17 00:00:00 2001 From: moonagent Date: Thu, 14 Aug 2025 06:56:26 +0000 Subject: [PATCH 2/2] fix: remove unused functions and enable compiler warnings This commit addresses all compiler warnings by: 1. **Enabling warnings globally**: Updated both package configurations (`src/moon.pkg.json` and `src/algorithms/moon.pkg.json`) to enable all warnings with `+a` instead of suppressing specific warnings with `-1-2-3-5-6-7-8-10-29`. 2. **Removing unused functions**: Eliminated three unused private functions from the Range module: - `Range::intersect()` - Creates intersection of two ranges - `Range::union()` - Creates union of two ranges - `Range::split_at()` - Splits range at given point These functions were well-documented utility methods but were not being used anywhere in the codebase, causing compiler warnings. They can be added back later if needed. **Testing**: All existing tests continue to pass, ensuring no functionality was broken by these changes. **Build**: Project now compiles cleanly with all warnings enabled. --- src/algorithms/moon.pkg.json | 2 +- src/algorithms/range.mbt | 23 ----------------------- src/moon.pkg.json | 2 +- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/algorithms/moon.pkg.json b/src/algorithms/moon.pkg.json index 78bccc1..84d8856 100644 --- a/src/algorithms/moon.pkg.json +++ b/src/algorithms/moon.pkg.json @@ -1,3 +1,3 @@ { - "warn-list": "-1-2-3-5-6-7-8-10-29" + "warn-list": "+a" } diff --git a/src/algorithms/range.mbt b/src/algorithms/range.mbt index 64a71b8..ff22602 100644 --- a/src/algorithms/range.mbt +++ b/src/algorithms/range.mbt @@ -98,26 +98,3 @@ pub fn Range::iter(self : Range) -> Iter[Int] { /// /// Additional utility methods that could be useful for range manipulation /// These are not currently used but demonstrate the mathematical properties - -///| Creates the intersection of two ranges -/// @return Range representing the overlap, or empty range if no overlap -fn Range::intersect(self : Range, other : Range) -> Range { - let start = @cmp.maximum(self.start, other.start) - let end = @cmp.minimum(self.end, other.end) - Range::new(start, end) -} - -///| Creates the union of two ranges (smallest range containing both) -/// @return Range spanning both input ranges -fn Range::union(self : Range, other : Range) -> Range { - let start = @cmp.minimum(self.start, other.start) - let end = @cmp.maximum(self.end, other.end) - Range::new(start, end) -} - -///| Splits the range at a given point -/// @param at The split point (must be within range) -/// @return Tuple of (left_range, right_range) -fn Range::split_at(self : Range, at : Int) -> (Range, Range) { - (Range::new(self.start, at), Range::new(at, self.end)) -} diff --git a/src/moon.pkg.json b/src/moon.pkg.json index f1bf2e0..3b99388 100644 --- a/src/moon.pkg.json +++ b/src/moon.pkg.json @@ -5,5 +5,5 @@ "alias": "algorithms" } ], - "warn-list": "-1-2-3-5-6-7-8-10-29" + "warn-list": "+a" }