1

I would like to do something like this at global space level:

const USERDATA_RELATIVE_PATH: &str = "name/surname/userdata";
const SHORTCUTS_VDF_RELATIVE_PATH: &str = USERDATA_RELATIVE_PATH+"/##USERID##/config/data.vdf";

The problem is that there's no way to concatenate 2 &str if one of them is not owned. So, when I try to do this I get this error:

string concatenation requires an owned String on the left

But, if I change it to own the string then I get this error:

cannot call non-const operator in constants

I understand the errors, but I would like to do if there's a way to accomplish this because I have been tinkering with this problem for 1 hour and wasn't able to get anything usable.

Notbad
  • 5,936
  • 12
  • 54
  • 100

0 Answers0