Skip to content

Commit

Permalink
Fix code formatting in plume-models
Browse files Browse the repository at this point in the history
  • Loading branch information
Atul9 committed Mar 20, 2019
1 parent 6c4790d commit a73c2cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions plume-models/src/follows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ pub struct NewFollow {
}

impl Follow {
insert!(follows, NewFollow, |inserted, conn| {
if inserted.ap_url.is_empty() {
insert!(
follows,
NewFollow,
|inserted, conn| if inserted.ap_url.is_empty() {
inserted.ap_url = ap_url(&format!("{}/follows/{}", *BASE_URL, inserted.id));
inserted.save_changes(conn).map_err(Error::from)
} else {
Ok(inserted)
}
});
);
get!(follows);
find_by!(follows, find_by_ap_url, ap_url as &str);

Expand Down
2 changes: 1 addition & 1 deletion plume-models/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ macro_rules! get {
/// ```
macro_rules! insert {
($table:ident, $from:ident) => {
insert!($table, $from, |x, _conn| { Ok(x) });
insert!($table, $from, |x, _conn| Ok(x));
};
($table:ident, $from:ident, |$val:ident, $conn:ident | $after:block) => {
last!($table);
Expand Down

0 comments on commit a73c2cf

Please sign in to comment.