Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit d48e1df

Browse files
committed
Fix format and clippy warnings
1 parent 4e9164d commit d48e1df

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

src/bin/cargo-semver.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,8 @@ pub struct WorkInfo<'a> {
429429
impl<'a> WorkInfo<'a> {
430430
/// Construct a package/workspace pair for the `manifest_path`
431431
pub fn local(config: &'a cargo::Config, manifest_path: &Path) -> Result<WorkInfo<'a>> {
432-
let workspace = Workspace::new(&manifest_path, config)?;
433-
let package = workspace.load(&manifest_path)?;
432+
let workspace = Workspace::new(manifest_path, config)?;
433+
let package = workspace.load(manifest_path)?;
434434
Ok(Self { package, workspace })
435435
}
436436

@@ -441,7 +441,7 @@ impl<'a> WorkInfo<'a> {
441441
&PackageNameAndVersion { name, version }: &PackageNameAndVersion,
442442
) -> Result<WorkInfo<'a>> {
443443
let source = {
444-
let source_id = SourceId::crates_io(&config)?;
444+
let source_id = SourceId::crates_io(config)?;
445445
let mut source = RegistrySource::remote(source_id, &HashSet::new(), config);
446446

447447
debug!("source id loaded: {:?}", source_id);

src/changes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ impl<'a> Serialize for RPathChanges<'a> {
11821182
let mut seq = serializer.serialize_seq(Some(self.1.len()))?;
11831183

11841184
for e in &self.1 {
1185-
seq.serialize_element(&RPathChange(self.0, &e))?;
1185+
seq.serialize_element(&RPathChange(self.0, e))?;
11861186
}
11871187

11881188
seq.end()

src/mismatch.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,12 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> {
198198
None
199199
}
200200
(&TyKind::RawPtr(a_mt), &TyKind::RawPtr(b_mt)) => {
201-
let _ = ty::relate::relate_type_and_mut(self, a_mt, b_mt, ty::VarianceDiagMutKind::RawPtr)?;
201+
let _ = ty::relate::relate_type_and_mut(
202+
self,
203+
a_mt,
204+
b_mt,
205+
ty::VarianceDiagMutKind::RawPtr,
206+
)?;
202207
None
203208
}
204209
(&TyKind::Ref(a_r, a_ty, _), &TyKind::Ref(b_r, b_ty, _)) => {

src/translate.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
311311
debug!("translating type param: {:?}", param);
312312
let type_param = self.id_mapping.get_type_param(&target_def_id);
313313
debug!("translated type param: {:?}", type_param);
314-
match self.tcx.mk_param_from_def(&type_param).unpack() {
314+
match self.tcx.mk_param_from_def(type_param).unpack() {
315315
GenericArgKind::Type(param_t) => param_t,
316316
_ => unreachable!(),
317317
}
@@ -366,7 +366,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
366366

367367
/// Translate an item's type.
368368
pub fn translate_item_type(&self, orig_def_id: DefId, orig: Ty<'tcx>) -> Ty<'tcx> {
369-
self.translate(&self.construct_index_map(orig_def_id), &orig)
369+
self.translate(&self.construct_index_map(orig_def_id), orig)
370370
}
371371

372372
/// Translate a predicate using a type parameter index map.
@@ -420,7 +420,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
420420
substs: target_substs,
421421
item_def_id: target_def_id,
422422
},
423-
ty: self.translate(index_map, &pred.ty),
423+
ty: self.translate(index_map, pred.ty),
424424
}
425425
} else {
426426
return None;
@@ -434,7 +434,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
434434
}
435435
PredicateKind::ClosureKind(did, substs, kind) => PredicateKind::ClosureKind(
436436
self.translate_orig(did),
437-
self.translate(index_map, &substs),
437+
self.translate(index_map, substs),
438438
kind,
439439
),
440440
PredicateKind::Subtype(pred) => PredicateKind::Subtype({
@@ -459,8 +459,8 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
459459
}
460460
}
461461
PredicateKind::ConstEquate(c1, c2) => PredicateKind::ConstEquate(
462-
self.translate(index_map, &c1),
463-
self.translate(index_map, &c2),
462+
self.translate(index_map, c1),
463+
self.translate(index_map, c2),
464464
),
465465
// NOTE: Only used for Chalk trait solver
466466
PredicateKind::TypeWellFormedFromEnv(_) => unimplemented!(),
@@ -513,7 +513,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
513513
let index_map = self.construct_index_map(orig_def_id);
514514
TraitRef {
515515
def_id: self.translate_orig(orig_trait_ref.def_id),
516-
substs: self.translate(&index_map, &orig_trait_ref.substs),
516+
substs: self.translate(&index_map, orig_trait_ref.substs),
517517
}
518518
}
519519

0 commit comments

Comments
 (0)