Skip to content

Datatype Copy Rust's Structure #190

Datatype Copy Rust's Structure

Datatype Copy Rust's Structure #190

Triggered via pull request August 31, 2023 20:36
Status Failure
Total duration 1m 36s
Artifacts

ci.yml

on: pull_request
Matrix: build
Fit to window
Zoom out
Zoom in

Annotations

5 errors and 74 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.
missing documentation for an associated constant: src/type/mod.rs#L116
warning: missing documentation for an associated constant --> src/type/mod.rs:116:5 | 116 | const IMPL_LOCATION: ImplLocation; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for an associated constant: src/type/mod.rs#L115
warning: missing documentation for an associated constant --> src/type/mod.rs:115:5 | 115 | const SID: SpectaID; | ^^^^^^^^^^^^^^^^^^^
missing documentation for a variant: src/type/mod.rs#L27
warning: missing documentation for a variant --> src/type/mod.rs:27:5 | 27 | InvalidType(ImplLocation, &'static str), | ^^^^^^^^^^^
length comparison to zero: src/lang/ts/mod.rs#L295
warning: length comparison to zero --> src/lang/ts/mod.rs:295:16 | 295 | if s.fields.len() == 0 { | ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.fields.is_empty()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero = note: `#[warn(clippy::len_zero)]` implied by `#[warn(clippy::all)]`
unneeded `return` statement: src/lang/ts/mod.rs#L292
warning: unneeded `return` statement --> src/lang/ts/mod.rs:292:29 | 292 | StructType::Unit => return Ok("null".into()), | ^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return = note: `#[warn(clippy::needless_return)]` implied by `#[warn(clippy::all)]` help: remove `return` | 292 | StructType::Unit => Ok("null".into()), | ~~~~~~~~~~~~~~~~~
this match could be written as a `let` statement: src/lang/ts/mod.rs#L270
warning: this match could be written as a `let` statement --> src/lang/ts/mod.rs:270:5 | 270 | / match tuple { 271 | | TupleType { fields, .. } => match &fields[..] { 272 | | [] => Ok(empty_tuple_fallback.to_string()), 273 | | [ty] => datatype_inner(ctx, ty, type_map, "null"), ... | 281 | | }, 282 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding help: consider using a `let` statement | 270 ~ let TupleType { fields, .. } = tuple; 271 + match &fields[..] { 272 + [] => Ok(empty_tuple_fallback.to_string()), 273 + [ty] => datatype_inner(ctx, ty, type_map, "null"), 274 + tys => Ok(format!( 275 + "[{}]", 276 + tys.iter() 277 + .map(|v| datatype_inner(ctx.clone(), v, type_map, "null")) 278 + .collect::<Result<Vec<_>>>()? 279 + .join(", ") 280 + )), 281 + } |
`panic` should not be present in production code: src/lang/ts/mod.rs#L202
warning: `panic` should not be present in production code --> src/lang/ts/mod.rs:202:44 | 202 | .unwrap_or_else(|| panic!("Type {} has no value!", r.name())); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
`panic` should not be present in production code: src/lang/ts/mod.rs#L200
warning: `panic` should not be present in production code --> src/lang/ts/mod.rs:200:44 | 200 | .unwrap_or_else(|| panic!("Type {} not found!", r.name())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic note: the lint level is defined here --> src/lib.rs:58:43 | 58 | #![warn(clippy::all, clippy::unwrap_used, clippy::panic, missing_docs)] | ^^^^^^^^^^^^^
missing documentation for a variant: src/lang/ts/error.rs#L48
warning: missing documentation for a variant --> src/lang/ts/error.rs:48:5 | 48 | Other(ExportPath, String), | ^^^^^
missing documentation for a variant: src/lang/ts/error.rs#L46
warning: missing documentation for a variant --> src/lang/ts/error.rs:46:5 | 46 | Io(#[from] std::io::Error), | ^^
missing documentation for a variant: src/lang/ts/error.rs#L44
warning: missing documentation for a variant --> src/lang/ts/error.rs:44:5 | 44 | SpectaExportError(#[from] ExportError), | ^^^^^^^^^^^^^^^^^
missing documentation for a variant: src/lang/ts/error.rs#L42
warning: missing documentation for a variant --> src/lang/ts/error.rs:42:5 | 42 | DuplicateTypeName(Cow<'static, str>, ImplLocation, ImplLocation), | ^^^^^^^^^^^^^^^^^
missing documentation for a variant: src/lang/ts/error.rs#L40
warning: missing documentation for a variant --> src/lang/ts/error.rs:40:5 | 40 | InvalidTagging(ExportPath), | ^^^^^^^^^^^^^^
missing documentation for a variant: src/lang/ts/error.rs#L38
warning: missing documentation for a variant --> src/lang/ts/error.rs:38:5 | 38 | ForbiddenName(NamedLocation, ExportPath, &'static str), | ^^^^^^^^^^^^^
missing documentation for a variant: src/lang/ts/error.rs#L36
warning: missing documentation for a variant --> src/lang/ts/error.rs:36:5 | 36 | UnableToTagUnnamedType(ExportPath), | ^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a variant: src/lang/ts/error.rs#L34
warning: missing documentation for a variant --> src/lang/ts/error.rs:34:5 | 34 | BigIntForbidden(ExportPath), | ^^^^^^^^^^^^^^^
useless conversion to the same type: `export::export::TypesIter`: src/export/ts.rs#L19
warning: useless conversion to the same type: `export::export::TypesIter` --> src/export/ts.rs:19:17 | 19 | let types = get_types()? | _________________^ 20 | | .into_iter() | |____________________^ help: consider removing `.into_iter()`: `get_types()?` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion = note: `#[warn(clippy::useless_conversion)]` implied by `#[warn(clippy::all)]`
module has the same name as its containing module: src/export/mod.rs#L1
warning: module has the same name as its containing module --> src/export/mod.rs:1:1 | 1 | mod export; | ^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception = note: `#[warn(clippy::module_inception)]` implied by `#[warn(clippy::all)]`
missing documentation for a method: src/datatype/mod.rs#L88
warning: missing documentation for a method --> src/datatype/mod.rs:88:5 | 88 | pub fn generics(&self) -> impl Iterator<Item = &DataType> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/mod.rs#L84
warning: missing documentation for a method --> src/datatype/mod.rs:84:5 | 84 | pub fn sid(&self) -> SpectaID { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/mod.rs#L80
warning: missing documentation for a method --> src/datatype/mod.rs:80:5 | 80 | pub fn name(&self) -> &Cow<'static, str> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/tuple.rs#L38
warning: missing documentation for a method --> src/datatype/tuple.rs:38:5 | 38 | pub fn generics(&self) -> impl Iterator<Item = &GenericType> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/tuple.rs#L34
warning: missing documentation for a method --> src/datatype/tuple.rs:34:5 | 34 | pub fn fields(&self) -> impl Iterator<Item = &DataType> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/struct.rs#L115
warning: missing documentation for a method --> src/datatype/struct.rs:115:5 | 115 | pub fn tag(&self) -> Option<&Cow<'static, str>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/struct.rs#L96
warning: missing documentation for a method --> src/datatype/struct.rs:96:5 | 96 | pub fn fields(&self) -> Vec<StructField> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/struct.rs#L88
warning: missing documentation for a method --> src/datatype/struct.rs:88:5 | 88 | pub fn generics(&self) -> Vec<GenericType> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for an enum: src/datatype/struct.rs#L54
warning: missing documentation for an enum --> src/datatype/struct.rs:54:1 | 54 | pub enum StructType { | ^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/struct.rs#L48
warning: missing documentation for a method --> src/datatype/struct.rs:48:5 | 48 | pub fn tag(&self) -> &Option<Cow<'static, str>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/struct.rs#L44
warning: missing documentation for a method --> src/datatype/struct.rs:44:5 | 44 | pub fn fields(&self) -> impl Iterator<Item = &StructField> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/struct.rs#L40
warning: missing documentation for a method --> src/datatype/struct.rs:40:5 | 40 | pub fn generics(&self) -> impl Iterator<Item = &GenericType> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a struct: src/datatype/struct.rs#L33
warning: missing documentation for a struct --> src/datatype/struct.rs:33:1 | 33 | pub struct StructNamedFields { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/struct.rs#L27
warning: missing documentation for a method --> src/datatype/struct.rs:27:5 | 27 | pub fn ty(&self) -> &DataType { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/struct.rs#L23
warning: missing documentation for a method --> src/datatype/struct.rs:23:5 | 23 | pub fn flatten(&self) -> bool { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/struct.rs#L19
warning: missing documentation for a method --> src/datatype/struct.rs:19:5 | 19 | pub fn optional(&self) -> bool { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/struct.rs#L15
warning: missing documentation for a method --> src/datatype/struct.rs:15:5 | 15 | pub fn key(&self) -> &Cow<'static, str> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a variant: src/datatype/primitive.rs#L23
warning: missing documentation for a variant --> src/datatype/primitive.rs:23:5 | 23 | String, | ^^^^^^
missing documentation for a variant: src/datatype/primitive.rs#L22
warning: missing documentation for a variant --> src/datatype/primitive.rs:22:5 | 22 | char, | ^^^^
missing documentation for a variant: src/datatype/primitive.rs#L21
warning: missing documentation for a variant --> src/datatype/primitive.rs:21:5 | 21 | bool, | ^^^^
missing documentation for a variant: src/datatype/primitive.rs#L20
warning: missing documentation for a variant --> src/datatype/primitive.rs:20:5 | 20 | f64, | ^^^
missing documentation for a variant: src/datatype/primitive.rs#L19
warning: missing documentation for a variant --> src/datatype/primitive.rs:19:5 | 19 | f32, | ^^^
missing documentation for a variant: src/datatype/primitive.rs#L18
warning: missing documentation for a variant --> src/datatype/primitive.rs:18:5 | 18 | usize, | ^^^^^
missing documentation for a variant: src/datatype/primitive.rs#L17
warning: missing documentation for a variant --> src/datatype/primitive.rs:17:5 | 17 | u128, | ^^^^
missing documentation for a variant: src/datatype/primitive.rs#L16
warning: missing documentation for a variant --> src/datatype/primitive.rs:16:5 | 16 | u64, | ^^^
missing documentation for a variant: src/datatype/primitive.rs#L15
warning: missing documentation for a variant --> src/datatype/primitive.rs:15:5 | 15 | u32, | ^^^
missing documentation for a variant: src/datatype/primitive.rs#L14
warning: missing documentation for a variant --> src/datatype/primitive.rs:14:5 | 14 | u16, | ^^^
missing documentation for a variant: src/datatype/primitive.rs#L13
warning: missing documentation for a variant --> src/datatype/primitive.rs:13:5 | 13 | u8, | ^^
missing documentation for a variant: src/datatype/primitive.rs#L12
warning: missing documentation for a variant --> src/datatype/primitive.rs:12:5 | 12 | isize, | ^^^^^
missing documentation for a variant: src/datatype/primitive.rs#L11
warning: missing documentation for a variant --> src/datatype/primitive.rs:11:5 | 11 | i128, | ^^^^
missing documentation for a variant: src/datatype/primitive.rs#L10
warning: missing documentation for a variant --> src/datatype/primitive.rs:10:5 | 10 | i64, | ^^^
missing documentation for a variant: src/datatype/primitive.rs#L9
warning: missing documentation for a variant --> src/datatype/primitive.rs:9:5 | 9 | i32, | ^^^
missing documentation for a variant: src/datatype/primitive.rs#L8
warning: missing documentation for a variant --> src/datatype/primitive.rs:8:5 | 8 | i16, | ^^^
missing documentation for a variant: src/datatype/primitive.rs#L7
warning: missing documentation for a variant --> src/datatype/primitive.rs:7:5 | 7 | i8, | ^^
this match could be written as a `let` statement: src/datatype/named.rs#L124
warning: this match could be written as a `let` statement --> src/datatype/named.rs:124:35 | 124 | Self::Tuple(tuple) => match tuple { | ___________________________________^ 125 | | TupleType { generics, .. } => generics.clone(), 126 | | }, | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding = note: `#[warn(clippy::match_single_binding)]` implied by `#[warn(clippy::all)]` help: consider using a `let` statement | 124 ~ Self::Tuple(tuple) => { 125 + let TupleType { generics, .. } = tuple; 126 + generics.clone() 127 ~ }, |
missing documentation for a method: src/datatype/named.rs#L62
warning: missing documentation for a method --> src/datatype/named.rs:62:5 | 62 | pub fn ext(&self) -> &Option<NamedDataTypeExt> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/named.rs#L58
warning: missing documentation for a method --> src/datatype/named.rs:58:5 | 58 | pub fn deprecated(&self) -> &Option<Cow<'static, str>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/named.rs#L54
warning: missing documentation for a method --> src/datatype/named.rs:54:5 | 54 | pub fn comments(&self) -> &Vec<Cow<'static, str>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/named.rs#L50
warning: missing documentation for a method --> src/datatype/named.rs:50:5 | 50 | pub fn name(&self) -> &Cow<'static, str> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/named.rs#L27
warning: missing documentation for a method --> src/datatype/named.rs:27:5 | 27 | pub fn export(&self) -> &Option<bool> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/named.rs#L23
warning: missing documentation for a method --> src/datatype/named.rs:23:5 | 23 | pub fn impl_location(&self) -> &ImplLocation { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/named.rs#L19
warning: missing documentation for a method --> src/datatype/named.rs:19:5 | 19 | pub fn sid(&self) -> &SpectaID { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a variant: src/datatype/enum.rs#L66
warning: missing documentation for a variant --> src/datatype/enum.rs:66:5 | 66 | Tagged(TaggedEnum), | ^^^^^^
missing documentation for a variant: src/datatype/enum.rs#L65
warning: missing documentation for a variant --> src/datatype/enum.rs:65:5 | 65 | Untagged(UntaggedEnum), | ^^^^^^^^
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true: src/datatype/enum.rs#L51
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/datatype/enum.rs:51:1 | 51 | impl Into<EnumType> for TaggedEnum { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into help: replace the `Into` implementation with `From<datatype::r#enum::TaggedEnum>` | 51 ~ impl From<TaggedEnum> for EnumType { 52 ~ fn from(val: TaggedEnum) -> Self { 53 ~ EnumType::Tagged(val) |
missing documentation for a method: src/datatype/enum.rs#L46
warning: missing documentation for a method --> src/datatype/enum.rs:46:5 | 46 | pub fn repr(&self) -> &EnumRepr { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/enum.rs#L42
warning: missing documentation for a method --> src/datatype/enum.rs:42:5 | 42 | pub fn generics(&self) -> impl Iterator<Item = &GenericType> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/enum.rs#L38
warning: missing documentation for a method --> src/datatype/enum.rs:38:5 | 38 | pub fn variants(&self) -> impl Iterator<Item = &(Cow<'static, str>, EnumVariant)> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a struct: src/datatype/enum.rs#L31
warning: missing documentation for a struct --> src/datatype/enum.rs:31:1 | 31 | pub struct TaggedEnum { | ^^^^^^^^^^^^^^^^^^^^^
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true: src/datatype/enum.rs#L24
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/datatype/enum.rs:24:1 | 24 | impl Into<EnumType> for UntaggedEnum { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into = note: `#[warn(clippy::from_over_into)]` implied by `#[warn(clippy::all)]` help: replace the `Into` implementation with `From<datatype::r#enum::UntaggedEnum>` | 24 ~ impl From<UntaggedEnum> for EnumType { 25 ~ fn from(val: UntaggedEnum) -> Self { 26 ~ EnumType::Untagged(val) |
missing documentation for a method: src/datatype/enum.rs#L19
warning: missing documentation for a method --> src/datatype/enum.rs:19:5 | 19 | pub fn generics(&self) -> impl Iterator<Item = &GenericType> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/datatype/enum.rs#L15
warning: missing documentation for a method --> src/datatype/enum.rs:15:5 | 15 | pub fn variants(&self) -> impl Iterator<Item = &EnumVariant> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a struct: src/datatype/enum.rs#L9
warning: missing documentation for a struct --> src/datatype/enum.rs:9:1 | 9 | pub struct UntaggedEnum { | ^^^^^^^^^^^^^^^^^^^^^^^ | note: the lint level is defined here --> src/lib.rs:58:58 | 58 | #![warn(clippy::all, clippy::unwrap_used, clippy::panic, missing_docs)] | ^^^^^^^^^^^^
constant `RESERVED_IDENTS` is never used: src/lang/ts/reserved_terms.rs#L66
warning: constant `RESERVED_IDENTS` is never used --> src/lang/ts/reserved_terms.rs:66:18 | 66 | pub(super) const RESERVED_IDENTS: &[&str] = &[ | ^^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default
unneeded unit return type: src/export/export.rs#L49
warning: unneeded unit return type --> src/export/export.rs:49:30 | 49 | pub fn register_ty<T: Type>() -> () { | ^^^^^^ help: remove the `-> ()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit note: the lint level is defined here --> src/lib.rs:58:9 | 58 | #![warn(clippy::all, clippy::unwrap_used, clippy::panic, missing_docs)] | ^^^^^^^^^^^ = note: `#[warn(clippy::unused_unit)]` implied by `#[warn(clippy::all)]`
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/