@@ -1,7 +1,7 @@
1use std::convert::TryFrom;
1use std::convert::TryFrom;
2−use std::ffi::{OsStr, OsString};
3use std::fs::File;
2use std::fs::File;
4use std::io::{self, BufRead, BufReader, Read};
3use std::io::{self, BufRead, BufReader, Read};
4+use std::path::{Path, PathBuf};
6use clircle::{Clircle, Identifier};
6use clircle::{Clircle, Identifier};
7use content_inspector::{self, ContentType};
7use content_inspector::{self, ContentType};
@@ -69,7 +69,7 @@ impl InputDescription {
71pub(crate) enum InputKind<'a> {
71pub(crate) enum InputKind<'a> {
72− OrdinaryFile(OsString),
72+ OrdinaryFile(PathBuf),
74 CustomReader(Box<dyn Read + 'a>),
74 CustomReader(Box<dyn Read + 'a>),
@@ -86,7 +86,7 @@ impl<'a> InputKind<'a> {
87#[derive(Clone, Default)]
87#[derive(Clone, Default)]
88pub(crate) struct InputMetadata {
88pub(crate) struct InputMetadata {
89− pub(crate) user_provided_name: Option<OsString>,
89+ pub(crate) user_provided_name: Option<PathBuf>,
92pub struct Input<'a> {
92pub struct Input<'a> {
@@ -96,7 +96,7 @@ pub struct Input<'a> {
98pub(crate) enum OpenedInputKind {
98pub(crate) enum OpenedInputKind {
99− OrdinaryFile(OsString),
99+ OrdinaryFile(PathBuf),
101 CustomReader,
101 CustomReader,
@@ -109,8 +109,11 @@ pub(crate) struct OpenedInput<'a> {
111impl<'a> Input<'a> {
111impl<'a> Input<'a> {
112− pub fn ordinary_file(path: &OsStr) -> Self {
112+ pub fn ordinary_file(path: impl AsRef<Path>) -> Self {
113+ Self::_ordinary_file(path.as_ref())
115+ fn _ordinary_file(path: &Path) -> Self {
113− let kind = InputKind::OrdinaryFile(path.to_os_string());
116+ let kind = InputKind::OrdinaryFile(path.to_path_buf());
115 description: kind.description(),
118 description: kind.description(),
116 metadata: InputMetadata::default(),
119 metadata: InputMetadata::default(),
@@ -140,7 +143,10 @@ impl<'a> Input<'a> {
140 matches!(self.kind, InputKind::StdIn)
143 matches!(self.kind, InputKind::StdIn)
143− pub fn with_name(mut self, provided_name: Option<&OsStr>) -> Self {
146+ pub fn with_name(mut self, provided_name: Option<impl AsRef<Path>>) -> Self {
147+ self._with_name(provided_name.as_ref().map(|it| it.as_ref()))
149+ pub fn _with_name(mut self, provided_name: Option<&Path>) -> Self {
144 if let Some(name) = provided_name {
150 if let Some(name) = provided_name {
145 self.description.name = name.to_string_lossy().to_string()
151 self.description.name = name.to_string_lossy().to_string()