diff options
| author | Christiaan Dirkx <christiaan@dirkx.email> | 2021-04-28 15:44:13 +0200 |
|---|---|---|
| committer | Christiaan Dirkx <christiaan@dirkx.email> | 2021-04-28 16:14:03 +0200 |
| commit | 45bc1930cae22b8b08adc9bb5ed4a494831d6678 (patch) | |
| tree | fd54e63cc73d4aa6035f38761d51a7486688a409 /library/std/src/sys | |
| parent | fab841080157b0ddc6e0a0d88c4b3fc43d32f147 (diff) | |
| download | rust-45bc1930cae22b8b08adc9bb5ed4a494831d6678.tar.gz rust-45bc1930cae22b8b08adc9bb5ed4a494831d6678.zip | |
Reuse `unsupported::args` on `wasm`
Diffstat (limited to 'library/std/src/sys')
| -rw-r--r-- | library/std/src/sys/wasm/args.rs | 42 | ||||
| -rw-r--r-- | library/std/src/sys/wasm/mod.rs | 1 |
2 files changed, 1 insertions, 42 deletions
diff --git a/library/std/src/sys/wasm/args.rs b/library/std/src/sys/wasm/args.rs deleted file mode 100644 index fde1ab79e1f..00000000000 --- a/library/std/src/sys/wasm/args.rs +++ /dev/null @@ -1,42 +0,0 @@ -use crate::ffi::OsString; -use crate::fmt; -use crate::vec; - -pub fn args() -> Args { - Args { iter: Vec::new().into_iter() } -} - -pub struct Args { - iter: vec::IntoIter<OsString>, -} - -impl !Send for Args {} -impl !Sync for Args {} - -impl fmt::Debug for Args { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.iter.as_slice().fmt(f) - } -} - -impl Iterator for Args { - type Item = OsString; - fn next(&mut self) -> Option<OsString> { - self.iter.next() - } - fn size_hint(&self) -> (usize, Option<usize>) { - self.iter.size_hint() - } -} - -impl ExactSizeIterator for Args { - fn len(&self) -> usize { - self.iter.len() - } -} - -impl DoubleEndedIterator for Args { - fn next_back(&mut self) -> Option<OsString> { - self.iter.next_back() - } -} diff --git a/library/std/src/sys/wasm/mod.rs b/library/std/src/sys/wasm/mod.rs index 0bd2c0d0f9d..18d8ea183f7 100644 --- a/library/std/src/sys/wasm/mod.rs +++ b/library/std/src/sys/wasm/mod.rs @@ -17,6 +17,7 @@ #![deny(unsafe_op_in_unsafe_fn)] pub mod alloc; +#[path = "../unsupported/args.rs"] pub mod args; #[path = "../unsupported/cmath.rs"] pub mod cmath; |
