Skip to content

Commit 8db7e19

Browse files
committed
Update to rust master
1 parent be8b8b8 commit 8db7e19

File tree

7 files changed

+67
-62
lines changed

7 files changed

+67
-62
lines changed

Cargo.lock

Lines changed: 56 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ postgres = "0.4"
4747
curl = "0.1.0"
4848
oauth2 = "0.1.0"
4949
log = "0.1.0"
50-
rustc-serialize = "0.1"
50+
rustc-serialize = "0.2"
5151

5252
conduit-conditional-get = "0.5.0"
5353
conduit-cookie = "0.1.0"

src/git.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fn index_file(base: &Path, name: &str) -> Path {
127127
}
128128

129129
pub fn add_crate(app: &App, krate: &Crate) -> CargoResult<()> {
130-
let repo = app.git_repo.lock();
130+
let repo = app.git_repo.lock().unwrap();
131131
let repo = &*repo;
132132
let repo_path = repo.path().dir_path();
133133
let dst = index_file(&repo_path, krate.name.as_slice());
@@ -151,7 +151,7 @@ pub fn add_crate(app: &App, krate: &Crate) -> CargoResult<()> {
151151

152152
pub fn yank(app: &App, krate: &str, version: &semver::Version,
153153
yanked: bool) -> CargoResult<()> {
154-
let repo = app.git_repo.lock();
154+
let repo = app.git_repo.lock().unwrap();
155155
let repo = &*repo;
156156
let repo_path = repo.path().dir_path();
157157
let dst = index_file(&repo_path, krate);
@@ -237,7 +237,7 @@ fn commit_and_push(repo: &git2::Repository,
237237
Err(internal("Too many rebase failures"))
238238
}
239239

240-
pub fn credentials(_user: &str, _user_from_url: Option<&str>,
240+
pub fn credentials(_user: &str, _user_from_url: &str,
241241
_cred: git2::CredentialType)
242242
-> Result<git2::Cred, git2::Error> {
243243
match (os::getenv("GIT_HTTP_USER"), os::getenv("GIT_HTTP_PWD")) {

src/krate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl Crate {
207207
match license {
208208
Some(license) => {
209209
let ok = license.split('/').all(|l| {
210-
KNOWN_LICENSES.binary_search_elem(&l.trim()).found().is_some()
210+
KNOWN_LICENSES.binary_search(&l.trim()).is_ok()
211211
});
212212
if ok {
213213
Ok(())

src/tests/all.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ fn json<T>(r: &mut conduit::Response) -> T
138138
where T: rustc_serialize::Decodable<json::Decoder, json::DecoderError> {
139139
let data = r.body.read_to_end().unwrap();
140140
let s = std::str::from_utf8(data.as_slice()).unwrap();
141-
let j = match json::from_str(s) {
141+
let j = match Json::from_str(s) {
142142
Ok(t) => t,
143143
Err(e) => panic!("failed to decode: {}\n{}", e, s),
144144
};

src/tests/version.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::collections::HashMap;
2-
use rustc_serialize::json;
2+
use rustc_serialize::json::Json;
33

44
use conduit::{Handler, Request, Method};
55
use semver;
@@ -65,7 +65,7 @@ fn authors() {
6565
::mock_crate(&mut req, ::krate("foo"));
6666
let mut response = ok_resp!(middle.call(&mut req));
6767
let s = response.body.read_to_string().unwrap();
68-
let json = json::from_str(s.as_slice()).unwrap();
68+
let json = Json::from_str(s.as_slice()).unwrap();
6969
let json = json.as_object().unwrap();
7070
assert!(json.contains_key(&"users".to_string()));
7171
}

0 commit comments

Comments
 (0)