Minor TS cleanup #429
Annotations
5 errors and 293 warnings
build (macos-latest)
Process completed with exit code 101.
|
build (windows-latest)
The job was canceled because "macos-latest" failed.
|
build (windows-latest)
The operation was canceled.
|
build (ubuntu-latest)
The job was canceled because "macos-latest" failed.
|
build (ubuntu-latest)
The operation was canceled.
|
`panic` should not be present in production code:
specta-zod/src/lib.rs#L642
warning: `panic` should not be present in production code
--> specta-zod/src/lib.rs:642:22
|
642 | _ => panic!("unhandled literal type!"),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
= note: requested on the command line with `-W clippy::panic`
|
this expression always evaluates to true:
specta-zod/src/lib.rs#L120
warning: this expression always evaluates to true
--> specta-zod/src/lib.rs:120:47
|
120 | let prefix = match start_with_newline && !comments.is_empty() {
| ^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#const_is_empty
= note: `-W clippy::const-is-empty` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::const_is_empty)]`
|
package `specta-zod` is missing `package.readme` metadata:
specta-zod/src/lib.rs#L1
warning: package `specta-zod` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-util` is missing `package.readme` metadata:
specta-zod/src/lib.rs#L1
warning: package `specta-util` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-typescript` is missing `package.readme` metadata:
specta-zod/src/lib.rs#L1
warning: package `specta-typescript` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-swift` is missing `package.readme` metadata:
specta-zod/src/lib.rs#L1
warning: package `specta-swift` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-serde` is missing `package.readme` metadata:
specta-zod/src/lib.rs#L1
warning: package `specta-serde` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-rust` is missing `package.readme` metadata:
specta-zod/src/lib.rs#L1
warning: package `specta-rust` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-openapi` is missing `package.readme` metadata:
specta-zod/src/lib.rs#L1
warning: package `specta-openapi` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-kotlin` is missing `package.readme` metadata:
specta-zod/src/lib.rs#L1
warning: package `specta-kotlin` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-go` is missing `package.readme` metadata:
specta-zod/src/lib.rs#L1
warning: package `specta-go` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-datatype-from` is missing `package.readme` metadata:
specta-zod/src/lib.rs#L1
warning: package `specta-datatype-from` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta` is missing `package.readme` metadata:
specta-zod/src/lib.rs#L1
warning: package `specta` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
= note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo`
= help: to override `-W clippy::cargo` add `#[allow(clippy::cargo_common_metadata)]`
|
lint group `cargo` has the same priority (-1) as a lint:
Cargo.toml#L11
warning: lint group `cargo` has the same priority (-1) as a lint
--> Cargo.toml:11:1
|
11 | cargo = { level = "warn", priority = -1 }
| ^^^^^
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
help: to have lints override the group set `cargo` to a lower priority
|
11 | cargo = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
lint group `all` has the same priority (-1) as a lint:
Cargo.toml#L10
warning: lint group `all` has the same priority (-1) as a lint
--> Cargo.toml:10:1
|
10 | all = { level = "warn", priority = -1 }
| ^^^
11 | cargo = { level = "warn", priority = -1 }
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
= note: `-W clippy::lint-groups-priority` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::lint_groups_priority)]`
help: to have lints override the group set `all` to a lower priority
|
10 | all = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
field `0` is never read:
specta-zod/src/context.rs#L8
warning: field `0` is never read
--> specta-zod/src/context.rs:8:18
|
8 | TypeExtended(Cow<'static, str>, ImplLocation),
| ------------ ^^^^^^^^^^^^^^^^^
| |
| field in this variant
|
= note: `#[warn(dead_code)]` on by default
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
8 | TypeExtended((), ImplLocation),
| ~~
|
passing a unit value to a function:
specta-typescript/src/lib.rs#L640
warning: passing a unit value to a function
--> specta-typescript/src/lib.rs:640:5
|
640 | / Ok(match &e.repr() {
641 | | EnumRepr::Untagged => {
642 | | let mut variants = e
643 | | .variants()
... |
779 | | }
780 | | })
| |______^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
help: move the expression in front of the call and replace it with the unit literal `()`
|
640 ~ match &e.repr() {
641 + EnumRepr::Untagged => {
642 + let mut variants = e
643 + .variants()
644 + .iter()
645 + .filter(|(_, variant)| !variant.skip())
646 + .map(|(name, variant)| {
647 + Ok(match variant.inner() {
648 + EnumVariants::Unit => NULL.to_string(),
649 + _ => inner_comments(
650 + ctx.clone(),
651 + variant.deprecated(),
652 + variant.docs(),
653 + enum_variant_datatype(
654 + ctx.with(PathItem::Variant(name.clone())),
655 + type_map,
656 + name.clone(),
657 + variant,
658 + )?
659 + .expect("Invalid Serde type"),
660 + true,
661 + ),
662 + })
663 + })
664 + .collect::<Result<Vec<_>>>()?;
665 + variants.dedup();
666 + s.push_str(&variants.join(" | "));
667 + }
668 + repr => {
669 + let mut variants = e
670 + .variants()
671 + .iter()
672 + .filter(|(_, variant)| !variant.skip())
673 + .map(|(variant_name, variant)| {
674 + let sanitised_name = sanitise_key(variant_name.clone(), true);
675 +
676 + Ok(inner_comments(
677 + ctx.clone(),
678 + variant.deprecated(),
679 + variant.docs(),
680 + match (repr, &variant.inner()) {
681 + (EnumRepr::Untagged, _) => unreachable!(),
682 + (EnumRepr::Internal { tag }, EnumVariants::Unit) => {
683 + format!("{{ {tag}: {sanitised_name} }}")
684 + }
685 + (EnumRepr::Internal { tag }, EnumVariants::Unnamed(tuple)) => {
686 + let fields = skip_fields(tuple.fields()).collect::<Vec<_>>();
687 +
688 + // This field is only required for `{ty}` not `[...]` so we only need to check when there one field
689 + let dont_join_ty = if tuple.fields().len() == 1 {
690 + let (_, ty) = fields.first().expect("checked length above");
691 + validate_type_for_tagged_intersection(
692 + ctx.clone(),
693 + (**ty).clone(),
694 + type_map,
695 + )?
696 + } else {
697 + false
698 + };
699 +
700 + let mut typ = String::new();
701 +
702 + unnamed_fields_datatype(ctx.clone(), &fields, type_map, &mut typ)?;
703 +
704 + if dont_join_ty {
705 + format!("({{ {tag}: {sanitised_name} }})")
706 + } else {
707 + // We wanna be sure `... & ... | ...` becomes `... & (... | ...)`
708 + if typ.contains('|') {
709 + typ = format!("({typ})");
710 + }
711 + format!("({{ {tag}: {sanitised_name} }} & {typ})")
712 + }
713 + }
714 + (EnumRepr::Internal { tag }, EnumVariants::Named(obj)) => {
715 + let mut fields = vec![format!("{tag}: {sanitised_name}")];
716 +
717 + for (name, field) in skip_fields_named(obj.fields()) {
718 + let mut other = String::new();
719 + object_field_to_ts(
720 + ctx.with(PathItem::Field(name.clone())),
721 + name.clone(),
722 + field,
723 + type_map,
724 + &mut other,
725 + )?;
726 + fields.push(other);
727 + }
728 +
729 + format!("{{ {} }}", fields.join("; "))
730 + }
731 + (EnumRepr::External, EnumVariants::Unit) => sanitised_name.to_string(),
732 + (EnumRepr::External, _) => {
733 + let ts_values = enum_variant_datatype(
734 + ctx.with(PathItem::Variant(variant_name.clone())),
735 + type_map,
736 + variant_name.clone(),
737 + variant,
738 + )?;
739 + let sanitised_name = sanitise_key(variant_name.clone(), false);
740 +
741 + match ts_values {
742 + Some(ts_values) => {
743 + format!("{{ {sanitised_name}: {ts_values} }}")
744 + }
745 + None => format!(r#""{sanitised_name}""#),
746 + }
747 + }
748 + (EnumRepr::Adjacent { tag, .. }, EnumVariants::Unit) => {
749 + format!("{{ {tag}: {sanitised_name} }}")
750 + }
751 + (EnumRepr::Adjacent { tag, content }, _) => {
752 + let ts_value = enum_variant_datatype(
753 + ctx.with(PathItem::Variant(variant_name.clone())),
754 + type_map,
755 + variant_name.clone(),
756 + variant,
757 + )?;
758 +
759 + let mut s = String::new();
760 +
761 + s.push_str("{ ");
762 +
763 + write!(s, "{tag}: {sanitised_name}")?;
764 + if let Some(ts_value) = ts_value {
765 + write!(s, "; {content}: {ts_value}")?;
766 + }
767 +
768 + s.push_str(" }");
769 +
770 + s
771 + }
772 + },
773 + true,
774 + ))
775 + })
776 + .collect::<Result<Vec<_>>>()?;
777 + variants.dedup();
778 + s.push_str(&variants.join(" | "));
779 + }
780 + };
781 + Ok(())
|
|
passing a unit value to a function:
specta-typescript/src/lib.rs#L483
warning: passing a unit value to a function
--> specta-typescript/src/lib.rs:483:24
|
483 | return Ok(match named.tag().as_ref() {
| ________________________^
484 | | Some(tag) => write!(s, r#"{{ "{tag}": "{key}" }}"#)?,
485 | | None => write!(s, "Record<{STRING}, {NEVER}>")?,
486 | | });
| |__________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
help: move the expression in front of the call and replace it with the unit literal `()`
|
483 ~ return {
484 + match named.tag().as_ref() {
485 + Some(tag) => write!(s, r#"{{ "{tag}": "{key}" }}"#)?,
486 + None => write!(s, "Record<{STRING}, {NEVER}>")?,
487 + };
488 + Ok(())
489 ~ };
|
|
passing a unit value to a function:
specta-typescript/src/lib.rs#L471
warning: passing a unit value to a function
--> specta-typescript/src/lib.rs:471:5
|
471 | / Ok(match &strct.fields() {
472 | | StructFields::Unit => s.push_str(NULL),
473 | | StructFields::Unnamed(unnamed) => unnamed_fields_datatype(
474 | | ctx,
... |
547 | | }
548 | | })
| |______^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
help: move the expression in front of the call and replace it with the unit literal `()`
|
471 ~ match &strct.fields() {
472 + StructFields::Unit => s.push_str(NULL),
473 + StructFields::Unnamed(unnamed) => unnamed_fields_datatype(
474 + ctx,
475 + &skip_fields(unnamed.fields()).collect::<Vec<_>>(),
476 + type_map,
477 + s,
478 + )?,
479 + StructFields::Named(named) => {
480 + let fields = skip_fields_named(named.fields()).collect::<Vec<_>>();
481 +
482 + if fields.is_empty() {
483 + return Ok(match named.tag().as_ref() {
484 + Some(tag) => write!(s, r#"{{ "{tag}": "{key}" }}"#)?,
485 + None => write!(s, "Record<{STRING}, {NEVER}>")?,
486 + });
487 + }
488 +
489 + let (flattened, non_flattened): (Vec<_>, Vec<_>) =
490 + fields.iter().partition(|(_, (f, _))| f.flatten());
491 +
492 + let mut field_sections = flattened
493 + .into_iter()
494 + .map(|(key, (field, ty))| {
495 + let mut s = String::new();
496 + datatype_inner(
497 + ctx.with(PathItem::Field(key.clone())),
498 + &FunctionResultVariant::Value(ty.clone()),
499 + type_map,
500 + &mut s,
501 + )
502 + .map(|_| {
503 + inner_comments(
504 + ctx.clone(),
505 + field.deprecated(),
506 + field.docs(),
507 + format!("({s})"),
508 + true,
509 + )
510 + })
511 + })
512 + .collect::<Result<Vec<_>>>()?;
513 +
514 + let mut unflattened_fields = non_flattened
515 + .into_iter()
516 + .map(|(key, field_ref)| {
517 + let (field, _) = field_ref;
518 +
519 + let mut other = String::new();
520 + object_field_to_ts(
521 + ctx.with(PathItem::Field(key.clone())),
522 + key.clone(),
523 + field_ref,
524 + type_map,
525 + &mut other,
526 + )?;
527 +
528 + Ok(inner_comments(
529 + ctx.clone(),
530 + field.deprecated(),
531 + field.docs(),
532 + other,
533 + true,
534 + ))
535 + })
536 + .collect::<Result<Vec<_>>>()?;
537 +
538 + if let Some(tag) = &named.tag() {
539 + unflattened_fields.push(format!("{tag}: \"{key}\""));
540 + }
541 +
542 + if !unflattened_fields.is_empty() {
543 + field_sections.push(format!("{{ {} }}", unflattened_fields.join("; ")));
544 + }
545 +
546 + s.push_str(&field_sections.join(" & "));
547 + }
548 + };
549 + Ok(())
|
|
passing a unit value to a function:
specta-typescript/src/lib.rs#L396
warning: passing a unit value to a function
--> specta-typescript/src/lib.rs:396:5
|
396 | / Ok(match fields {
397 | | [(field, ty)] => {
398 | | let mut v = String::new();
399 | | datatype_inner(
... |
438 | | }
439 | | })
| |______^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
help: move the expression in front of the call and replace it with the unit literal `()`
|
396 ~ match fields {
397 + [(field, ty)] => {
398 + let mut v = String::new();
399 + datatype_inner(
400 + ctx.clone(),
401 + &FunctionResultVariant::Value((*ty).clone()),
402 + type_map,
403 + &mut v,
404 + )?;
405 + s.push_str(&inner_comments(
406 + ctx,
407 + field.deprecated(),
408 + field.docs(),
409 + v,
410 + true,
411 + ));
412 + }
413 + fields => {
414 + s.push('[');
415 +
416 + for (i, (field, ty)) in fields.iter().enumerate() {
417 + if i != 0 {
418 + s.push_str(", ");
419 + }
420 +
421 + let mut v = String::new();
422 + datatype_inner(
423 + ctx.clone(),
424 + &FunctionResultVariant::Value((*ty).clone()),
425 + type_map,
426 + &mut v,
427 + )?;
428 + s.push_str(&inner_comments(
429 + ctx.clone(),
430 + field.deprecated(),
431 + field.docs(),
432 + v,
433 + true,
434 + ));
435 + }
436 +
437 + s.push(']');
438 + }
439 + };
440 + Ok(())
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-typescript/src/lib.rs#L366
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-typescript/src/lib.rs:366:28
|
366 | s.push_str(&reference.name());
| ^^^^^^^^^^^^^^^^^ help: change this to: `reference.name()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-typescript/src/lib.rs#L364
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-typescript/src/lib.rs:364:30
|
364 | [] => s.push_str(&reference.name()),
| ^^^^^^^^^^^^^^^^^ help: change this to: `reference.name()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `-W clippy::needless-borrow` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::needless_borrow)]`
|
passing a unit value to a function:
specta-typescript/src/lib.rs#L229
warning: passing a unit value to a function
--> specta-typescript/src/lib.rs:229:5
|
229 | / Ok(match &typ {
230 | | DataType::Any => s.push_str(ANY),
231 | | DataType::Unknown => s.push_str(UNKNOWN),
232 | | DataType::Primitive(p) => {
... |
385 | | DataType::Generic(ident) => s.push_str(&ident.to_string()),
386 | | })
| |______^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
= note: `-W clippy::unit-arg` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::unit_arg)]`
help: move the expression in front of the call and replace it with the unit literal `()`
|
229 ~ match &typ {
230 + DataType::Any => s.push_str(ANY),
231 + DataType::Unknown => s.push_str(UNKNOWN),
232 + DataType::Primitive(p) => {
233 + let ctx = ctx.with(PathItem::Type(p.to_rust_str().into()));
234 + let str = match p {
235 + primitive_def!(i8 i16 i32 u8 u16 u32 f32 f64) => NUMBER,
236 + primitive_def!(usize isize i64 u64 i128 u128) => match ctx.cfg.bigint {
237 + BigIntExportBehavior::String => STRING,
238 + BigIntExportBehavior::Number => NUMBER,
239 + BigIntExportBehavior::BigInt => BIGINT,
240 + BigIntExportBehavior::Fail => {
241 + return Err(ExportError::BigIntForbidden(ctx.export_path()));
242 + }
243 + BigIntExportBehavior::FailWithReason(reason) => {
244 + return Err(ExportError::Other(ctx.export_path(), reason.to_owned()))
245 + }
246 + },
247 + primitive_def!(String char) => STRING,
248 + primitive_def!(bool) => BOOLEAN,
249 + };
250 +
251 + s.push_str(str);
252 + }
253 + DataType::Literal(literal) => match literal {
254 + LiteralType::i8(v) => write!(s, "{v}")?,
255 + LiteralType::i16(v) => write!(s, "{v}")?,
256 + LiteralType::i32(v) => write!(s, "{v}")?,
257 + LiteralType::u8(v) => write!(s, "{v}")?,
258 + LiteralType::u16(v) => write!(s, "{v}")?,
259 + LiteralType::u32(v) => write!(s, "{v}")?,
260 + LiteralType::f32(v) => write!(s, "{v}")?,
261 + LiteralType::f64(v) => write!(s, "{v}")?,
262 + LiteralType::bool(v) => write!(s, "{v}")?,
263 + LiteralType::String(v) => write!(s, r#""{v}""#)?,
264 + LiteralType::char(v) => write!(s, r#""{v}""#)?,
265 + LiteralType::None => s.write_str(NULL)?,
266 + _ => unreachable!(),
267 + },
268 + DataType::Nullable(def) => {
269 + datatype_inner(
270 + ctx,
271 + &FunctionResultVariant::Value((**def).clone()),
272 + type_map,
273 + s,
274 + )?;
275 +
276 + let or_null = format!(" | {NULL}");
277 + if !s.ends_with(&or_null) {
278 + s.push_str(&or_null);
279 + }
280 + }
281 + DataType::Map(def) => {
282 + // We use this instead of `Record<K, V>` to avoid issues with circular references.
283 + s.push_str("{ [key in ");
284 + datatype_inner(
285 + ctx.clone(),
286 + &FunctionResultVariant::Value(def.key_ty().clone()),
287 + type_map,
288 + s,
289 + )?;
290 + s.push_str("]: ");
291 + datatype_inner(
292 + ctx.clone(),
293 + &FunctionResultVariant::Value(def.value_ty().clone()),
294 + type_map,
295 + s,
296 + )?;
297 + s.push_str(" }");
298 + }
299 + // We use `T[]` instead of `Array<T>` to avoid issues with circular references.
300 + DataType::List(def) => {
301 + let mut dt = String::new();
302 + datatype_inner(
303 + ctx,
304 + &FunctionResultVariant::Value(def.ty().clone()),
305 + type_map,
306 + &mut dt,
307 + )?;
308 +
309 + let dt = if (dt.contains(' ') && !dt.ends_with('}'))
310 + // This is to do with maintaining order of operations.
311 + // Eg `{} | {}` must be wrapped in parens like `({} | {})[]` but `{}` doesn't cause `{}[]` is valid
312 + || (dt.contains(' ') && (dt.contains('&') || dt.contains('|')))
313 + {
314 + format!("({dt})")
315 + } else {
316 + dt
317 + };
318 +
319 + if let Some(length) = def.length() {
320 + s.push('[');
321 +
322 + for n in 0..length {
323 + if n != 0 {
324 + s.push_str(", ");
325 + }
326 +
327 + s.push_str(&dt);
328 + }
329 +
330 + s.push(']');
331 + } else {
332 + write!(s, "{dt}[]")?;
333 + }
334 + }
335 + DataType::Struct(item) => struct_datatype(
336 + ctx.with(
337 + item.sid()
338 + .and_then(|sid| type_map.get(*sid))
339 + .and_then(|v| v.ext())
340 + .map(|v| PathItem::TypeExtended(item.name().clone(), *v.impl_location()))
341 + .unwrap_or_else(|| PathItem::Type(item.name().clone())),
342 + ),
343 + item.name(),
344 + item,
345 + type_map,
346 + s,
347 + )?,
348 + DataType::Enum(item) => {
349 + let mut ctx = ctx.clone();
350 + let cfg = ctx.cfg.clone().bigint(BigIntExportBehavior::Number);
351 + if item.skip_bigint_checks() {
352 + ctx.cfg = &cfg;
353 + }
354 +
355 + enum_datatype(
356 + ctx.with(PathItem::Variant(item.name().clone())),
357 + item,
358 + type_map,
359 + s,
360 + )?
361 + }
362 + DataType::Tuple(tuple) => s.push_str(&tuple_datatype(ctx, tuple, type_map)?),
363 + DataType::Reference(reference) => match &reference.generics()[..] {
364 + [] => s.push_str(&reference.name()),
365 + generics => {
366 + s.push_str(&reference.name());
367 + s.push('<');
368 +
369 + for (i, (_, v)) in generics.iter().enumerate() {
370 + if i != 0 {
371 + s.push_str(", ");
372 + }
373 +
374 + datatype_inner(
375 + ctx.with(PathItem::Type(reference.name().clone())),
376 + &FunctionResultVariant::Value(v.clone()),
377 + type_map,
378 + s,
379 + )?;
380 + }
381 +
382 + s.push('>');
383 + }
384 + },
385 + DataType::Generic(ident) => s.push_str(&ident.to_string()),
386 + };
387 + Ok(())
|
|
using `clone` on type `Option<&NamedDataTypeExt>` which implements the `Copy` trait:
specta-typescript/src/lib.rs#L137
warning: using `clone` on type `Option<&NamedDataTypeExt>` which implements the `Copy` trait
--> specta-typescript/src/lib.rs:137:9
|
137 | ext.clone()
| ^^^^^^^^^^^ help: try removing the `clone` call: `ext`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
= note: `-W clippy::clone-on-copy` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::clone_on_copy)]`
|
package `specta-zod` is missing `package.readme` metadata:
specta-typescript/src/lib.rs#L1
warning: package `specta-zod` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-util` is missing `package.readme` metadata:
specta-typescript/src/lib.rs#L1
warning: package `specta-util` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-typescript` is missing `package.readme` metadata:
specta-typescript/src/lib.rs#L1
warning: package `specta-typescript` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-swift` is missing `package.readme` metadata:
specta-typescript/src/lib.rs#L1
warning: package `specta-swift` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-serde` is missing `package.readme` metadata:
specta-typescript/src/lib.rs#L1
warning: package `specta-serde` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-rust` is missing `package.readme` metadata:
specta-typescript/src/lib.rs#L1
warning: package `specta-rust` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-openapi` is missing `package.readme` metadata:
specta-typescript/src/lib.rs#L1
warning: package `specta-openapi` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-kotlin` is missing `package.readme` metadata:
specta-typescript/src/lib.rs#L1
warning: package `specta-kotlin` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-go` is missing `package.readme` metadata:
specta-typescript/src/lib.rs#L1
warning: package `specta-go` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-datatype-from` is missing `package.readme` metadata:
specta-typescript/src/lib.rs#L1
warning: package `specta-datatype-from` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta` is missing `package.readme` metadata:
specta-typescript/src/lib.rs#L1
warning: package `specta` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
= note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo`
= help: to override `-W clippy::cargo` add `#[allow(clippy::cargo_common_metadata)]`
|
lint group `cargo` has the same priority (-1) as a lint:
Cargo.toml#L11
warning: lint group `cargo` has the same priority (-1) as a lint
--> Cargo.toml:11:1
|
11 | cargo = { level = "warn", priority = -1 }
| ^^^^^
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
help: to have lints override the group set `cargo` to a lower priority
|
11 | cargo = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
lint group `all` has the same priority (-1) as a lint:
Cargo.toml#L10
warning: lint group `all` has the same priority (-1) as a lint
--> Cargo.toml:10:1
|
10 | all = { level = "warn", priority = -1 }
| ^^^
11 | cargo = { level = "warn", priority = -1 }
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
= note: `-W clippy::lint-groups-priority` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::lint_groups_priority)]`
help: to have lints override the group set `all` to a lower priority
|
10 | all = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
constant `RESERVED_IDENTS` is never used:
specta-typescript/src/reserved_terms.rs#L66
warning: constant `RESERVED_IDENTS` is never used
--> specta-typescript/src/reserved_terms.rs:66:18
|
66 | pub(crate) const RESERVED_IDENTS: &[&str] = &[
| ^^^^^^^^^^^^^^^
|
field `0` is never read:
specta-typescript/src/context.rs#L10
warning: field `0` is never read
--> specta-typescript/src/context.rs:10:18
|
10 | TypeExtended(Cow<'static, str>, ImplLocation),
| ------------ ^^^^^^^^^^^^^^^^^
| |
| field in this variant
|
= note: `#[warn(dead_code)]` on by default
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
10 | TypeExtended((), ImplLocation),
| ~~
|
`todo` should not be present in production code:
specta-openapi/src/lib.rs#L270
warning: `todo` should not be present in production code
--> specta-openapi/src/lib.rs:270:13
|
270 | todo!();
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#todo
|
`todo` should not be present in production code:
specta-openapi/src/lib.rs#L264
warning: `todo` should not be present in production code
--> specta-openapi/src/lib.rs:264:17
|
264 | todo!();
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#todo
|
`todo` should not be present in production code:
specta-openapi/src/lib.rs#L245
warning: `todo` should not be present in production code
--> specta-openapi/src/lib.rs:245:13
|
245 | todo!();
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#todo
|
`todo` should not be present in production code:
specta-openapi/src/lib.rs#L168
warning: `todo` should not be present in production code
--> specta-openapi/src/lib.rs:168:13
|
168 | todo!();
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#todo
|
`todo` should not be present in production code:
specta-openapi/src/lib.rs#L120
warning: `todo` should not be present in production code
--> specta-openapi/src/lib.rs:120:20
|
120 | tys => todo!(),
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#todo
= note: requested on the command line with `-W clippy::todo`
|
returning the result of a `let` binding from a block:
specta-openapi/src/lib.rs#L93
warning: returning the result of a `let` binding from a block
--> specta-openapi/src/lib.rs:93:13
|
91 | let schema = to_openapi(def);
| ----------------------------- unnecessary `let` binding
92 | // schema.schema_data.nullable = true; // TODO
93 | schema
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
= note: `-W clippy::let-and-return` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::let_and_return)]`
help: return the expression directly
|
91 ~
92 | // schema.schema_data.nullable = true; // TODO
93 ~ to_openapi(def)
|
|
`todo` should not be present in production code:
specta-kotlin/src/lib.rs#L101
warning: `todo` should not be present in production code
--> specta-kotlin/src/lib.rs:101:14
|
101 | _ => todo!(),
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#todo
|
`todo` should not be present in production code:
specta-kotlin/src/lib.rs#L98
warning: `todo` should not be present in production code
--> specta-kotlin/src/lib.rs:98:13
|
98 | todo!();
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#todo
= note: requested on the command line with `-W clippy::todo`
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-kotlin/src/lib.rs#L61
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-kotlin/src/lib.rs:61:58
|
61 | DataType::Nullable(t) => format!("{}?", datatype(&t)?),
| ^^ help: change this to: `t`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-kotlin/src/lib.rs#L41
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-kotlin/src/lib.rs:41:22
|
41 | datatype(&t.value_ty())?
| ^^^^^^^^^^^^^ help: change this to: `t.value_ty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-kotlin/src/lib.rs#L40
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-kotlin/src/lib.rs:40:22
|
40 | datatype(&t.key_ty())?,
| ^^^^^^^^^^^ help: change this to: `t.key_ty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `-W clippy::needless-borrow` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::needless_borrow)]`
|
`todo` should not be present in production code:
specta-rust/src/lib.rs#L72
warning: `todo` should not be present in production code
--> specta-rust/src/lib.rs:72:30
|
72 | DataType::Enum(_) => todo!(),
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#todo
|
`todo` should not be present in production code:
specta-rust/src/lib.rs#L70
warning: `todo` should not be present in production code
--> specta-rust/src/lib.rs:70:13
|
70 | todo!();
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#todo
|
redundant closure:
specta-rust/src/lib.rs#L37
warning: redundant closure
--> specta-rust/src/lib.rs:37:26
|
37 | .map(|v| datatype(v))
| ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `datatype`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
= note: `-W clippy::redundant-closure` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::redundant_closure)]`
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-rust/src/lib.rs#L28
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-rust/src/lib.rs:28:22
|
28 | datatype(&t.value_ty())?
| ^^^^^^^^^^^^^ help: change this to: `t.value_ty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-rust/src/lib.rs#L27
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-rust/src/lib.rs:27:22
|
27 | datatype(&t.key_ty())?,
| ^^^^^^^^^^^ help: change this to: `t.key_ty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `-W clippy::needless-borrow` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::needless_borrow)]`
|
`todo` should not be present in production code:
specta-rust/src/lib.rs#L23
warning: `todo` should not be present in production code
--> specta-rust/src/lib.rs:23:33
|
23 | DataType::Literal(_) => todo!(),
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#todo
|
`todo` should not be present in production code:
specta-rust/src/lib.rs#L20
warning: `todo` should not be present in production code
--> specta-rust/src/lib.rs:20:30
|
20 | DataType::Unknown => todo!(),
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#todo
= note: requested on the command line with `-W clippy::todo`
|
package `specta-zod` is missing `package.readme` metadata:
specta-kotlin/src/lib.rs#L1
warning: package `specta-zod` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-util` is missing `package.readme` metadata:
specta-kotlin/src/lib.rs#L1
warning: package `specta-util` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-typescript` is missing `package.readme` metadata:
specta-kotlin/src/lib.rs#L1
warning: package `specta-typescript` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-swift` is missing `package.readme` metadata:
specta-kotlin/src/lib.rs#L1
warning: package `specta-swift` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-serde` is missing `package.readme` metadata:
specta-kotlin/src/lib.rs#L1
warning: package `specta-serde` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-rust` is missing `package.readme` metadata:
specta-kotlin/src/lib.rs#L1
warning: package `specta-rust` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-openapi` is missing `package.readme` metadata:
specta-kotlin/src/lib.rs#L1
warning: package `specta-openapi` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-kotlin` is missing `package.readme` metadata:
specta-kotlin/src/lib.rs#L1
warning: package `specta-kotlin` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-go` is missing `package.readme` metadata:
specta-kotlin/src/lib.rs#L1
warning: package `specta-go` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-datatype-from` is missing `package.readme` metadata:
specta-kotlin/src/lib.rs#L1
warning: package `specta-datatype-from` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta` is missing `package.readme` metadata:
specta-kotlin/src/lib.rs#L1
warning: package `specta` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
= note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo`
= help: to override `-W clippy::cargo` add `#[allow(clippy::cargo_common_metadata)]`
|
lint group `cargo` has the same priority (-1) as a lint:
Cargo.toml#L11
warning: lint group `cargo` has the same priority (-1) as a lint
--> Cargo.toml:11:1
|
11 | cargo = { level = "warn", priority = -1 }
| ^^^^^
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
help: to have lints override the group set `cargo` to a lower priority
|
11 | cargo = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
lint group `all` has the same priority (-1) as a lint:
Cargo.toml#L10
warning: lint group `all` has the same priority (-1) as a lint
--> Cargo.toml:10:1
|
10 | all = { level = "warn", priority = -1 }
| ^^^
11 | cargo = { level = "warn", priority = -1 }
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
= note: `-W clippy::lint-groups-priority` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::lint_groups_priority)]`
help: to have lints override the group set `all` to a lower priority
|
10 | all = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
unused variable: `tag`:
specta-kotlin/src/lib.rs#L66
warning: unused variable: `tag`
--> specta-kotlin/src/lib.rs:66:17
|
66 | let tag = s.tag();
| ^^^ help: if this is intentional, prefix it with an underscore: `_tag`
|
package `specta-zod` is missing `package.readme` metadata:
specta-openapi/src/lib.rs#L1
warning: package `specta-zod` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-util` is missing `package.readme` metadata:
specta-openapi/src/lib.rs#L1
warning: package `specta-util` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-typescript` is missing `package.readme` metadata:
specta-openapi/src/lib.rs#L1
warning: package `specta-typescript` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-swift` is missing `package.readme` metadata:
specta-openapi/src/lib.rs#L1
warning: package `specta-swift` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-serde` is missing `package.readme` metadata:
specta-openapi/src/lib.rs#L1
warning: package `specta-serde` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-rust` is missing `package.readme` metadata:
specta-openapi/src/lib.rs#L1
warning: package `specta-rust` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-openapi` is missing `package.readme` metadata:
specta-openapi/src/lib.rs#L1
warning: package `specta-openapi` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-kotlin` is missing `package.readme` metadata:
specta-openapi/src/lib.rs#L1
warning: package `specta-kotlin` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-go` is missing `package.readme` metadata:
specta-openapi/src/lib.rs#L1
warning: package `specta-go` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-datatype-from` is missing `package.readme` metadata:
specta-openapi/src/lib.rs#L1
warning: package `specta-datatype-from` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta` is missing `package.readme` metadata:
specta-openapi/src/lib.rs#L1
warning: package `specta` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
= note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo`
= help: to override `-W clippy::cargo` add `#[allow(clippy::cargo_common_metadata)]`
|
unused variable: `fields`:
specta-kotlin/src/lib.rs#L65
warning: unused variable: `fields`
--> specta-kotlin/src/lib.rs:65:17
|
65 | let fields = s.fields();
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_fields`
|
unused variable: `generics`:
specta-kotlin/src/lib.rs#L64
warning: unused variable: `generics`
--> specta-kotlin/src/lib.rs:64:17
|
64 | let generics = s.generics();
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_generics`
|
unused variable: `name`:
specta-kotlin/src/lib.rs#L63
warning: unused variable: `name`
--> specta-kotlin/src/lib.rs:63:17
|
63 | let name = s.name();
| ^^^^ help: if this is intentional, prefix it with an underscore: `_name`
|
= note: `#[warn(unused_variables)]` on by default
|
lint group `cargo` has the same priority (-1) as a lint:
Cargo.toml#L11
warning: lint group `cargo` has the same priority (-1) as a lint
--> Cargo.toml:11:1
|
11 | cargo = { level = "warn", priority = -1 }
| ^^^^^
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
help: to have lints override the group set `cargo` to a lower priority
|
11 | cargo = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
lint group `all` has the same priority (-1) as a lint:
Cargo.toml#L10
warning: lint group `all` has the same priority (-1) as a lint
--> Cargo.toml:10:1
|
10 | all = { level = "warn", priority = -1 }
| ^^^
11 | cargo = { level = "warn", priority = -1 }
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
= note: `-W clippy::lint-groups-priority` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::lint_groups_priority)]`
help: to have lints override the group set `all` to a lower priority
|
10 | all = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
unused variable: `generics`:
specta-openapi/src/lib.rs#L256
warning: unused variable: `generics`
--> specta-openapi/src/lib.rs:256:13
|
256 | generics => {
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_generics`
|
unused variable: `e`:
specta-openapi/src/lib.rs#L170
warning: unused variable: `e`
--> specta-openapi/src/lib.rs:170:24
|
170 | DataType::Enum(e) => {
| ^ help: if this is intentional, prefix it with an underscore: `_e`
|
unused variable: `name`:
specta-openapi/src/lib.rs#L124
warning: unused variable: `name`
--> specta-openapi/src/lib.rs:124:17
|
124 | let name = s.name();
| ^^^^ help: if this is intentional, prefix it with an underscore: `_name`
|
unused variable: `fields`:
specta-openapi/src/lib.rs#L123
warning: unused variable: `fields`
--> specta-openapi/src/lib.rs:123:17
|
123 | let fields = s.fields();
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_fields`
|
unused variable: `tys`:
specta-openapi/src/lib.rs#L120
warning: unused variable: `tys`
--> specta-openapi/src/lib.rs:120:13
|
120 | tys => todo!(),
| ^^^ help: if this is intentional, prefix it with an underscore: `_tys`
|
= note: `#[warn(unused_variables)]` on by default
|
package `specta-zod` is missing `package.readme` metadata:
specta-rust/src/lib.rs#L1
warning: package `specta-zod` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-util` is missing `package.readme` metadata:
specta-rust/src/lib.rs#L1
warning: package `specta-util` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-typescript` is missing `package.readme` metadata:
specta-rust/src/lib.rs#L1
warning: package `specta-typescript` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-swift` is missing `package.readme` metadata:
specta-rust/src/lib.rs#L1
warning: package `specta-swift` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-serde` is missing `package.readme` metadata:
specta-rust/src/lib.rs#L1
warning: package `specta-serde` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-rust` is missing `package.readme` metadata:
specta-rust/src/lib.rs#L1
warning: package `specta-rust` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-openapi` is missing `package.readme` metadata:
specta-rust/src/lib.rs#L1
warning: package `specta-openapi` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-kotlin` is missing `package.readme` metadata:
specta-rust/src/lib.rs#L1
warning: package `specta-kotlin` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-go` is missing `package.readme` metadata:
specta-rust/src/lib.rs#L1
warning: package `specta-go` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-datatype-from` is missing `package.readme` metadata:
specta-rust/src/lib.rs#L1
warning: package `specta-datatype-from` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta` is missing `package.readme` metadata:
specta-rust/src/lib.rs#L1
warning: package `specta` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
= note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo`
= help: to override `-W clippy::cargo` add `#[allow(clippy::cargo_common_metadata)]`
|
lint group `cargo` has the same priority (-1) as a lint:
Cargo.toml#L11
warning: lint group `cargo` has the same priority (-1) as a lint
--> Cargo.toml:11:1
|
11 | cargo = { level = "warn", priority = -1 }
| ^^^^^
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
help: to have lints override the group set `cargo` to a lower priority
|
11 | cargo = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
lint group `all` has the same priority (-1) as a lint:
Cargo.toml#L10
warning: lint group `all` has the same priority (-1) as a lint
--> Cargo.toml:10:1
|
10 | all = { level = "warn", priority = -1 }
| ^^^
11 | cargo = { level = "warn", priority = -1 }
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
= note: `-W clippy::lint-groups-priority` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::lint_groups_priority)]`
help: to have lints override the group set `all` to a lower priority
|
10 | all = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
this `match` can be collapsed into the outer `match`:
specta-serde/src/lib.rs#L129
warning: this `match` can be collapsed into the outer `match`
--> specta-serde/src/lib.rs:129:34
|
129 | DataType::Literal(ty) => match ty {
| __________________________________^
130 | | LiteralType::i8(_)
131 | | | LiteralType::i16(_)
132 | | | LiteralType::i32(_)
... |
140 | | _ => Err(SerdeError::InvalidMapKey),
141 | | },
| |_________^
|
help: the outer pattern can be modified to include the inner pattern
--> specta-serde/src/lib.rs:129:27
|
129 | DataType::Literal(ty) => match ty {
| ^^ replace this binding
130 | / LiteralType::i8(_)
131 | | | LiteralType::i16(_)
132 | | | LiteralType::i32(_)
133 | | | LiteralType::u8(_)
... |
138 | | | LiteralType::String(_)
139 | | | LiteralType::char(_) => Ok(()),
| |__________________________________^ with this pattern
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match
|
unused variable: `s`:
specta-rust/src/lib.rs#L42
warning: unused variable: `s`
--> specta-rust/src/lib.rs:42:26
|
42 | DataType::Struct(s) => {
| ^ help: if this is intentional, prefix it with an underscore: `_s`
|
= note: `#[warn(unused_variables)]` on by default
|
this `match` can be collapsed into the outer `match`:
specta-serde/src/lib.rs#L110
warning: this `match` can be collapsed into the outer `match`
--> specta-serde/src/lib.rs:110:36
|
110 | DataType::Primitive(ty) => match ty {
| ____________________________________^
111 | | PrimitiveType::i8
112 | | | PrimitiveType::i16
113 | | | PrimitiveType::i32
... |
127 | | _ => Err(SerdeError::InvalidMapKey),
128 | | },
| |_________^
|
help: the outer pattern can be modified to include the inner pattern
--> specta-serde/src/lib.rs:110:29
|
110 | DataType::Primitive(ty) => match ty {
| ^^ replace this binding
111 | / PrimitiveType::i8
112 | | | PrimitiveType::i16
113 | | | PrimitiveType::i32
114 | | | PrimitiveType::i64
... |
125 | | | PrimitiveType::String
126 | | | PrimitiveType::char => Ok(()),
| |_________________________________^ with this pattern
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match
= note: `-W clippy::collapsible-match` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::collapsible_match)]`
|
`todo` should not be present in production code:
specta-swift/src/lib.rs#L110
warning: `todo` should not be present in production code
--> specta-swift/src/lib.rs:110:14
|
110 | _ => todo!(),
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#todo
|
`todo` should not be present in production code:
specta-swift/src/lib.rs#L107
warning: `todo` should not be present in production code
--> specta-swift/src/lib.rs:107:13
|
107 | todo!();
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#todo
= note: requested on the command line with `-W clippy::todo`
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-swift/src/lib.rs#L50
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-swift/src/lib.rs:50:82
|
50 | DataType::Map(t) => format!("[{}: {}]", datatype(&t.key_ty())?, datatype(&t.value_ty())?),
| ^^^^^^^^^^^^^ help: change this to: `t.value_ty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-swift/src/lib.rs#L50
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-swift/src/lib.rs:50:58
|
50 | DataType::Map(t) => format!("[{}: {}]", datatype(&t.key_ty())?, datatype(&t.value_ty())?),
| ^^^^^^^^^^^ help: change this to: `t.key_ty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-swift/src/lib.rs#L38
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-swift/src/lib.rs:38:55
|
38 | DataType::List(t) => format!("[{}]", datatype(&t.ty())?),
| ^^^^^^^ help: change this to: `t.ty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `-W clippy::needless-borrow` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::needless_borrow)]`
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-util/src/type_collection.rs#L41
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-util/src/type_collection.rs:41:29
|
41 | let dt = export(&mut type_map);
| ^^^^^^^^^^^^^ help: change this to: `type_map`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `-W clippy::needless-borrow` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::needless_borrow)]`
|
this `impl` can be derived:
specta-util/src/type_collection.rs#L11
warning: this `impl` can be derived
--> specta-util/src/type_collection.rs:11:1
|
11 | / impl Default for TypeCollection {
12 | | fn default() -> Self {
13 | | Self {
14 | | types: HashMap::new(),
15 | | }
16 | | }
17 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= note: `-W clippy::derivable-impls` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::derivable_impls)]`
= help: remove the manual implementation...
help: ...and instead derive it
|
7 + #[derive(Default)]
8 | pub struct TypeCollection {
|
|
very complex type used. Consider factoring parts into `type` definitions:
specta-util/src/export.rs#L11
warning: very complex type used. Consider factoring parts into `type` definitions
--> specta-util/src/export.rs:11:15
|
11 | static TYPES: OnceLock<Mutex<HashMap<SpectaID, fn(&mut TypeMap) -> NamedDataType>>> =
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
= note: `-W clippy::type-complexity` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::type_complexity)]`
|
`todo` should not be present in production code:
specta-go/src/lib.rs#L16
warning: `todo` should not be present in production code
--> specta-go/src/lib.rs:16:5
|
16 | todo!();
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#todo
= note: requested on the command line with `-W clippy::todo`
|
package `specta-zod` is missing `package.readme` metadata:
specta-serde/src/lib.rs#L1
warning: package `specta-zod` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-util` is missing `package.readme` metadata:
specta-serde/src/lib.rs#L1
warning: package `specta-util` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-typescript` is missing `package.readme` metadata:
specta-serde/src/lib.rs#L1
warning: package `specta-typescript` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-swift` is missing `package.readme` metadata:
specta-serde/src/lib.rs#L1
warning: package `specta-swift` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-serde` is missing `package.readme` metadata:
specta-serde/src/lib.rs#L1
warning: package `specta-serde` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-rust` is missing `package.readme` metadata:
specta-serde/src/lib.rs#L1
warning: package `specta-rust` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-openapi` is missing `package.readme` metadata:
specta-serde/src/lib.rs#L1
warning: package `specta-openapi` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-kotlin` is missing `package.readme` metadata:
specta-serde/src/lib.rs#L1
warning: package `specta-kotlin` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-go` is missing `package.readme` metadata:
specta-serde/src/lib.rs#L1
warning: package `specta-go` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-datatype-from` is missing `package.readme` metadata:
specta-serde/src/lib.rs#L1
warning: package `specta-datatype-from` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta` is missing `package.readme` metadata:
specta-serde/src/lib.rs#L1
warning: package `specta` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
= note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo`
= help: to override `-W clippy::cargo` add `#[allow(clippy::cargo_common_metadata)]`
|
package `specta-zod` is missing `package.readme` metadata:
specta-util/src/lib.rs#L1
warning: package `specta-zod` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-util` is missing `package.readme` metadata:
specta-util/src/lib.rs#L1
warning: package `specta-util` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-typescript` is missing `package.readme` metadata:
specta-util/src/lib.rs#L1
warning: package `specta-typescript` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-swift` is missing `package.readme` metadata:
specta-util/src/lib.rs#L1
warning: package `specta-swift` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-serde` is missing `package.readme` metadata:
specta-util/src/lib.rs#L1
warning: package `specta-serde` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-rust` is missing `package.readme` metadata:
specta-util/src/lib.rs#L1
warning: package `specta-rust` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-openapi` is missing `package.readme` metadata:
specta-util/src/lib.rs#L1
warning: package `specta-openapi` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-kotlin` is missing `package.readme` metadata:
specta-util/src/lib.rs#L1
warning: package `specta-kotlin` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-go` is missing `package.readme` metadata:
specta-util/src/lib.rs#L1
warning: package `specta-go` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-datatype-from` is missing `package.readme` metadata:
specta-util/src/lib.rs#L1
warning: package `specta-datatype-from` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta` is missing `package.readme` metadata:
specta-util/src/lib.rs#L1
warning: package `specta` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
= note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo`
= help: to override `-W clippy::cargo` add `#[allow(clippy::cargo_common_metadata)]`
|
package `specta-zod` is missing `package.readme` metadata:
specta-swift/src/lib.rs#L1
warning: package `specta-zod` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-util` is missing `package.readme` metadata:
specta-swift/src/lib.rs#L1
warning: package `specta-util` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-typescript` is missing `package.readme` metadata:
specta-swift/src/lib.rs#L1
warning: package `specta-typescript` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-swift` is missing `package.readme` metadata:
specta-swift/src/lib.rs#L1
warning: package `specta-swift` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-serde` is missing `package.readme` metadata:
specta-swift/src/lib.rs#L1
warning: package `specta-serde` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-rust` is missing `package.readme` metadata:
specta-swift/src/lib.rs#L1
warning: package `specta-rust` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-openapi` is missing `package.readme` metadata:
specta-swift/src/lib.rs#L1
warning: package `specta-openapi` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-kotlin` is missing `package.readme` metadata:
specta-swift/src/lib.rs#L1
warning: package `specta-kotlin` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-go` is missing `package.readme` metadata:
specta-swift/src/lib.rs#L1
warning: package `specta-go` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-datatype-from` is missing `package.readme` metadata:
specta-swift/src/lib.rs#L1
warning: package `specta-datatype-from` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta` is missing `package.readme` metadata:
specta-swift/src/lib.rs#L1
warning: package `specta` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
= note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo`
= help: to override `-W clippy::cargo` add `#[allow(clippy::cargo_common_metadata)]`
|
lint group `cargo` has the same priority (-1) as a lint:
Cargo.toml#L11
warning: lint group `cargo` has the same priority (-1) as a lint
--> Cargo.toml:11:1
|
11 | cargo = { level = "warn", priority = -1 }
| ^^^^^
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
help: to have lints override the group set `cargo` to a lower priority
|
11 | cargo = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
lint group `all` has the same priority (-1) as a lint:
Cargo.toml#L10
warning: lint group `all` has the same priority (-1) as a lint
--> Cargo.toml:10:1
|
10 | all = { level = "warn", priority = -1 }
| ^^^
11 | cargo = { level = "warn", priority = -1 }
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
= note: `-W clippy::lint-groups-priority` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::lint_groups_priority)]`
help: to have lints override the group set `all` to a lower priority
|
10 | all = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
package `specta-zod` is missing `package.readme` metadata:
specta-go/src/lib.rs#L1
warning: package `specta-zod` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-util` is missing `package.readme` metadata:
specta-go/src/lib.rs#L1
warning: package `specta-util` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-typescript` is missing `package.readme` metadata:
specta-go/src/lib.rs#L1
warning: package `specta-typescript` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-swift` is missing `package.readme` metadata:
specta-go/src/lib.rs#L1
warning: package `specta-swift` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-serde` is missing `package.readme` metadata:
specta-go/src/lib.rs#L1
warning: package `specta-serde` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
lint group `cargo` has the same priority (-1) as a lint:
Cargo.toml#L11
warning: lint group `cargo` has the same priority (-1) as a lint
--> Cargo.toml:11:1
|
11 | cargo = { level = "warn", priority = -1 }
| ^^^^^
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
help: to have lints override the group set `cargo` to a lower priority
|
11 | cargo = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
package `specta-rust` is missing `package.readme` metadata:
specta-go/src/lib.rs#L1
warning: package `specta-rust` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-openapi` is missing `package.readme` metadata:
specta-go/src/lib.rs#L1
warning: package `specta-openapi` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-kotlin` is missing `package.readme` metadata:
specta-go/src/lib.rs#L1
warning: package `specta-kotlin` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-go` is missing `package.readme` metadata:
specta-go/src/lib.rs#L1
warning: package `specta-go` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-datatype-from` is missing `package.readme` metadata:
specta-go/src/lib.rs#L1
warning: package `specta-datatype-from` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
lint group `all` has the same priority (-1) as a lint:
Cargo.toml#L10
warning: lint group `all` has the same priority (-1) as a lint
--> Cargo.toml:10:1
|
10 | all = { level = "warn", priority = -1 }
| ^^^
11 | cargo = { level = "warn", priority = -1 }
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
= note: `-W clippy::lint-groups-priority` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::lint_groups_priority)]`
help: to have lints override the group set `all` to a lower priority
|
10 | all = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
package `specta` is missing `package.readme` metadata:
specta-go/src/lib.rs#L1
warning: package `specta` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
= note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo`
= help: to override `-W clippy::cargo` add `#[allow(clippy::cargo_common_metadata)]`
|
lint group `cargo` has the same priority (-1) as a lint:
Cargo.toml#L11
warning: lint group `cargo` has the same priority (-1) as a lint
--> Cargo.toml:11:1
|
11 | cargo = { level = "warn", priority = -1 }
| ^^^^^
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
help: to have lints override the group set `cargo` to a lower priority
|
11 | cargo = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
lint group `all` has the same priority (-1) as a lint:
Cargo.toml#L10
warning: lint group `all` has the same priority (-1) as a lint
--> Cargo.toml:10:1
|
10 | all = { level = "warn", priority = -1 }
| ^^^
11 | cargo = { level = "warn", priority = -1 }
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
= note: `-W clippy::lint-groups-priority` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::lint_groups_priority)]`
help: to have lints override the group set `all` to a lower priority
|
10 | all = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
lint group `cargo` has the same priority (-1) as a lint:
Cargo.toml#L11
warning: lint group `cargo` has the same priority (-1) as a lint
--> Cargo.toml:11:1
|
11 | cargo = { level = "warn", priority = -1 }
| ^^^^^
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
help: to have lints override the group set `cargo` to a lower priority
|
11 | cargo = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
unused variable: `s`:
specta-swift/src/lib.rs#L65
warning: unused variable: `s`
--> specta-swift/src/lib.rs:65:26
|
65 | DataType::Struct(s) => {
| ^ help: if this is intentional, prefix it with an underscore: `_s`
|
= note: `#[warn(unused_variables)]` on by default
|
lint group `all` has the same priority (-1) as a lint:
Cargo.toml#L10
warning: lint group `all` has the same priority (-1) as a lint
--> Cargo.toml:10:1
|
10 | all = { level = "warn", priority = -1 }
| ^^^
11 | cargo = { level = "warn", priority = -1 }
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
= note: `-W clippy::lint-groups-priority` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::lint_groups_priority)]`
help: to have lints override the group set `all` to a lower priority
|
10 | all = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
unused variable: `t`:
specta-go/src/lib.rs#L15
warning: unused variable: `t`
--> specta-go/src/lib.rs:15:13
|
15 | fn datatype(t: &DataType) -> Result<String, String> {
| ^ help: if this is intentional, prefix it with an underscore: `_t`
|
= note: `#[warn(unused_variables)]` on by default
|
returning the result of a `let` binding from a block:
specta/src/type/impls.rs#L403
warning: returning the result of a `let` binding from a block
--> specta/src/type/impls.rs:403:37
|
402 | ... let ty = <u32 as Type>::reference(type_map, &[]).inner;
| ------------------------------------------------------- unnecessary `let` binding
403 | ... ty
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
402 ~
403 ~ <u32 as Type>::reference(type_map, &[]).inner
|
|
returning the result of a `let` binding from a block:
specta/src/type/impls.rs#L390
warning: returning the result of a `let` binding from a block
--> specta/src/type/impls.rs:390:37
|
389 | ... let ty = <u64 as Type>::reference(type_map, &[]).inner;
| ------------------------------------------------------- unnecessary `let` binding
390 | ... ty
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
389 ~
390 ~ <u64 as Type>::reference(type_map, &[]).inner
|
|
returning the result of a `let` binding from a block:
specta/src/type/impls.rs#L321
warning: returning the result of a `let` binding from a block
--> specta/src/type/impls.rs:321:37
|
320 | ... let ty = <u32 as Type>::reference(type_map, &[]).inner;
| ------------------------------------------------------- unnecessary `let` binding
321 | ... ty
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
320 ~
321 ~ <u32 as Type>::reference(type_map, &[]).inner
|
|
returning the result of a `let` binding from a block:
specta/src/type/impls.rs#L308
warning: returning the result of a `let` binding from a block
--> specta/src/type/impls.rs:308:37
|
307 | ... let ty = <i64 as Type>::reference(type_map, &[]).inner;
| ------------------------------------------------------- unnecessary `let` binding
308 | ... ty
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
= note: `-W clippy::let-and-return` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::let_and_return)]`
help: return the expression directly
|
307 ~
308 ~ <i64 as Type>::reference(type_map, &[]).inner
|
|
accessing first element with `generics.get(0)`:
specta/src/type/impls.rs#L165
warning: accessing first element with `generics.get(0)`
--> specta/src/type/impls.rs:165:17
|
165 | / generics
166 | | .get(0)
| |___________________________^ help: try: `generics.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
|
accessing first element with `generics.get(0)`:
specta/src/type/impls.rs#L153
warning: accessing first element with `generics.get(0)`
--> specta/src/type/impls.rs:153:18
|
153 | ty = generics.get(0).cloned()
| ^^^^^^^^^^^^^^^ help: try: `generics.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
= note: `-W clippy::get-first` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::get_first)]`
|
this function has too many arguments (8/7):
specta/src/internal.rs#L232
warning: this function has too many arguments (8/7)
--> specta/src/internal.rs:232:5
|
232 | / pub fn get_fn_datatype<TMarker, T: SpectaFn<TMarker>>(
233 | | _: T,
234 | | asyncness: bool,
235 | | name: Cow<'static, str>,
... |
240 | | no_return_type: bool,
241 | | ) -> Function {
| |_________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `-W clippy::too-many-arguments` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::too_many_arguments)]`
|
`panic` should not be present in production code:
specta/src/internal/interop.rs#L44
warning: `panic` should not be present in production code
--> specta/src/internal/interop.rs:44:37
|
44 | LiteralType::char(_) => panic!("Specta v1 does not support char literals"),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
|
`panic` should not be present in production code:
specta/src/internal/interop.rs#L13
warning: `panic` should not be present in production code
--> specta/src/internal/interop.rs:13:30
|
13 | DataType::Unknown => panic!("Specta v1 does not support unknown types"),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
= note: requested on the command line with `-W clippy::panic`
|
unnecessary use of `get(&sid).is_none()`:
specta/src/datatype/reference.rs#L22
warning: unnecessary use of `get(&sid).is_none()`
--> specta/src/datatype/reference.rs:22:21
|
22 | if type_map.map.get(&sid).is_none() {
| -------------^^^^^^^^^^^^^^^^^^^
| |
| help: replace it with: `!type_map.map.contains_key(&sid)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check
= note: `-W clippy::unnecessary-get-then-check` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::unnecessary_get_then_check)]`
|
package `specta-zod` is missing `package.readme` metadata:
specta/src/lib.rs#L1
warning: package `specta-zod` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-util` is missing `package.readme` metadata:
specta/src/lib.rs#L1
warning: package `specta-util` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-typescript` is missing `package.readme` metadata:
specta/src/lib.rs#L1
warning: package `specta-typescript` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-swift` is missing `package.readme` metadata:
specta/src/lib.rs#L1
warning: package `specta-swift` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-serde` is missing `package.readme` metadata:
specta/src/lib.rs#L1
warning: package `specta-serde` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-rust` is missing `package.readme` metadata:
specta/src/lib.rs#L1
warning: package `specta-rust` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-openapi` is missing `package.readme` metadata:
specta/src/lib.rs#L1
warning: package `specta-openapi` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-kotlin` is missing `package.readme` metadata:
specta/src/lib.rs#L1
warning: package `specta-kotlin` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-go` is missing `package.readme` metadata:
specta/src/lib.rs#L1
warning: package `specta-go` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-datatype-from` is missing `package.readme` metadata:
specta/src/lib.rs#L1
warning: package `specta-datatype-from` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta` is missing `package.readme` metadata:
specta/src/lib.rs#L1
warning: package `specta` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
= note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo`
= help: to override `-W clippy::cargo` add `#[allow(clippy::cargo_common_metadata)]`
|
lint group `cargo` has the same priority (-1) as a lint:
Cargo.toml#L11
warning: lint group `cargo` has the same priority (-1) as a lint
--> Cargo.toml:11:1
|
11 | cargo = { level = "warn", priority = -1 }
| ^^^^^
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
help: to have lints override the group set `cargo` to a lower priority
|
11 | cargo = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
lint group `all` has the same priority (-1) as a lint:
Cargo.toml#L10
warning: lint group `all` has the same priority (-1) as a lint
--> Cargo.toml:10:1
|
10 | all = { level = "warn", priority = -1 }
| ^^^
11 | cargo = { level = "warn", priority = -1 }
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
= note: `-W clippy::lint-groups-priority` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::lint_groups_priority)]`
help: to have lints override the group set `all` to a lower priority
|
10 | all = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
needless `fn main` in doctest:
specta/src/./docs.md#L22
warning: needless `fn main` in doctest
--> specta/src/./docs.md:22:1
|
22 | / use specta::{*, ts::*};
23 | |
24 | | #[derive(Type)]
25 | | pub struct MyCustomType {
... |
33 | | );
34 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main
= note: `-W clippy::needless-doctest-main` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::needless_doctest_main)]`
|
unused variable: `name`:
specta/src/internal/interop.rs#L112
warning: unused variable: `name`
--> specta/src/internal/interop.rs:112:32
|
112 | .map(|(name, v)| match v.inner() {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_name`
|
= note: `#[warn(unused_variables)]` on by default
|
used `unwrap()` on an `Option` value:
specta-macros/src/type/struct.rs#L163
warning: used `unwrap()` on an `Option` value
--> specta-macros/src/type/struct.rs:163:67
|
163 | ... let field_ident_str = unraw_raw_ident(field.ident.as_ref().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: if this value is `None`, it will panic
= help: consider using `expect()` to provide a better panic message
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L241
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:241:29
|
241 | let generics = generics(&crate_ref, quote!(&[#(#generic_var_idents),*]));
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
used `unwrap()` on an `Option` value:
specta-macros/src/type/generics.rs#L205
warning: used `unwrap()` on an `Option` value
--> specta-macros/src/type/generics.rs:205:31
|
205 | let generic_args = match &path.segments.last().unwrap().arguments {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: if this value is `None`, it will panic
= help: consider using `expect()` to provide a better panic message
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L192
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:192:17
|
192 | &crate_ref,
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L169
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:169:37
|
169 | let generics = generics(&crate_ref, quote!(&[]));
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L151
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:151:37
|
151 | let generics = generics(&crate_ref, quote!(&[#elem_var_ident]));
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L131
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:131:37
|
131 | let generics = generics(&crate_ref, quote!(&[#(#generic_var_idents),*]));
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `-W clippy::needless-borrow` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::needless_borrow)]`
|
used `unwrap()` on an `Option` value:
specta-macros/src/type/enum.rs#L151
warning: used `unwrap()` on an `Option` value
--> specta-macros/src/type/enum.rs:151:49
|
151 | ... unraw_raw_ident(field.ident.as_ref().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: if this value is `None`, it will panic
= help: consider using `expect()` to provide a better panic message
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
`todo` should not be present in production code:
specta-macros/src/type/enum.rs#L77
warning: `todo` should not be present in production code
--> specta-macros/src/type/enum.rs:77:30
|
77 | _ => todo!(),
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#todo
= note: requested on the command line with `-W clippy::todo`
|
field assignment outside of initializer for an instance created with Default::default():
specta-macros/src/type/attr/variant.rs#L32
warning: field assignment outside of initializer for an instance created with Default::default()
--> specta-macros/src/type/attr/variant.rs:32:9
|
32 | result.common = CommonAttr::from_attrs(attrs)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `r#type::attr::variant::VariantAttr { common: CommonAttr::from_attrs(attrs)?, ..Default::default() }` and removing relevant reassignments
--> specta-macros/src/type/attr/variant.rs:31:9
|
31 | let mut result = Self::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
specta-macros/src/utils.rs#L202
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-macros/src/utils.rs:202:24
|
202 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: specta-macros/src/type/attr/variant.rs:18:1
|
18 | / impl_parse! {
19 | | VariantAttr(attr, out) {
20 | | "rename_all" => out.rename_all = out.rename_all.take().or(Some(attr.parse_inflection()?)),
21 | | "rename" => out.rename = out.rename.take().or(Some(attr.parse_string()?.to_token_stream())),
... |
26 | | }
27 | | }
| |_- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: this warning originates in the macro `impl_parse` (in Nightly builds, run with -Z macro-backtrace for more info)
|
field assignment outside of initializer for an instance created with Default::default():
specta-macros/src/type/attr/field.rs#L54
warning: field assignment outside of initializer for an instance created with Default::default()
--> specta-macros/src/type/attr/field.rs:54:9
|
54 | result.common = CommonAttr::from_attrs(attrs)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `r#type::attr::field::FieldAttr { common: CommonAttr::from_attrs(attrs)?, ..Default::default() }` and removing relevant reassignments
--> specta-macros/src/type/attr/field.rs:53:9
|
53 | let mut result = Self::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
specta-macros/src/utils.rs#L202
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-macros/src/utils.rs:202:24
|
202 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: specta-macros/src/type/attr/field.rs:20:1
|
20 | / impl_parse! {
21 | | FieldAttr(attr, out) {
22 | | "rename" => {
23 | | let attr = attr.parse_string()?;
... |
48 | | }
49 | | }
| |_- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: this warning originates in the macro `impl_parse` (in Nightly builds, run with -Z macro-backtrace for more info)
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
specta-macros/src/utils.rs#L202
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-macros/src/utils.rs:202:24
|
202 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: specta-macros/src/type/attr/enum.rs:25:1
|
25 | / impl_parse! {
26 | | EnumAttr(attr, out) {
27 | | // "tag" was already passed in the container so we don't need to do anything here
28 | | "content" => out.content = out.content.take().or(Some(attr.parse_string()?)),
... |
31 | | }
32 | | }
| |_- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: this warning originates in the macro `impl_parse` (in Nightly builds, run with -Z macro-backtrace for more info)
|
field assignment outside of initializer for an instance created with Default::default():
specta-macros/src/type/attr/container.rs#L54
warning: field assignment outside of initializer for an instance created with Default::default()
--> specta-macros/src/type/attr/container.rs:54:9
|
54 | result.common = CommonAttr::from_attrs(attrs)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `r#type::attr::container::ContainerAttr { common: CommonAttr::from_attrs(attrs)?, ..Default::default() }` and removing relevant reassignments
--> specta-macros/src/type/attr/container.rs:53:9
|
53 | let mut result = Self::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
= note: `-W clippy::field-reassign-with-default` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::field_reassign_with_default)]`
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
specta-macros/src/utils.rs#L202
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-macros/src/utils.rs:202:24
|
202 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: specta-macros/src/type/attr/container.rs:24:1
|
24 | / impl_parse! {
25 | | ContainerAttr(attr, out) {
26 | | "rename_all" => out.rename_all = out.rename_all.take().or(Some(attr.parse_inflection()?)),
27 | | "rename" => {
... |
48 | | }
49 | | }
| |_- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: this warning originates in the macro `impl_parse` (in Nightly builds, run with -Z macro-backtrace for more info)
|
called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead:
specta-macros/src/type/attr/common.rs#L75
warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead
--> specta-macros/src/type/attr/common.rs:75:32
|
75 | let note = attr
| ________________________________^
76 | | .iter()
77 | | .filter(|attr| attr.key == "note")
78 | | .next()
| |_______________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next
help: try
|
75 ~ let note = attr
76 + .iter().find(|attr| attr.key == "note")
|
|
called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead:
specta-macros/src/type/attr/common.rs#L61
warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead
--> specta-macros/src/type/attr/common.rs:61:33
|
61 | let since = attr
| _________________________________^
62 | | .iter()
63 | | .filter(|attr| attr.key == "since")
64 | | .next()
| |_______________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next
help: try
|
61 ~ let since = attr
62 + .iter().find(|attr| attr.key == "since")
|
|
called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead:
specta-macros/src/type/attr/common.rs#L46
warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead
--> specta-macros/src/type/attr/common.rs:46:35
|
46 | if let Some(attr_value) = attrs.iter().filter(|attr| attr.key == "deprecated").next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `attrs.iter().find(|attr| attr.key == "deprecated")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next
= note: `-W clippy::filter-next` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::filter_next)]`
|
calling `push_str()` using a single-character string literal:
specta-macros/src/type/attr/common.rs#L38
warning: calling `push_str()` using a single-character string literal
--> specta-macros/src/type/attr/common.rs:38:21
|
38 | s.push_str("\n");
| ^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `s.push('\n')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
= note: `-W clippy::single-char-add-str` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::single_char_add_str)]`
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
specta-macros/src/type/attr/common.rs#L32
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-macros/src/type/attr/common.rs:32:30
|
32 | pub fn from_attrs(attrs: &mut Vec<Attribute>) -> Result<Self> {
| ^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [Attribute]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `-W clippy::ptr-arg` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::ptr_arg)]`
|
used `unwrap()` on a `Result` value:
specta-macros/src/specta.rs#L85
warning: used `unwrap()` on a `Result` value
--> specta-macros/src/specta.rs:85:24
|
85 | arg_names.push(TokenStream::from_str(&s).unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: if this value is an `Err`, it will panic
= help: consider using `expect()` to provide a better panic message
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
= note: requested on the command line with `-W clippy::unwrap-used`
|
redundant pattern matching, consider using `is_some()`:
specta-macros/src/specta.rs#L48
warning: redundant pattern matching, consider using `is_some()`
--> specta-macros/src/specta.rs:48:30
|
48 | let function_asyncness = match function.sig.asyncness {
| ______________________________^
49 | | Some(_) => true,
50 | | None => false,
51 | | };
| |_____^ help: try: `function.sig.asyncness.is_some()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
= note: `-W clippy::redundant-pattern-matching` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::redundant_pattern_matching)]`
|
this call to `as_ref` does nothing:
specta-macros/src/specta.rs#L15
warning: this call to `as_ref` does nothing
--> specta-macros/src/specta.rs:15:9
|
15 | s.as_ref()
| ^^^^^^^^^^ help: try: `s`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref
= note: `-W clippy::useless-asref` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::useless_asref)]`
|
package `specta-zod` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-zod` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-util` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-util` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-typescript` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-typescript` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-swift` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-swift` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-serde` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-serde` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-rust` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-rust` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-openapi` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-openapi` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-kotlin` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-kotlin` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-go` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-go` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-datatype-from` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-datatype-from` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
= note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo`
= help: to override `-W clippy::cargo` add `#[allow(clippy::cargo_common_metadata)]`
|
lint group `cargo` has the same priority (-1) as a lint:
Cargo.toml#L11
warning: lint group `cargo` has the same priority (-1) as a lint
--> Cargo.toml:11:1
|
11 | cargo = { level = "warn", priority = -1 }
| ^^^^^
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
help: to have lints override the group set `cargo` to a lower priority
|
11 | cargo = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
lint group `all` has the same priority (-1) as a lint:
Cargo.toml#L10
warning: lint group `all` has the same priority (-1) as a lint
--> Cargo.toml:10:1
|
10 | all = { level = "warn", priority = -1 }
| ^^^
11 | cargo = { level = "warn", priority = -1 }
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
= note: `-W clippy::lint-groups-priority` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::lint_groups_priority)]`
help: to have lints override the group set `all` to a lower priority
|
10 | all = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
function `then_option` is never used:
specta-macros/src/utils.rs#L293
warning: function `then_option` is never used
--> specta-macros/src/utils.rs:293:8
|
293 | pub fn then_option(condition: bool, inner: TokenStream) -> TokenStream {
| ^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
used `unwrap()` on an `Option` value:
specta-macros/src/type/struct.rs#L163
warning: used `unwrap()` on an `Option` value
--> specta-macros/src/type/struct.rs:163:67
|
163 | ... let field_ident_str = unraw_raw_ident(field.ident.as_ref().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: if this value is `None`, it will panic
= help: consider using `expect()` to provide a better panic message
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L241
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:241:29
|
241 | let generics = generics(&crate_ref, quote!(&[#(#generic_var_idents),*]));
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
used `unwrap()` on an `Option` value:
specta-macros/src/type/generics.rs#L205
warning: used `unwrap()` on an `Option` value
--> specta-macros/src/type/generics.rs:205:31
|
205 | let generic_args = match &path.segments.last().unwrap().arguments {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: if this value is `None`, it will panic
= help: consider using `expect()` to provide a better panic message
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L192
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:192:17
|
192 | &crate_ref,
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L169
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:169:37
|
169 | let generics = generics(&crate_ref, quote!(&[]));
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L151
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:151:37
|
151 | let generics = generics(&crate_ref, quote!(&[#elem_var_ident]));
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L131
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:131:37
|
131 | let generics = generics(&crate_ref, quote!(&[#(#generic_var_idents),*]));
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `-W clippy::needless-borrow` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::needless_borrow)]`
|
length comparison to zero:
specta-datatype-from/src/data_type_from/mod.rs#L24
warning: length comparison to zero
--> specta-datatype-from/src/data_type_from/mod.rs:24:8
|
24 | if generics.params.len() > 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!generics.params.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
= note: `-W clippy::len-zero` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::len_zero)]`
|
used `unwrap()` on an `Option` value:
specta-macros/src/type/enum.rs#L151
warning: used `unwrap()` on an `Option` value
--> specta-macros/src/type/enum.rs:151:49
|
151 | ... unraw_raw_ident(field.ident.as_ref().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: if this value is `None`, it will panic
= help: consider using `expect()` to provide a better panic message
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
specta-datatype-from/src/utils.rs#L221
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-datatype-from/src/utils.rs:221:24
|
221 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: specta-datatype-from/src/data_type_from/attr/field.rs:13:1
|
13 | / impl_parse! {
14 | | FieldAttr(attr, out) {
15 | | "skip" => out.skip = true,
16 | | "rename" => {
... |
22 | | }
23 | | }
| |_- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: this warning originates in the macro `impl_parse` (in Nightly builds, run with -Z macro-backtrace for more info)
|
`todo` should not be present in production code:
specta-macros/src/type/enum.rs#L77
warning: `todo` should not be present in production code
--> specta-macros/src/type/enum.rs:77:30
|
77 | _ => todo!(),
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#todo
= note: requested on the command line with `-W clippy::todo`
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
specta-datatype-from/src/utils.rs#L221
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-datatype-from/src/utils.rs:221:24
|
221 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: specta-datatype-from/src/data_type_from/attr/container.rs:12:1
|
12 | / impl_parse! {
13 | | ContainerAttr(attr, out) {
14 | | "crate" => out.crate_name = out.crate_name.take().or(Some(attr.parse_path()?.into_token_stream())),
15 | | }
16 | | }
| |_- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `-W clippy::ptr-arg` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::ptr_arg)]`
= note: this warning originates in the macro `impl_parse` (in Nightly builds, run with -Z macro-backtrace for more info)
|
field assignment outside of initializer for an instance created with Default::default():
specta-macros/src/type/attr/variant.rs#L32
warning: field assignment outside of initializer for an instance created with Default::default()
--> specta-macros/src/type/attr/variant.rs:32:9
|
32 | result.common = CommonAttr::from_attrs(attrs)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `r#type::attr::variant::VariantAttr { common: CommonAttr::from_attrs(attrs)?, ..Default::default() }` and removing relevant reassignments
--> specta-macros/src/type/attr/variant.rs:31:9
|
31 | let mut result = Self::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
specta-macros/src/utils.rs#L202
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-macros/src/utils.rs:202:24
|
202 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: specta-macros/src/type/attr/variant.rs:18:1
|
18 | / impl_parse! {
19 | | VariantAttr(attr, out) {
20 | | "rename_all" => out.rename_all = out.rename_all.take().or(Some(attr.parse_inflection()?)),
21 | | "rename" => out.rename = out.rename.take().or(Some(attr.parse_string()?.to_token_stream())),
... |
26 | | }
27 | | }
| |_- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: this warning originates in the macro `impl_parse` (in Nightly builds, run with -Z macro-backtrace for more info)
|
field assignment outside of initializer for an instance created with Default::default():
specta-macros/src/type/attr/field.rs#L54
warning: field assignment outside of initializer for an instance created with Default::default()
--> specta-macros/src/type/attr/field.rs:54:9
|
54 | result.common = CommonAttr::from_attrs(attrs)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `r#type::attr::field::FieldAttr { common: CommonAttr::from_attrs(attrs)?, ..Default::default() }` and removing relevant reassignments
--> specta-macros/src/type/attr/field.rs:53:9
|
53 | let mut result = Self::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
specta-macros/src/utils.rs#L202
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-macros/src/utils.rs:202:24
|
202 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: specta-macros/src/type/attr/field.rs:20:1
|
20 | / impl_parse! {
21 | | FieldAttr(attr, out) {
22 | | "rename" => {
23 | | let attr = attr.parse_string()?;
... |
48 | | }
49 | | }
| |_- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: this warning originates in the macro `impl_parse` (in Nightly builds, run with -Z macro-backtrace for more info)
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
specta-macros/src/utils.rs#L202
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-macros/src/utils.rs:202:24
|
202 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: specta-macros/src/type/attr/enum.rs:25:1
|
25 | / impl_parse! {
26 | | EnumAttr(attr, out) {
27 | | // "tag" was already passed in the container so we don't need to do anything here
28 | | "content" => out.content = out.content.take().or(Some(attr.parse_string()?)),
... |
31 | | }
32 | | }
| |_- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: this warning originates in the macro `impl_parse` (in Nightly builds, run with -Z macro-backtrace for more info)
|
field assignment outside of initializer for an instance created with Default::default():
specta-macros/src/type/attr/container.rs#L54
warning: field assignment outside of initializer for an instance created with Default::default()
--> specta-macros/src/type/attr/container.rs:54:9
|
54 | result.common = CommonAttr::from_attrs(attrs)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `r#type::attr::container::ContainerAttr { common: CommonAttr::from_attrs(attrs)?, ..Default::default() }` and removing relevant reassignments
--> specta-macros/src/type/attr/container.rs:53:9
|
53 | let mut result = Self::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
= note: `-W clippy::field-reassign-with-default` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::field_reassign_with_default)]`
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
specta-macros/src/utils.rs#L202
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-macros/src/utils.rs:202:24
|
202 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: specta-macros/src/type/attr/container.rs:24:1
|
24 | / impl_parse! {
25 | | ContainerAttr(attr, out) {
26 | | "rename_all" => out.rename_all = out.rename_all.take().or(Some(attr.parse_inflection()?)),
27 | | "rename" => {
... |
48 | | }
49 | | }
| |_- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: this warning originates in the macro `impl_parse` (in Nightly builds, run with -Z macro-backtrace for more info)
|
called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead:
specta-macros/src/type/attr/common.rs#L75
warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead
--> specta-macros/src/type/attr/common.rs:75:32
|
75 | let note = attr
| ________________________________^
76 | | .iter()
77 | | .filter(|attr| attr.key == "note")
78 | | .next()
| |_______________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next
help: try
|
75 ~ let note = attr
76 + .iter().find(|attr| attr.key == "note")
|
|
called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead:
specta-macros/src/type/attr/common.rs#L61
warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead
--> specta-macros/src/type/attr/common.rs:61:33
|
61 | let since = attr
| _________________________________^
62 | | .iter()
63 | | .filter(|attr| attr.key == "since")
64 | | .next()
| |_______________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next
help: try
|
61 ~ let since = attr
62 + .iter().find(|attr| attr.key == "since")
|
|
called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead:
specta-macros/src/type/attr/common.rs#L46
warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead
--> specta-macros/src/type/attr/common.rs:46:35
|
46 | if let Some(attr_value) = attrs.iter().filter(|attr| attr.key == "deprecated").next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `attrs.iter().find(|attr| attr.key == "deprecated")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next
= note: `-W clippy::filter-next` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::filter_next)]`
|
calling `push_str()` using a single-character string literal:
specta-macros/src/type/attr/common.rs#L38
warning: calling `push_str()` using a single-character string literal
--> specta-macros/src/type/attr/common.rs:38:21
|
38 | s.push_str("\n");
| ^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `s.push('\n')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
= note: `-W clippy::single-char-add-str` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::single_char_add_str)]`
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
specta-macros/src/type/attr/common.rs#L32
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-macros/src/type/attr/common.rs:32:30
|
32 | pub fn from_attrs(attrs: &mut Vec<Attribute>) -> Result<Self> {
| ^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [Attribute]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `-W clippy::ptr-arg` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::ptr_arg)]`
|
package `specta-zod` is missing `package.readme` metadata:
specta-datatype-from/src/lib.rs#L1
warning: package `specta-zod` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-util` is missing `package.readme` metadata:
specta-datatype-from/src/lib.rs#L1
warning: package `specta-util` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-typescript` is missing `package.readme` metadata:
specta-datatype-from/src/lib.rs#L1
warning: package `specta-typescript` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-swift` is missing `package.readme` metadata:
specta-datatype-from/src/lib.rs#L1
warning: package `specta-swift` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-serde` is missing `package.readme` metadata:
specta-datatype-from/src/lib.rs#L1
warning: package `specta-serde` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-rust` is missing `package.readme` metadata:
specta-datatype-from/src/lib.rs#L1
warning: package `specta-rust` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-openapi` is missing `package.readme` metadata:
specta-datatype-from/src/lib.rs#L1
warning: package `specta-openapi` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-kotlin` is missing `package.readme` metadata:
specta-datatype-from/src/lib.rs#L1
warning: package `specta-kotlin` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-go` is missing `package.readme` metadata:
specta-datatype-from/src/lib.rs#L1
warning: package `specta-go` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-datatype-from` is missing `package.readme` metadata:
specta-datatype-from/src/lib.rs#L1
warning: package `specta-datatype-from` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta` is missing `package.readme` metadata:
specta-datatype-from/src/lib.rs#L1
warning: package `specta` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
= note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo`
= help: to override `-W clippy::cargo` add `#[allow(clippy::cargo_common_metadata)]`
|
used `unwrap()` on a `Result` value:
specta-macros/src/specta.rs#L85
warning: used `unwrap()` on a `Result` value
--> specta-macros/src/specta.rs:85:24
|
85 | arg_names.push(TokenStream::from_str(&s).unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: if this value is an `Err`, it will panic
= help: consider using `expect()` to provide a better panic message
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
= note: requested on the command line with `-W clippy::unwrap-used`
|
redundant pattern matching, consider using `is_some()`:
specta-macros/src/specta.rs#L48
warning: redundant pattern matching, consider using `is_some()`
--> specta-macros/src/specta.rs:48:30
|
48 | let function_asyncness = match function.sig.asyncness {
| ______________________________^
49 | | Some(_) => true,
50 | | None => false,
51 | | };
| |_____^ help: try: `function.sig.asyncness.is_some()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
= note: `-W clippy::redundant-pattern-matching` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::redundant_pattern_matching)]`
|
this call to `as_ref` does nothing:
specta-macros/src/specta.rs#L15
warning: this call to `as_ref` does nothing
--> specta-macros/src/specta.rs:15:9
|
15 | s.as_ref()
| ^^^^^^^^^^ help: try: `s`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref
= note: `-W clippy::useless-asref` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::useless_asref)]`
|
lint group `cargo` has the same priority (-1) as a lint:
Cargo.toml#L11
warning: lint group `cargo` has the same priority (-1) as a lint
--> Cargo.toml:11:1
|
11 | cargo = { level = "warn", priority = -1 }
| ^^^^^
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
help: to have lints override the group set `cargo` to a lower priority
|
11 | cargo = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
lint group `all` has the same priority (-1) as a lint:
Cargo.toml#L10
warning: lint group `all` has the same priority (-1) as a lint
--> Cargo.toml:10:1
|
10 | all = { level = "warn", priority = -1 }
| ^^^
11 | cargo = { level = "warn", priority = -1 }
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
= note: `-W clippy::lint-groups-priority` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::lint_groups_priority)]`
help: to have lints override the group set `all` to a lower priority
|
10 | all = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
function `unraw_raw_ident` is never used:
specta-datatype-from/src/utils.rs#L269
warning: function `unraw_raw_ident` is never used
--> specta-datatype-from/src/utils.rs:269:8
|
269 | pub fn unraw_raw_ident(ident: &Ident) -> String {
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
`#[macro_use]` only has an effect on `extern crate` and modules:
specta-datatype-from/src/utils.rs#L215
warning: `#[macro_use]` only has an effect on `extern crate` and modules
--> specta-datatype-from/src/utils.rs:215:1
|
215 | #[macro_use]
| ^^^^^^^^^^^^
|
= note: `#[warn(unused_attributes)]` on by default
|
unexpected `cfg` condition value: `function`:
specta-datatype-from/src/utils.rs#L307
warning: unexpected `cfg` condition value: `function`
--> specta-datatype-from/src/utils.rs:307:7
|
307 | #[cfg(feature = "function")]
| ^^^^^^^^^^^^^^^^^^^^ help: remove the condition
|
= note: no expected values for `feature`
= help: consider adding `function` as a feature in `Cargo.toml`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
= note: `#[warn(unexpected_cfgs)]` on by default
|
package `specta-zod` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-zod` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-util` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-util` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-typescript` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-typescript` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-swift` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-swift` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-serde` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-serde` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-rust` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-rust` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-openapi` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-openapi` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-kotlin` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-kotlin` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-go` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-go` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta-datatype-from` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta-datatype-from` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
|
package `specta` is missing `package.readme` metadata:
specta-macros/src/lib.rs#L1
warning: package `specta` is missing `package.readme` metadata
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata
= note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo`
= help: to override `-W clippy::cargo` add `#[allow(clippy::cargo_common_metadata)]`
|
lint group `cargo` has the same priority (-1) as a lint:
Cargo.toml#L11
warning: lint group `cargo` has the same priority (-1) as a lint
--> Cargo.toml:11:1
|
11 | cargo = { level = "warn", priority = -1 }
| ^^^^^
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
help: to have lints override the group set `cargo` to a lower priority
|
11 | cargo = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
lint group `all` has the same priority (-1) as a lint:
Cargo.toml#L10
warning: lint group `all` has the same priority (-1) as a lint
--> Cargo.toml:10:1
|
10 | all = { level = "warn", priority = -1 }
| ^^^
11 | cargo = { level = "warn", priority = -1 }
12 | unwrap_used = { level = "warn", priority = -1 }
| ----------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
= note: `-W clippy::lint-groups-priority` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::lint_groups_priority)]`
help: to have lints override the group set `all` to a lower priority
|
10 | all = { level = "warn", priority = -2 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
function `then_option` is never used:
specta-macros/src/utils.rs#L293
warning: function `then_option` is never used
--> specta-macros/src/utils.rs:293:8
|
293 | pub fn then_option(condition: bool, inner: TokenStream) -> TokenStream {
| ^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
clippy
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
clippy
The following actions use a deprecated Node.js version and will be forced to run on node20: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|