xref: /third_party/rust/crates/cxx/gen/cmd/src/output.rs (revision 33d722a9)
1use std::path::PathBuf;
2
3#[derive(Debug)]
4pub(crate) enum Output {
5    Stdout,
6    File(PathBuf),
7}
8
9impl Output {
10    pub(crate) fn ends_with(&self, suffix: &str) -> bool {
11        match self {
12            Output::Stdout => false,
13            Output::File(path) => path.to_string_lossy().ends_with(suffix),
14        }
15    }
16}
17