Skip to content

Commit 2dd965d

Browse files
aman-godaraawvwgk
andauthored
cleaning namespace and using the maybe
Note: here how using maybe(string) automatically access the string%raw. maybe is used for safe memory access. Co-authored-by: Sebastian Ehlert <[email protected]>
1 parent 6dde4d6 commit 2dd965d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/stdlib_string_type.f90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
!>
1313
!> The specification of this module is available [here](../page/specs/stdlib_string_type.html).
1414
module stdlib_string_type
15-
use stdlib_ascii, only: to_lower, to_upper, to_title, reverse
15+
use stdlib_ascii, only: to_lower_ => to_lower, to_upper_ => to_upper, to_title_ => to_title, reverse_ => reverse
1616

1717
implicit none
1818
private
@@ -482,7 +482,7 @@ elemental function to_lower_string(string) result(lowered_string)
482482
type(string_type), intent(in) :: string
483483
type(string_type) :: lowered_string
484484

485-
lowered_string%raw = to_lower(string%raw)
485+
lowered_string%raw = to_lower_(maybe(string))
486486

487487
end function to_lower_string
488488

@@ -492,7 +492,7 @@ elemental function to_upper_string(string) result(uppered_string)
492492
type(string_type), intent(in) :: string
493493
type(string_type) :: uppered_string
494494

495-
uppered_string%raw = to_upper(string%raw)
495+
uppered_string%raw = to_upper_(maybe(string))
496496

497497
end function to_upper_string
498498

@@ -502,7 +502,7 @@ elemental function to_title_string(string) result(titled_string)
502502
type(string_type), intent(in) :: string
503503
type(string_type) :: titled_string
504504

505-
titled_string%raw = to_title(string%raw)
505+
titled_string%raw = to_title_(maybe(string))
506506

507507
end function to_title_string
508508

@@ -512,7 +512,7 @@ elemental function reverse_string(string) result(reversed_string)
512512
type(string_type), intent(in) :: string
513513
type(string_type) :: reversed_string
514514

515-
reversed_string%raw = reverse(string%raw)
515+
reversed_string%raw = reverse_(maybe(string))
516516

517517
end function reverse_string
518518

0 commit comments

Comments
 (0)