From 417a09ea8db478801f4d1c7b082098a6c837856d Mon Sep 17 00:00:00 2001 From: Richard Webb Date: Fri, 23 Aug 2024 17:03:30 +0100 Subject: [PATCH] A few fsharp-analyzers suggestions --- Expecto/Expecto.Impl.fs | 4 ++-- Expecto/Expecto.fs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Expecto/Expecto.Impl.fs b/Expecto/Expecto.Impl.fs index db4b0145..7987a07d 100644 --- a/Expecto/Expecto.Impl.fs +++ b/Expecto/Expecto.Impl.fs @@ -960,7 +960,7 @@ module Impl = else let nestedFunc = t.GetTypeInfo().GetFields() - |> Seq.tryFind (fun f -> isFsharpFuncType f.FieldType) + |> Array.tryFind (fun f -> isFsharpFuncType f.FieldType) match nestedFunc with | Some f -> f.GetValue(testFunc).GetType() | None -> t @@ -969,7 +969,7 @@ module Impl = match testCode with | Sync test -> let t = getFuncTypeToUse test asm - let m = t.GetTypeInfo().GetMethods () |> Seq.find (fun m -> (m.Name = "Invoke") && (m.DeclaringType = t)) + let m = t.GetTypeInfo().GetMethods () |> Array.find (fun m -> (m.Name = "Invoke") && (m.DeclaringType = t)) (t.FullName, m.Name) | SyncWithCancel _ -> ("Unknown SyncWithCancel", "Unknown SyncWithCancel") diff --git a/Expecto/Expecto.fs b/Expecto/Expecto.fs index cae655c4..524748f4 100644 --- a/Expecto/Expecto.fs +++ b/Expecto/Expecto.fs @@ -543,7 +543,7 @@ module Tests = match Args.parseOptions options args with | Ok cliArguments -> let config = - Seq.fold (fun s a -> foldCLIArgumentToConfig a s) baseConfig cliArguments + List.fold (fun s a -> foldCLIArgumentToConfig a s) baseConfig cliArguments if List.exists(function List_Tests _ -> true | _ -> false) cliArguments then ArgsList config elif List.contains Version cliArguments then