• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

neon-sunset / U8String / 5929604283

21 Aug 2023 05:34PM UTC coverage: 20.165% (+0.2%) from 19.993%
5929604283

push

github

neon-sunset
feat: dedup concat, add concat byte

122 of 858 branches covered (14.22%)

Branch coverage included in aggregate %.

11 of 11 new or added lines in 3 files covered. (100.0%)

439 of 1924 relevant lines covered (22.82%)

26556.69 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

3.45
/src/U8String.Operators.cs
1
namespace U8Primitives;
2

3
public readonly partial struct U8String
4
{
5
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
6
    public static U8String operator +(U8String left, byte right)
7
    {
8
        if (!U8Info.IsAsciiByte(right))
×
9
        {
10
            ThrowHelpers.InvalidUtf8();
×
11
        }
12

13
        return U8Manipulation.ConcatUnchecked(left, right);
×
14
    }
15

16
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
17
    public static U8String operator +(U8String left, U8String right) => Concat(left, right);
×
18

19
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
20
    public static U8String operator +(U8String left, byte[] right) => Concat(left, right);
×
21

22
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
23
    public static U8String operator +(U8String left, Span<byte> right) => Concat(left, right);
×
24

25
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
26
    public static U8String operator +(U8String left, ReadOnlySpan<byte> right) => Concat(left, right);
×
27

28
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
29
    public static U8String operator +(byte[] left, U8String right) => Concat(left, right);
×
30

31
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
32
    public static U8String operator +(Span<byte> left, U8String right) => Concat(left, right);
×
33

34
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
35
    public static U8String operator +(ReadOnlySpan<byte> left, U8String right) => Concat(left, right);
×
36

37
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
38
    public static bool operator ==(U8String left, U8String right) => left.Equals(right);
×
39

40
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
41
    public static bool operator ==(U8String left, byte[] right) => left.Equals(right);
×
42

43
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
44
    public static bool operator ==(U8String left, Span<byte> right) => left.Equals(right);
×
45

46
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
47
    public static bool operator ==(U8String left, ReadOnlySpan<byte> right) => left.Equals(right);
×
48

49
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
50
    public static bool operator ==(byte[] left, U8String right) => right.Equals(left);
×
51

52
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
53
    public static bool operator ==(Span<byte> left, U8String right) => right.Equals(left);
×
54

55
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
56
    public static bool operator ==(ReadOnlySpan<byte> left, U8String right) => right.Equals(left);
×
57

58
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
59
    public static bool operator !=(U8String left, U8String right) => !(left == right);
×
60

61
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
62
    public static bool operator !=(U8String left, byte[] right) => !(left == right);
×
63

64
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
65
    public static bool operator !=(U8String left, Span<byte> right) => !(left == right);
×
66

67
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
68
    public static bool operator !=(U8String left, ReadOnlySpan<byte> right) => !(left == right);
×
69

70
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
71
    public static bool operator !=(byte[] left, U8String right) => !(left == right);
×
72

73
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
74
    public static bool operator !=(Span<byte> left, U8String right) => !(left == right);
×
75

76
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
77
    public static bool operator !=(ReadOnlySpan<byte> left, U8String right) => !(left == right);
×
78

79
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
80
    public static explicit operator U8String(ReadOnlySpan<byte> value)
81
    {
82
        return new(value);
×
83
    }
84

85
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
86
    public static implicit operator ReadOnlySpan<byte>(U8String value)
87
    {
88
        return value.AsSpan();
642✔
89
    }
90

91
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
92
    public static implicit operator ReadOnlyMemory<byte>(U8String value)
93
    {
94
        return value.AsMemory();
×
95
    }
96
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc