Merge pull request #429 from zicklag/master
Improve Resolver Method Return Type Error
This commit is contained in:
commit
938bf83768
@ -57,7 +57,11 @@ pub fn generate(
|
|||||||
let ty = match &method.sig.output {
|
let ty = match &method.sig.output {
|
||||||
ReturnType::Type(_, ty) => OutputType::parse(ty)?,
|
ReturnType::Type(_, ty) => OutputType::parse(ty)?,
|
||||||
ReturnType::Default => {
|
ReturnType::Default => {
|
||||||
return Err(Error::new_spanned(&method.sig.output, "Missing type").into())
|
return Err(Error::new_spanned(
|
||||||
|
&method.sig.output,
|
||||||
|
"Resolver must have a return type",
|
||||||
|
)
|
||||||
|
.into())
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let mut create_ctx = true;
|
let mut create_ctx = true;
|
||||||
@ -246,7 +250,11 @@ pub fn generate(
|
|||||||
let ty = match &method.sig.output {
|
let ty = match &method.sig.output {
|
||||||
ReturnType::Type(_, ty) => OutputType::parse(ty)?,
|
ReturnType::Type(_, ty) => OutputType::parse(ty)?,
|
||||||
ReturnType::Default => {
|
ReturnType::Default => {
|
||||||
return Err(Error::new_spanned(&method.sig.output, "Missing type").into())
|
return Err(Error::new_spanned(
|
||||||
|
&method.sig.output,
|
||||||
|
"Resolver must have a return type",
|
||||||
|
)
|
||||||
|
.into())
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let cache_control = {
|
let cache_control = {
|
||||||
|
@ -68,7 +68,11 @@ pub fn generate(
|
|||||||
let ty = match &method.sig.output {
|
let ty = match &method.sig.output {
|
||||||
ReturnType::Type(_, ty) => OutputType::parse(ty)?,
|
ReturnType::Type(_, ty) => OutputType::parse(ty)?,
|
||||||
ReturnType::Default => {
|
ReturnType::Default => {
|
||||||
return Err(Error::new_spanned(&method.sig.output, "Missing type").into())
|
return Err(Error::new_spanned(
|
||||||
|
&method.sig.output,
|
||||||
|
"Resolver must have a return type",
|
||||||
|
)
|
||||||
|
.into())
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user