withFileName method

WindowsPath withFileName(
  1. String fileName
)

Creates an PathBuf like this but with the given file name.

Implementation

WindowsPath withFileName(String fileName) {
  final parentOption = parent();
  return switch (parentOption) {
    None => WindowsPath(fileName),
    // ignore: pattern_never_matches_value_type
    Some(:final v) => v.join(WindowsPath(fileName)),
  };
}