From 20bbf2297e3bb2341006d0ba891ff12c19dc9c76 Mon Sep 17 00:00:00 2001
From: GeWuYou <95328647+GeWuYou@users.noreply.github.com>
Date: Sat, 31 Jan 2026 21:34:02 +0800
Subject: [PATCH] =?UTF-8?q?refactor(pipe):=20=E7=A7=BB=E9=99=A4Apply?=
=?UTF-8?q?=E5=92=8COn=E6=89=A9=E5=B1=95=E6=96=B9=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 删除了Apply扩展方法及其相关文档注释
- 删除了On扩展方法及其相关文档注释
- 移除了对应的单元测试方法
- 保留了Also、Pipe等其他管道操作方法
---
.../functional/pipe/PipeExtensionsTests.cs | 15 -----------
.../functional/pipe/PipeExtensions.cs | 26 -------------------
2 files changed, 41 deletions(-)
diff --git a/GFramework.Core.Tests/functional/pipe/PipeExtensionsTests.cs b/GFramework.Core.Tests/functional/pipe/PipeExtensionsTests.cs
index bdaa0ce..aca1386 100644
--- a/GFramework.Core.Tests/functional/pipe/PipeExtensionsTests.cs
+++ b/GFramework.Core.Tests/functional/pipe/PipeExtensionsTests.cs
@@ -66,21 +66,6 @@ public class PipeExtensionsTests
int AddTwo(int x) => x + 2;
}
- ///
- /// 测试Apply方法 - 验证函数能够正确应用到参数上
- ///
- [Test]
- public void Apply_Should_Apply_Function_To_Argument()
- {
- // Arrange
- Func multiplyByTwo = x => x * 2;
-
- // Act
- var result = multiplyByTwo.Apply(5);
-
- // Assert
- Assert.That(result, Is.EqualTo(10));
- }
///
/// 测试Also方法 - 验证执行操作后返回原值功能
diff --git a/GFramework.Core/functional/pipe/PipeExtensions.cs b/GFramework.Core/functional/pipe/PipeExtensions.cs
index 8127b48..b636f33 100644
--- a/GFramework.Core/functional/pipe/PipeExtensions.cs
+++ b/GFramework.Core/functional/pipe/PipeExtensions.cs
@@ -59,32 +59,6 @@ public static class PipeExtensions
Func first)
=> x => second(first(x));
- ///
- /// Apply:将函数应用于值(柯里化辅助)
- ///
- /// 输入值的类型
- /// 函数返回结果的类型
- /// 要应用的函数
- /// 要传递给函数的输入值
- /// 函数执行后的结果
- public static TResult Apply(
- this Func func,
- TSource value)
- => func(value);
-
- ///
- /// On:将值应用于函数(与Apply功能相同,但参数顺序相反)
- ///
- /// 输入值的类型
- /// 函数返回结果的类型
- /// 要传递给函数的输入值
- /// 要应用的函数
- /// 函数执行后的结果
- public static TResult On(
- this TSource value,
- Func func)
- => func(value);
-
///
/// Also:执行操作并返回原值
///