fix clippy #42

Merged
ben merged 4 commits from ben/Jobboerse:main into main 2023-01-28 20:40:42 +01:00
3 changed files with 4 additions and 4 deletions
Showing only changes of commit e53a6ae659 - Show all commits

fix clippy for rust 1.67

- still compatible with 1.64
Bennet Bleßmann 2023-01-28 20:33:37 +01:00 committed by Bennet Bleßmann
Signed by: ben
GPG key ID: 3BE1A1A3CBC3CF99

View file

@ -568,7 +568,7 @@ impl JobOffer<PathBuf> {
req: &HttpRequest, req: &HttpRequest,
) -> Result<Url, UrlGenerationError> { ) -> Result<Url, UrlGenerationError> {
let mut url = req.url_for_static(JOBOFFER_OVERVIEW_ROUTE)?; let mut url = req.url_for_static(JOBOFFER_OVERVIEW_ROUTE)?;
url.set_fragment(Some(&format!("joboffer-{}", id))); url.set_fragment(Some(&format!("joboffer-{id}")));
Ok(url) Ok(url)
} }
@ -960,7 +960,7 @@ mod test {
let serialized = toml::ser::to_string_pretty(&old) let serialized = toml::ser::to_string_pretty(&old)
.expect("testing serialization is not the goal of this test"); .expect("testing serialization is not the goal of this test");
println!("{}", serialized); println!("{serialized}");
toml::de::from_str::<JobOfferStatus>(&serialized).expect_err( toml::de::from_str::<JobOfferStatus>(&serialized).expect_err(
"V1 should not parse as current, this will prevent migration from applying", "V1 should not parse as current, this will prevent migration from applying",

View file

@ -140,7 +140,7 @@ pub(crate) fn bad_request<B>(
} }
SubmissionResponseError::Form(FormProcessingError::MultiPart(mpe)|FormProcessingError::Field(MultipartFieldError::Multipart(mpe))) => { SubmissionResponseError::Form(FormProcessingError::MultiPart(mpe)|FormProcessingError::Field(MultipartFieldError::Multipart(mpe))) => {
warn!("{}", mpe); warn!("{}", mpe);
msg = format!("{}", mpe); msg = format!("{mpe}");
Some(msg.as_str()) Some(msg.as_str())
} }
SubmissionResponseError::Form(FormProcessingError::Field(MultipartFieldError::NotAFile { field })) => { SubmissionResponseError::Form(FormProcessingError::Field(MultipartFieldError::NotAFile { field })) => {

View file

@ -146,7 +146,7 @@ pub(crate) fn parse_datetime(
None | Some("") => None, None | Some("") => None,
Some(backdate) => { Some(backdate) => {
// toml currently requires time to include seconds, but the html field does not include them, so we just add them here // toml currently requires time to include seconds, but the html field does not include them, so we just add them here
let backdate_with_sec = format!("{}:00", backdate); let backdate_with_sec = format!("{backdate}:00");
Some(better_toml_datetime::Datetime::from_str( Some(better_toml_datetime::Datetime::from_str(
&backdate_with_sec, &backdate_with_sec,
)?) )?)