rollup merge of #23738: alexcrichton/snapshots
Conflicts: src/libcollections/vec.rs
This commit is contained in:
commit
956c2eb257
29 changed files with 25 additions and 1166 deletions
|
@ -1218,16 +1218,6 @@ impl Json {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl<'a> Index<&'a str> for Json {
|
||||
type Output = Json;
|
||||
|
||||
fn index(&self, idx: & &str) -> &Json {
|
||||
self.find(*idx).unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))]
|
||||
impl<'a> Index<&'a str> for Json {
|
||||
type Output = Json;
|
||||
|
||||
|
@ -1236,19 +1226,6 @@ impl<'a> Index<&'a str> for Json {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl Index<uint> for Json {
|
||||
type Output = Json;
|
||||
|
||||
fn index<'a>(&'a self, idx: &uint) -> &'a Json {
|
||||
match self {
|
||||
&Json::Array(ref v) => &v[*idx],
|
||||
_ => panic!("can only index Json with uint if it is an array")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))]
|
||||
impl Index<uint> for Json {
|
||||
type Output = Json;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue