mirror of
https://github.com/openharmony/third_party_rust_rust-std-candidates.git
synced 2026-06-30 20:47:55 -04:00
Upgrade to rustc 1.0.0-nightly (2e3b0c051 2015-04-01) (built 2015-04-02)
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
#![feature(convert)]
|
||||
|
||||
use std::env;
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
|
||||
name = "triable"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
authors = ["Simon Sapin <simon.sapin@exyr.org>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/SimonSapin/rust-std-candidates"
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
use std::error::FromError;
|
||||
use std::convert::From;
|
||||
|
||||
|
||||
#[macro_export]
|
||||
@@ -24,11 +24,11 @@ pub trait Triable<Expr, Return> {
|
||||
|
||||
|
||||
impl<T1, T2, Err1, Err2> Triable<T1, Result<T2, Err2>> for Result<T1, Err1>
|
||||
where Err2: FromError<Err1> {
|
||||
where Err2: From<Err1> {
|
||||
fn try(self) -> TriableResult<T1, Result<T2, Err2>> {
|
||||
match self {
|
||||
Ok(value) => TriableResult::Expression(value),
|
||||
Err(error) => TriableResult::EarlyReturn(Err(FromError::from_error(error)))
|
||||
Err(error) => TriableResult::EarlyReturn(Err(From::from(error)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
|
||||
name = "zip-longest"
|
||||
version = "0.1.6"
|
||||
version = "0.1.7"
|
||||
authors = ["Simon Sapin <simon.sapin@exyr.org>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/SimonSapin/rust-std-candidates"
|
||||
|
||||
+2
-2
@@ -1,4 +1,5 @@
|
||||
#![feature(core)]
|
||||
#![cfg_attr(test, feature(step_by))]
|
||||
|
||||
use std::cmp;
|
||||
use std::iter::RandomAccessIterator;
|
||||
@@ -126,9 +127,8 @@ pub enum EitherOrBoth<A, B> {
|
||||
#[test]
|
||||
fn test_iterator_size_hint() {
|
||||
use std::usize;
|
||||
use std::iter::count;
|
||||
|
||||
let c = count(0i32, 1);
|
||||
let c = (0i32..).step_by(1);
|
||||
let v: &[_] = &[0i32, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
||||
let v2 = &[10i32, 11, 12];
|
||||
let vi = v.iter();
|
||||
|
||||
Reference in New Issue
Block a user