brk_rolldown_std_utils 0.6.0

Standard library utilities for Rolldown
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::path::PathBuf;

pub trait PathBufExt {
  fn expect_into_string(self) -> String;
}

impl PathBufExt for std::path::PathBuf {
  fn expect_into_string(self) -> String {
    self.into_os_string().into_string().unwrap_or_else(|input| {
      panic!("Failed to convert {:?} to valid utf8 string", PathBuf::from(input).display());
    })
  }
}