Delete io write function
This commit is contained in:
parent
9cf53f1083
commit
f90632b9db
14
src/lib.rs
14
src/lib.rs
|
@ -53,25 +53,13 @@
|
||||||
mod udiv128;
|
mod udiv128;
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
use std::{io, mem, ptr, slice, str};
|
use std::{mem, ptr, slice, str};
|
||||||
|
|
||||||
#[cfg(not(feature = "std"))]
|
#[cfg(not(feature = "std"))]
|
||||||
use core::{mem, ptr, slice, str};
|
use core::{mem, ptr, slice, str};
|
||||||
|
|
||||||
use self::mem::MaybeUninit;
|
use self::mem::MaybeUninit;
|
||||||
|
|
||||||
/// Write integer to an `io::Write`.
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
#[inline]
|
|
||||||
pub fn write<W: io::Write, V: Integer>(mut wr: W, value: V) -> io::Result<usize> {
|
|
||||||
let mut buf = Buffer::new();
|
|
||||||
let s = buf.format(value);
|
|
||||||
match wr.write_all(s.as_bytes()) {
|
|
||||||
Ok(()) => Ok(s.len()),
|
|
||||||
Err(e) => Err(e),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// A safe API for formatting integers to text.
|
/// A safe API for formatting integers to text.
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
|
|
Loading…
Reference in New Issue