@@ -49,7 +49,7 @@ std::expected<std::string, parse_error> inc(version input,
4949 }
5050 auto incremented_major_int = major_int + 1 ;
5151 auto major = std::to_string (incremented_major_int);
52- result = version_weaver::version{major, " 0" , " 0" };
52+ result = version_weaver::version{std::move ( major) , " 0" , " 0" };
5353 break ;
5454 }
5555 case MINOR:
@@ -62,8 +62,8 @@ std::expected<std::string, parse_error> inc(version input,
6262 return std::unexpected (parse_error::INVALID_MINOR);
6363 }
6464 auto incremented_minor_int = minor_int + 1 ;
65- result = version_weaver::version{
66- input.major , std::to_string (incremented_minor_int ), " 0" };
65+ auto minor = std::to_string (incremented_minor_int);
66+ result = version_weaver::version{ input.major , std::move (minor ), " 0" };
6767 break ;
6868 }
6969 case PATCH:
@@ -86,9 +86,9 @@ std::expected<std::string, parse_error> inc(version input,
8686 return std::unexpected (parse_error::INVALID_PRERELEASE);
8787 }
8888 auto incremented_prerelease_int = prerelease_int + 1 ;
89- return version_weaver::version{
90- input.major , input.minor , input.patch ,
91- std::to_string (incremented_prerelease_int) };
89+ auto prerelease = std::to_string (incremented_prerelease_int);
90+ return version_weaver::version{ input.major , input.minor , input.patch ,
91+ prerelease };
9292 }
9393 int patch_int;
9494 auto [ptr, ec] =
@@ -98,8 +98,9 @@ std::expected<std::string, parse_error> inc(version input,
9898 return std::unexpected (parse_error::INVALID_PATCH);
9999 }
100100 auto incremented_patch_int = patch_int + 1 ;
101- result = version_weaver::version{input.major , input.minor ,
102- std::to_string (incremented_patch_int)};
101+ auto patch = std::to_string (incremented_patch_int);
102+ result =
103+ version_weaver::version{input.major , input.minor , std::move (patch)};
103104 break ;
104105 }
105106 case RELEASE: {
0 commit comments