withFileName method

Path withFileName(
  1. String fileName
)

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

Implementation

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