sui icon indicating copy to clipboard operation
sui copied to clipboard

[std] Better ASCII methods + minor cleanup in std

Open damirka opened this issue 1 year ago • 2 comments

Description

Adds new methods to std::ascii:

  • ascii::append(&mut String, String)
  • ascii::is_alphanumeric(&String): bool
  • ascii::is_empty(): bool
  • ascii::substring(&String, i, j): String
  • ascii::index_of(&String, &String): u64
  • ascii::to_uppercase(&String): String
  • ascii::to_lowercase(&String): String

So ASCII interface is similar to the one in UTF8

Renames:

  • string::bytes() -> string::as_bytes()
  • string::sub_string() -> string::substring()

Additionally:

  • updates std::type_name to use std::substring
  • removes use statements for implicit imports
  • renames constants from E_INDEX to conventional EIndexOutOfBounds

Test plan

Features tests

Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • [x] Protocol:
  • [ ] Nodes (Validators and Full nodes):
  • [ ] Indexer:
  • [ ] JSON-RPC:
  • [ ] GraphQL:
  • [ ] CLI:
  • [ ] Rust SDK:

damirka avatar Apr 27 '24 15:04 damirka

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 9, 2024 1:00pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview May 9, 2024 1:00pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview May 9, 2024 1:00pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview May 9, 2024 1:00pm

vercel[bot] avatar Apr 27 '24 15:04 vercel[bot]

@tnowacki @amnn I have updated the PR to add aliases + new functions without getting into Char territory.

damirka avatar May 07 '24 18:05 damirka