Skip to content

Instantly share code, notes, and snippets.

import { Err, Ok, type Result, getValues } from './result';
describe('Result', () => {
describe('Ok', () => {
test('should create an Ok result with the given value', () => {
const result = Ok('hello');
expect(result.ok).toBe(true);
expect(result.unwrap()).toBe('hello');
@LordJZ
LordJZ / SpanSplitExtensions.cs
Created August 9, 2018 18:04
Split for Span
using System;
using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
public static class SpanSplitExtensions
{
public ref struct Enumerable1<T> where T : IEquatable<T>
{
public Enumerable1(ReadOnlySpan<T> span, T separator)
{