From 8c649a828c79f40c7caf3d5d025078bbfd70c884 Mon Sep 17 00:00:00 2001 From: yifanwww Date: Sun, 17 Sep 2023 23:48:58 +0800 Subject: [PATCH] feat: simplify Ok factory fn --- src/factory.ts | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/factory.ts b/src/factory.ts index d6af68f..d80ca9f 100644 --- a/src/factory.ts +++ b/src/factory.ts @@ -6,21 +6,12 @@ import type { Result } from './types'; * * Examples: * ```ts - * const result = Ok(1); + * const result1 = Ok(1); + * const result2 = Ok(1); + * const result3: Result = Ok(2); * ``` */ -export function Ok(value: T): Result; -/** - * Creates a `Result` that contains the success value. - * - * Examples: - * ```ts - * const result1 = Ok(1); - * const result2: Result = Ok(2); - * ``` - */ -export function Ok(value: T): Result; -export function Ok(value: T): Result { +export function Ok(value: T): Result { return RustlikeResult.Ok(value); }