Page MenuHomeDevCentral

Add support for Option::from() and Environment::tryGet()
ClosedPublic

Authored by dereckson on Oct 28 2025, 21:16.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 25, 14:08
Unknown Object (File)
Sat, Nov 22, 23:09
Unknown Object (File)
Sat, Nov 22, 16:21
Unknown Object (File)
Fri, Nov 21, 20:39
Unknown Object (File)
Wed, Nov 19, 05:34
Unknown Object (File)
Wed, Nov 19, 05:17
Unknown Object (File)
Wed, Nov 19, 05:16
Unknown Object (File)
Wed, Nov 19, 05:14
Subscribers
None

Details

Summary

Option::from simplifies the construction of Option types.
It allows nullable values (?T) to be converted into Option<T>:

  • None when the value is null
  • Some(value) otherwise

Example: Option::from(44) returns Some(44)

Environment::tryGet() is introduced to return an Option instead of throwing
an exception when querying an environment variable.

Environment::tryGet() returns an Option type instead of throwing an exception
when querying an environment variable. The existing Environment::get() method
remains unchanged and still throws an exception on failure.

Ref T2164

Test Plan

New unit tests for new methods

Diff Detail

Repository
rKERUALD Keruald libraries development repository
Lint
Lint Passed
Unit
Tests Passed
Branch
main
Build Status
Buildable 6106
Build 6390: arc lint + arc unit