Refactor: inline core_io

* Extract the minimal set of definitions from `core_io` to `relibc` itself

* Remove dependency on `core_io`
This commit is contained in:
Arthur Paulino
2023-12-24 17:06:27 -03:00
parent 0f9aca12dd
commit d4eddbf42e
17 changed files with 4741 additions and 46 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
use super::{fseek_locked, ftell_locked, FILE, SEEK_SET};
use crate::{core_io::Read, platform::types::off_t};
use crate::{io::Read, platform::types::off_t};
struct LookAheadBuffer {
buf: *const u8,
pos: isize,
+4 -4
View File
@@ -73,13 +73,13 @@ pub trait Pending {
fn pending(&self) -> size_t;
}
impl<W: core_io::Write> Pending for BufWriter<W> {
impl<W: crate::io::Write> Pending for BufWriter<W> {
fn pending(&self) -> size_t {
self.buf.len() as size_t
}
}
impl<W: core_io::Write> Pending for LineWriter<W> {
impl<W: crate::io::Write> Pending for LineWriter<W> {
fn pending(&self) -> size_t {
self.inner.buf.len() as size_t
}
@@ -89,12 +89,12 @@ pub trait Writer: Write + Pending {
fn purge(&mut self);
}
impl<W: core_io::Write> Writer for BufWriter<W> {
impl<W: crate::io::Write> Writer for BufWriter<W> {
fn purge(&mut self) {
self.buf.clear();
}
}
impl<W: core_io::Write> Writer for LineWriter<W> {
impl<W: crate::io::Write> Writer for LineWriter<W> {
fn purge(&mut self) {
self.inner.buf.clear();
}