mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
AK: Remove the LexicalPath::is_valid() API
Since this is always set to true on the non-default constructor and subsequently never modified, it is somewhat pointless. Furthermore, there are arguably no invalid relative paths.
This commit is contained in:
parent
caa9daf59e
commit
9b8f35259c
Notes:
sideshowbarker
2024-07-18 11:13:43 +09:00
Author: https://github.com/MaxWipfli
Commit: 9b8f35259c
Pull-request: https://github.com/SerenityOS/serenity/pull/8320
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/awesomekling
10 changed files with 14 additions and 66 deletions
|
@ -97,20 +97,15 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
LexicalPath target_path(String::formatted("{}/{}", target_directory, file_template));
|
||||
if (!target_path.is_valid()) {
|
||||
if (!quiet)
|
||||
warnln("Invalid template path {}", target_path.string().characters());
|
||||
return 1;
|
||||
}
|
||||
auto target_path = LexicalPath::join(target_directory, file_template).string();
|
||||
|
||||
char* final_path = make_temp(target_path.string().characters(), create_directory, dry_run);
|
||||
char* final_path = make_temp(target_path.characters(), create_directory, dry_run);
|
||||
if (!final_path) {
|
||||
if (!quiet) {
|
||||
if (create_directory)
|
||||
warnln("Failed to create directory via template {}", target_path.string().characters());
|
||||
warnln("Failed to create directory via template {}", target_path.characters());
|
||||
else
|
||||
warnln("Failed to create file via template {}", target_path.string().characters());
|
||||
warnln("Failed to create file via template {}", target_path.characters());
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue