Skip to content

Fix for removal of Nat #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Html.roc
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ interface Html
imports [Attribute.{ Attribute, attribute }, SafeStr.{ SafeStr, escape, dangerouslyMarkSafe }]

## An HTML node, either an HTML element or some text inside an HTML element.
Node : [Element Str Nat (List Attribute) (List Node), Text Str, UnescapedHtml Str]
Node : [Element Str U64 (List Attribute) (List Node), Text Str, UnescapedHtml Str]

## Create a `Text` node containing a string.
##
Expand Down Expand Up @@ -198,7 +198,7 @@ element = \tagName ->
Element tagName totalSize attrs children

## Internal helper to calculate the size of a node
nodeSize : Node -> Nat
nodeSize : Node -> U64
nodeSize = \node ->
when node is
Text content ->
Expand Down
4 changes: 2 additions & 2 deletions src/SafeStr.roc
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ expect
toStr (dangerouslyMarkSafe badStr) == badStr

## The SafeStr equivalent of Str.withCapacity
withCapacity : Nat -> SafeStr
withCapacity : U64 -> SafeStr
withCapacity = \capacity ->
@SafeStr (Str.withCapacity capacity)

expect toStr (withCapacity 10) == ""

## The SafeStr equivalent of Str.reserve
reserve : SafeStr, Nat -> SafeStr
reserve : SafeStr, U64 -> SafeStr
reserve = \@SafeStr str, additionalCapacity ->
@SafeStr (Str.reserve str additionalCapacity)

Expand Down