Fix clippy::ptr_arg

This commit is contained in:
Alan Du 2019-06-04 01:51:25 -04:00
parent 4e449fb0b0
commit fafca4cb11
2 changed files with 3 additions and 3 deletions

View file

@ -44,7 +44,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
&mut self, &mut self,
id: ExprId, id: ExprId,
_path: &Option<Path>, _path: &Option<Path>,
fields: &Vec<StructLitField>, fields: &[StructLitField],
spread: &Option<ExprId>, spread: &Option<ExprId>,
db: &impl HirDatabase, db: &impl HirDatabase,
) { ) {

View file

@ -49,7 +49,7 @@ pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) {
} }
} }
fn build_import_label(name: &str, path: &Vec<SmolStr>) -> String { fn build_import_label(name: &str, path: &[SmolStr]) -> String {
let mut buf = String::with_capacity(64); let mut buf = String::with_capacity(64);
buf.push_str(name); buf.push_str(name);
buf.push_str(" ("); buf.push_str(" (");
@ -58,7 +58,7 @@ fn build_import_label(name: &str, path: &Vec<SmolStr>) -> String {
buf buf
} }
fn fmt_import_path(path: &Vec<SmolStr>, buf: &mut String) { fn fmt_import_path(path: &[SmolStr], buf: &mut String) {
let mut segments = path.iter(); let mut segments = path.iter();
if let Some(s) = segments.next() { if let Some(s) = segments.next() {
buf.push_str(&s); buf.push_str(&s);