Skip to content

Commit 683cd9f

Browse files
committed
cargo fmt
1 parent a947ff2 commit 683cd9f

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

src/controllers/krate/owners.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ fn modify_owners(req: &mut dyn Request, add: bool) -> AppResult<Response> {
104104
Rights::Full => {}
105105
// Yes!
106106
Rights::Publish => {
107-
return Err(cargo_err("team members don't have permission to modify owners"));
107+
return Err(cargo_err(
108+
"team members don't have permission to modify owners",
109+
));
108110
}
109111
Rights::None => {
110112
return Err(cargo_err("only owners have permission to modify owners"));

src/github.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use serde::de::DeserializeOwned;
88
use std::str;
99

1010
use crate::app::App;
11-
use crate::util::{errors::NotFound, cargo_err, internal, AppError, AppResult};
11+
use crate::util::{cargo_err, errors::NotFound, internal, AppError, AppResult};
1212

1313
/// Does all the nonsense for sending a GET to Github. Doesn't handle parsing
1414
/// because custom error-code handling may be desirable. Use

src/models/krate.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,9 @@ impl<'a> NewCrate<'a> {
148148
}
149149

150150
// Ensure the entire URL parses as well
151-
Url::parse(url)
152-
.map_err(|_| cargo_err(&format_args!("`{}` is not a valid url: `{}`", field, url)))?;
151+
Url::parse(url).map_err(|_| {
152+
cargo_err(&format_args!("`{}` is not a valid url: `{}`", field, url))
153+
})?;
153154
Ok(())
154155
}
155156

src/models/team.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use diesel::prelude::*;
22

33
use crate::app::App;
44
use crate::github::{github_api, team_url};
5-
use crate::util::{errors::NotFound, cargo_err, AppResult};
5+
use crate::util::{cargo_err, errors::NotFound, AppResult};
66

77
use oauth2::{prelude::*, AccessToken};
88

src/router.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,10 @@ mod tests {
207207
assert_eq!(C(|_| err(NotFound)).call(&mut req).unwrap().status.0, 404);
208208

209209
// cargo_err errors are returned as 200 so that cargo displays this nicely on the command line
210-
assert_eq!(C(|_| Err(cargo_err(""))).call(&mut req).unwrap().status.0, 200);
210+
assert_eq!(
211+
C(|_| Err(cargo_err(""))).call(&mut req).unwrap().status.0,
212+
200
213+
);
211214

212215
// All other error types are propogated up the middleware, eventually becoming status 500
213216
assert!(C(|_| Err(internal(""))).call(&mut req).is_err());

0 commit comments

Comments
 (0)