Skip to content

Commit

Permalink
Fixes for clippy needless_lifetime warnings (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbatty authored Dec 7, 2024
1 parent f4caac4 commit 4ff1088
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
- Clippy fixes for `needless_lifetime` warnings.

## [0.24.0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl ToTokens for HeadersCode {
let headers = &self.headers;
tokens.extend(quote! {
pub struct Headers<'a>(&'a azure_core::headers::Headers);
impl<'a> Headers<'a> {
impl Headers<'_> {
#(#headers)*
}
})
Expand Down
6 changes: 3 additions & 3 deletions azure_devops_rust_api/src/dashboard/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,7 @@ pub mod widgets {
}
}
pub struct Headers<'a>(&'a azure_core::headers::Headers);
impl<'a> Headers<'a> {
impl Headers<'_> {
pub fn e_tag(&self) -> azure_core::Result<&str> {
self.0
.get_str(&azure_core::headers::HeaderName::from_static("etag"))
Expand Down Expand Up @@ -1795,7 +1795,7 @@ pub mod widgets {
}
}
pub struct Headers<'a>(&'a azure_core::headers::Headers);
impl<'a> Headers<'a> {
impl Headers<'_> {
pub fn e_tag(&self) -> azure_core::Result<&str> {
self.0
.get_str(&azure_core::headers::HeaderName::from_static("etag"))
Expand Down Expand Up @@ -1936,7 +1936,7 @@ pub mod widgets {
}
}
pub struct Headers<'a>(&'a azure_core::headers::Headers);
impl<'a> Headers<'a> {
impl Headers<'_> {
pub fn e_tag(&self) -> azure_core::Result<&str> {
self.0
.get_str(&azure_core::headers::HeaderName::from_static("etag"))
Expand Down
2 changes: 1 addition & 1 deletion azure_devops_rust_api/src/date_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub mod rfc3339 {

struct DateTimeVisitor;

impl<'de> de::Visitor<'de> for DateTimeVisitor {
impl de::Visitor<'_> for DateTimeVisitor {
type Value = OffsetDateTime;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion azure_devops_rust_api/src/git/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4660,7 +4660,7 @@ pub mod policy_configurations {
}
}
pub struct Headers<'a>(&'a azure_core::headers::Headers);
impl<'a> Headers<'a> {
impl Headers<'_> {
pub fn x_ms_continuationtoken(&self) -> azure_core::Result<&str> {
self.0
.get_str(&azure_core::headers::HeaderName::from_static(
Expand Down
6 changes: 3 additions & 3 deletions azure_devops_rust_api/src/graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ pub mod groups {
}
}
pub struct Headers<'a>(&'a azure_core::headers::Headers);
impl<'a> Headers<'a> {
impl Headers<'_> {
pub fn x_ms_continuation_token(&self) -> azure_core::Result<&str> {
self.0
.get_str(&azure_core::headers::HeaderName::from_static(
Expand Down Expand Up @@ -2118,7 +2118,7 @@ pub mod service_principals {
}
}
pub struct Headers<'a>(&'a azure_core::headers::Headers);
impl<'a> Headers<'a> {
impl Headers<'_> {
pub fn x_ms_continuation_token(&self) -> azure_core::Result<&str> {
self.0
.get_str(&azure_core::headers::HeaderName::from_static(
Expand Down Expand Up @@ -3534,7 +3534,7 @@ pub mod users {
}
}
pub struct Headers<'a>(&'a azure_core::headers::Headers);
impl<'a> Headers<'a> {
impl Headers<'_> {
pub fn x_ms_continuation_token(&self) -> azure_core::Result<&str> {
self.0
.get_str(&azure_core::headers::HeaderName::from_static(
Expand Down
2 changes: 1 addition & 1 deletion azure_devops_rust_api/src/search/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ pub mod package_search_results {
}
}
pub struct Headers<'a>(&'a azure_core::headers::Headers);
impl<'a> Headers<'a> {
impl Headers<'_> {
pub fn activity_id(&self) -> azure_core::Result<&str> {
self.0
.get_str(&azure_core::headers::HeaderName::from_static("activityid"))
Expand Down
16 changes: 8 additions & 8 deletions azure_devops_rust_api/src/wiki/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ pub mod attachments {
}
}
pub struct Headers<'a>(&'a azure_core::headers::Headers);
impl<'a> Headers<'a> {
impl Headers<'_> {
pub fn e_tag(&self) -> azure_core::Result<&str> {
self.0
.get_str(&azure_core::headers::HeaderName::from_static("etag"))
Expand Down Expand Up @@ -1143,7 +1143,7 @@ pub mod page_moves {
}
}
pub struct Headers<'a>(&'a azure_core::headers::Headers);
impl<'a> Headers<'a> {
impl Headers<'_> {
pub fn e_tag(&self) -> azure_core::Result<&str> {
self.0
.get_str(&azure_core::headers::HeaderName::from_static("etag"))
Expand Down Expand Up @@ -1503,7 +1503,7 @@ pub mod pages {
}
}
pub struct Headers<'a>(&'a azure_core::headers::Headers);
impl<'a> Headers<'a> {
impl Headers<'_> {
pub fn e_tag(&self) -> azure_core::Result<&str> {
self.0
.get_str(&azure_core::headers::HeaderName::from_static("etag"))
Expand Down Expand Up @@ -1712,7 +1712,7 @@ pub mod pages {
}
}
pub struct Headers<'a>(&'a azure_core::headers::Headers);
impl<'a> Headers<'a> {
impl Headers<'_> {
pub fn e_tag(&self) -> azure_core::Result<&str> {
self.0
.get_str(&azure_core::headers::HeaderName::from_static("etag"))
Expand Down Expand Up @@ -1908,7 +1908,7 @@ pub mod pages {
}
}
pub struct Headers<'a>(&'a azure_core::headers::Headers);
impl<'a> Headers<'a> {
impl Headers<'_> {
pub fn e_tag(&self) -> azure_core::Result<&str> {
self.0
.get_str(&azure_core::headers::HeaderName::from_static("etag"))
Expand Down Expand Up @@ -2100,7 +2100,7 @@ pub mod pages {
}
}
pub struct Headers<'a>(&'a azure_core::headers::Headers);
impl<'a> Headers<'a> {
impl Headers<'_> {
pub fn e_tag(&self) -> azure_core::Result<&str> {
self.0
.get_str(&azure_core::headers::HeaderName::from_static("etag"))
Expand Down Expand Up @@ -2252,7 +2252,7 @@ pub mod pages {
}
}
pub struct Headers<'a>(&'a azure_core::headers::Headers);
impl<'a> Headers<'a> {
impl Headers<'_> {
pub fn e_tag(&self) -> azure_core::Result<&str> {
self.0
.get_str(&azure_core::headers::HeaderName::from_static("etag"))
Expand Down Expand Up @@ -2397,7 +2397,7 @@ pub mod pages {
}
}
pub struct Headers<'a>(&'a azure_core::headers::Headers);
impl<'a> Headers<'a> {
impl Headers<'_> {
pub fn e_tag(&self) -> azure_core::Result<&str> {
self.0
.get_str(&azure_core::headers::HeaderName::from_static("etag"))
Expand Down
1 change: 0 additions & 1 deletion vsts-api-patcher/src/patcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,6 @@ impl Patcher {
let regex = regex::Regex::new(r"\s(?P<url>(http|https)://[_A-Za-z0-9/]+)").unwrap();
let patched_s = regex.replace_all(&patched_s, "<${url}>");
if patched_s != s {
format!("[patched]{}", patched_s);
println!("patch_docstring: {} => {}", s, patched_s);
}
patched_s.to_string()
Expand Down

0 comments on commit 4ff1088

Please sign in to comment.