Skip to content

Commit 2429b3a

Browse files
committed
Upgrade to 2018 edition, MSRV 1.31
1 parent 969fde3 commit 2429b3a

File tree

4 files changed

+20
-27
lines changed

4 files changed

+20
-27
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ version: 2
2222
jobs:
2323
build:
2424
docker:
25-
- image: rust:1.19.0
25+
- image: rust:1.31.0
2626
working_directory: ~/build
2727
environment:
2828
RUSTFLAGS: -D warnings

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ license = "MIT OR Apache-2.0"
66
description = "Streaming iterators"
77
repository = "https://github.com/sfackler/streaming-iterator"
88
readme = "README.md"
9+
edition = "2018"
10+
rust-version = "1.31"
911

1012
[package.metadata.docs.rs]
1113
features = ["std"]

src/lib.rs

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,21 @@
3838
//! just a required `next` method, operations like `filter` would be impossible to define.
3939
#![doc(html_root_url = "https://docs.rs/streaming-iterator/0.1")]
4040
#![warn(missing_docs)]
41-
// for compatibility down to Rust 1.19 (`dyn` needs 1.27)
42-
#![allow(unknown_lints, bare_trait_objects)]
4341
#![cfg_attr(not(feature = "std"), no_std)]
4442

45-
#[cfg(feature = "std")]
46-
extern crate core;
47-
4843
use core::cmp;
4944

5045
mod sources;
51-
pub use sources::{convert, Convert};
52-
pub use sources::{convert_mut, ConvertMut};
53-
pub use sources::{convert_ref, ConvertRef};
54-
pub use sources::{empty, Empty};
55-
pub use sources::{from_fn, FromFn};
56-
pub use sources::{once, Once};
57-
pub use sources::{once_with, OnceWith};
58-
pub use sources::{repeat, Repeat};
59-
pub use sources::{repeat_with, RepeatWith};
60-
pub use sources::{successors, Successors};
46+
pub use crate::sources::{convert, Convert};
47+
pub use crate::sources::{convert_mut, ConvertMut};
48+
pub use crate::sources::{convert_ref, ConvertRef};
49+
pub use crate::sources::{empty, Empty};
50+
pub use crate::sources::{from_fn, FromFn};
51+
pub use crate::sources::{once, Once};
52+
pub use crate::sources::{once_with, OnceWith};
53+
pub use crate::sources::{repeat, Repeat};
54+
pub use crate::sources::{repeat_with, RepeatWith};
55+
pub use crate::sources::{successors, Successors};
6156

6257
/// An interface for dealing with streaming iterators.
6358
pub trait StreamingIterator {
@@ -692,7 +687,7 @@ where
692687

693688
#[inline]
694689
fn advance(&mut self) {
695-
use ChainState::*;
690+
use crate::ChainState::*;
696691

697692
match self.state {
698693
BothForward | BothBackward => {
@@ -711,7 +706,7 @@ where
711706

712707
#[inline]
713708
fn is_done(&self) -> bool {
714-
use ChainState::*;
709+
use crate::ChainState::*;
715710

716711
match self.state {
717712
BothForward | Front => self.a.is_done(),
@@ -721,7 +716,7 @@ where
721716

722717
#[inline]
723718
fn get(&self) -> Option<&Self::Item> {
724-
use ChainState::*;
719+
use crate::ChainState::*;
725720

726721
match self.state {
727722
BothForward | Front => self.a.get(),
@@ -755,7 +750,7 @@ where
755750
{
756751
#[inline]
757752
fn advance_back(&mut self) {
758-
use ChainState::*;
753+
use crate::ChainState::*;
759754

760755
match self.state {
761756
BothForward | BothBackward => {
@@ -798,7 +793,7 @@ where
798793
{
799794
#[inline]
800795
fn get_mut(&mut self) -> Option<&mut Self::Item> {
801-
use ChainState::*;
796+
use crate::ChainState::*;
802797

803798
match self.state {
804799
BothForward | Front => self.a.get_mut(),
@@ -2596,11 +2591,9 @@ mod test {
25962591
test(it.clone().take_while(|&i| i < 5), &[0, 1, 2, 3]);
25972592
}
25982593

2599-
#[allow(bare_trait_objects, unknown_lints)]
2600-
fn _is_object_safe(_: &StreamingIterator<Item = ()>) {}
2594+
fn _is_object_safe(_: &dyn StreamingIterator<Item = ()>) {}
26012595

2602-
#[allow(bare_trait_objects, unknown_lints)]
2603-
fn _is_object_safe_mut(_: &StreamingIteratorMut<Item = ()>) {}
2596+
fn _is_object_safe_mut(_: &dyn StreamingIteratorMut<Item = ()>) {}
26042597

26052598
#[test]
26062599
fn empty_iterator() {

src/sources.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ where
304304
pub struct ConvertRef<'a, I, T: ?Sized>
305305
where
306306
I: Iterator<Item = &'a T>,
307-
T: 'a,
308307
{
309308
it: I,
310309
item: Option<&'a T>,
@@ -370,7 +369,6 @@ where
370369
pub struct ConvertMut<'a, I, T: ?Sized>
371370
where
372371
I: Iterator<Item = &'a mut T>,
373-
T: 'a,
374372
{
375373
it: I,
376374
item: Option<&'a mut T>,

0 commit comments

Comments
 (0)