From 87ccf7f4cc96c47745e13ee623c67fe403f3557d Mon Sep 17 00:00:00 2001 From: Nils Husung Date: Tue, 25 Jun 2024 16:26:09 +0200 Subject: [PATCH] Replace accidentally platform-specific file extension check --- crates/oxidd-parser/src/load_file.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/oxidd-parser/src/load_file.rs b/crates/oxidd-parser/src/load_file.rs index 6af9fe1..4c040b3 100644 --- a/crates/oxidd-parser/src/load_file.rs +++ b/crates/oxidd-parser/src/load_file.rs @@ -3,7 +3,6 @@ // spell-checker:ignore termcolor use std::fmt; -use std::os::unix::ffi::OsStrExt; use std::path::Path; use codespan_reporting::diagnostic::{Diagnostic, Label}; @@ -39,7 +38,7 @@ impl FileType { /// Guess the file type based on the given path pub fn from_path(path: &Path) -> Option { let ext = path.extension()?; - match ext.as_bytes() { + match ext.as_encoded_bytes() { b"cnf" | b"sat" | b"dimacs" => Some(FileType::DIMACS), b"aag" | b"aig" => Some(FileType::AIGER), _ => None,