feat: remove some optional in rust and cbindgen
This commit is contained in:
@@ -230,22 +230,15 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::optional<std::string> ResolveName() {
|
||||
std::string ResolveName() {
|
||||
const char* name = nullptr;
|
||||
_Check(wfassoc::WFProgramResolveName(_token, &name));
|
||||
if (name == nullptr) {
|
||||
return std::nullopt;
|
||||
} else {
|
||||
return std::string(name);
|
||||
}
|
||||
return std::string(name);
|
||||
}
|
||||
|
||||
std::optional<IconRc> ResolveIcon() {
|
||||
IconRc ResolveIcon() {
|
||||
Token token = _INVALID_TOKEN();
|
||||
_Check(wfassoc::WFProgramResolveIcon(_token, &token));
|
||||
if (token == _INVALID_TOKEN()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
return IconRc(token);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user