From 8ef355299b404db9dc38a14ae2388ff4082d6fd9 Mon Sep 17 00:00:00 2001 From: Jesse Phillips Date: Sun, 26 Jan 2020 21:40:07 -0800 Subject: [PATCH] :sparkles: Add safe annotations (#2) --- source/structopt/attributes.d | 5 ++++- source/structopt/package.d | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/structopt/attributes.d b/source/structopt/attributes.d index 4141ab9..24fb8b5 100644 --- a/source/structopt/attributes.d +++ b/source/structopt/attributes.d @@ -8,6 +8,8 @@ module structopt.attributes; import std.traits; +@safe: + /** * Command Line Help Message for the arugement. */ @@ -22,6 +24,7 @@ struct Help { * Command Line Argument Option which causes assignement to this field. */ struct Option { +@safe: /** * All argument options. */ @@ -34,7 +37,7 @@ struct Option { * @Option("help", "h") */ this(string[] names...) { - this.names = names; + this.names = names.dup; } /** diff --git a/source/structopt/package.d b/source/structopt/package.d index 7ab6586..eeeaeb3 100644 --- a/source/structopt/package.d +++ b/source/structopt/package.d @@ -40,6 +40,8 @@ public import structopt.attributes; public import std.getopt; public import std.traits; +@safe: + /// Rename the Option struct of getopt alias GetOption = std.getopt.Option; /// Reastablish the name for the struct attributes