Skip to content

Commit

Permalink
fixup! open_file_roにdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip committed Sep 18, 2024
1 parent 32be19f commit 752aedb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/voicevox_core/src/asyncs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ use futures_util::ready;
pub(crate) trait Async: 'static {
type Mutex<T: Send + Sync + Unpin>: Mutex<T>;
type RoFile: AsyncRead + AsyncSeek + Send + Sync + Unpin;

/// ファイルを読み取り専用(RO)で開く。
///
/// `io::Error`は素(`i32`相当)のままにしておき、この関数を呼び出す側でfs-err風のメッセージを付
/// ける。
async fn open_file_ro(path: impl AsRef<Path>) -> io::Result<Self::RoFile>;
}

Expand All @@ -51,10 +56,6 @@ impl Async for SingleTasked {
type Mutex<T: Send + Sync + Unpin> = StdMutex<T>;
type RoFile = StdFile;

/// ファイルを読み取り専用(RO)で開く。
///
/// `io::Error`は素(`i32`相当)のままにしておき、この関数を呼び出す側でfs-err風のメッセージを付
/// ける。
async fn open_file_ro(path: impl AsRef<Path>) -> io::Result<Self::RoFile> {
std::fs::File::open(path).map(StdFile)
}
Expand Down

0 comments on commit 752aedb

Please sign in to comment.