Skip to content

Commit

Permalink
format: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
eonm-pro committed Sep 7, 2021
1 parent bf57909 commit b668539
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions py-apify-macro/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub fn gen_error() -> TokenStream2 {
match self {
PyApifyError::HookFunctionNotFound(file_name) =>
write!(f, "Failed to call the `call` function inside your Python file {}. Your python file must contain a `call` function", file_name),
PyApifyError::HookFunctionFailure(error_message) =>
PyApifyError::HookFunctionFailure(error_message) =>
write!(f, "The hook function returned an error : {}", error_message),
PyApifyError::InvalidArguments =>
write!(f, "Invalid arguments")
Expand All @@ -51,7 +51,7 @@ pub fn gen_error() -> TokenStream2 {
Self::InvalidArguments => Status::BadRequest,
_ => Status::InternalServerError,
};

Response::build()
.header(ContentType::JSON)
.status(status)
Expand All @@ -60,4 +60,4 @@ pub fn gen_error() -> TokenStream2 {
}
}
}
}
}
2 changes: 1 addition & 1 deletion py-apify-macro/src/file_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl<'a> From<&'a PythonFile> for PythonFileLoader {
std::fs::canonicalize(&python_file.path)
.unwrap()
.to_str()
.unwrap()
.unwrap(),
),
module_name: Literal::string(&python_file.uuid),
file_name: Literal::string(&python_file.file_name),
Expand Down
2 changes: 0 additions & 2 deletions py-apify-macro/src/py_arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,5 @@ pub fn get_func_args(py_code: String, func_name: &str) -> Vec<PyArg> {
});
}

// println!("{:#?}", program);

args
}
3 changes: 2 additions & 1 deletion py-apify-macro/src/request_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ impl From<&PythonFile> for RouteAttribute {

impl From<RouteAttribute> for TokenStream2 {
fn from(route_attribute: RouteAttribute) -> Self {
let route_attribute = Literal::string(&format!("/{}?<query..>", route_attribute.route_name));
let route_attribute =
Literal::string(&format!("/{}?<query..>", route_attribute.route_name));

quote! {
#[get(#route_attribute)]
Expand Down

0 comments on commit b668539

Please sign in to comment.