Fix rustc 1.32 build
This commit is contained in:
parent
1b42dc7e3e
commit
75419fa3d5
1 changed files with 3 additions and 3 deletions
|
@ -33,8 +33,8 @@ impl ToTokens for SchemaMetadata<'_> {
|
||||||
impl<'a> SchemaMetadata<'a> {
|
impl<'a> SchemaMetadata<'a> {
|
||||||
pub fn from_attrs(attrs: &'a Attrs) -> Self {
|
pub fn from_attrs(attrs: &'a Attrs) -> Self {
|
||||||
SchemaMetadata {
|
SchemaMetadata {
|
||||||
title: attrs.title.as_deref().and_then(none_if_empty),
|
title: attrs.title.as_ref().and_then(none_if_empty),
|
||||||
description: attrs.description.as_deref().and_then(none_if_empty),
|
description: attrs.description.as_ref().and_then(none_if_empty),
|
||||||
deprecated: attrs.deprecated,
|
deprecated: attrs.deprecated,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ impl<'a> SchemaMetadata<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn none_if_empty<'a>(s: &'a str) -> Option<&'a str> {
|
fn none_if_empty<'a>(s: &'a String) -> Option<&'a str> {
|
||||||
if s.is_empty() {
|
if s.is_empty() {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue