Skip to content

Commit

Permalink
return Option<&T> instead of &Option<T>
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendonovich committed Sep 3, 2023
1 parent 5948d80 commit e1cee74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/datatype/named.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ impl NamedDataTypeExt {
&self.impl_location
}

pub fn export(&self) -> &Option<bool> {
&self.export
pub fn export(&self) -> Option<bool> {

Check warning on line 27 in src/datatype/named.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a method

warning: missing documentation for a method --> src/datatype/named.rs:27:5 | 27 | pub fn export(&self) -> Option<bool> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self.export
}
}

Expand Down Expand Up @@ -55,12 +55,12 @@ impl NamedDataType {
&self.comments
}

pub fn deprecated(&self) -> &Option<Cow<'static, str>> {
&self.deprecated
pub fn deprecated(&self) -> Option<&Cow<'static, str>> {

Check warning on line 58 in src/datatype/named.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a method

warning: missing documentation for a method --> src/datatype/named.rs:58:5 | 58 | pub fn deprecated(&self) -> Option<&Cow<'static, str>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self.deprecated.as_ref()
}

pub fn ext(&self) -> &Option<NamedDataTypeExt> {
&self.ext
pub fn ext(&self) -> Option<&NamedDataTypeExt> {

Check warning on line 62 in src/datatype/named.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a method

warning: missing documentation for a method --> src/datatype/named.rs:62:5 | 62 | pub fn ext(&self) -> Option<&NamedDataTypeExt> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self.ext.as_ref()
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/datatype/struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ impl StructType {
self.fields.iter()
}

pub fn tag(&self) -> &Option<Cow<'static, str>> {
&self.tag
pub fn tag(&self) -> Option<&Cow<'static, str>> {

Check warning on line 68 in src/datatype/struct.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a method

warning: missing documentation for a method --> src/datatype/struct.rs:68:5 | 68 | pub fn tag(&self) -> Option<&Cow<'static, str>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self.tag.as_ref()
}
}

Expand Down

0 comments on commit e1cee74

Please sign in to comment.