Skip to content

Commit

Permalink
refactor: clean up elided lifetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Oct 22, 2024
1 parent 2a7f039 commit ff0d215
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ impl PartialEq for dyn CacheKey + '_ {

impl Eq for dyn CacheKey + '_ {}

impl<'a> CacheKey for (u64, &'a Path) {
impl CacheKey for (u64, &Path) {
fn tuple(&self) -> (u64, &Path) {
(self.0, self.1)
}
Expand Down
10 changes: 5 additions & 5 deletions src/package_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl PackageJson {
pub(crate) fn main_fields<'a>(
&'a self,
main_fields: &'a [String],
) -> impl Iterator<Item = &'a str> + '_ {
) -> impl Iterator<Item = &'a str> + 'a {
main_fields
.iter()
.filter_map(|main_field| self.raw_json.get(main_field))
Expand All @@ -139,7 +139,7 @@ impl PackageJson {
pub(crate) fn exports_fields<'a>(
&'a self,
exports_fields: &'a [Vec<String>],
) -> impl Iterator<Item = &'a JSONValue> + '_ {
) -> impl Iterator<Item = &'a JSONValue> + 'a {
exports_fields.iter().filter_map(|object_path| {
self.raw_json
.as_object()
Expand All @@ -153,7 +153,7 @@ impl PackageJson {
pub(crate) fn imports_fields<'a>(
&'a self,
imports_fields: &'a [Vec<String>],
) -> impl Iterator<Item = &'a JSONMap> + '_ {
) -> impl Iterator<Item = &'a JSONMap> + 'a {
imports_fields.iter().filter_map(|object_path| {
self.raw_json
.as_object()
Expand All @@ -169,7 +169,7 @@ impl PackageJson {
fn browser_fields<'a>(
&'a self,
alias_fields: &'a [Vec<String>],
) -> impl Iterator<Item = &'a JSONMap> + '_ {
) -> impl Iterator<Item = &'a JSONMap> + 'a {
alias_fields.iter().filter_map(|object_path| {
self.raw_json
.as_object()
Expand All @@ -190,7 +190,7 @@ impl PackageJson {
path: &Path,
request: Option<&str>,
alias_fields: &'a [Vec<String>],
) -> Result<Option<&str>, ResolveError> {
) -> Result<Option<&'a str>, ResolveError> {
for object in self.browser_fields(alias_fields) {
if let Some(request) = request {
if let Some(value) = object.get(request) {
Expand Down
2 changes: 1 addition & 1 deletion src/specifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl<'a> Specifier<'a> {
fn parse_query_framgment(
specifier: &'a str,
skip: usize,
) -> (Cow<'a, str>, Option<&str>, Option<&str>) {
) -> (Cow<'a, str>, Option<&'a str>, Option<&'a str>) {
let mut query_start: Option<usize> = None;
let mut fragment_start: Option<usize> = None;

Expand Down

0 comments on commit ff0d215

Please # to comment.