Added some notes about observed behavior and fixed return types for missing/absent keys.
This commit is contained in:
@@ -733,7 +733,12 @@ impl<'a> DustRenderer<'a> {
|
||||
.map(|ce| ce.get_size())
|
||||
});
|
||||
match value_ce {
|
||||
None | Some(Err(_)) | Some(Ok(None)) => return Ok("".to_owned()),
|
||||
// If we found the key but could not get the size from it, render nothing.
|
||||
Some(Ok(None)) => return Ok("".to_owned()),
|
||||
// If "key" is not on the @size tag at all, render 0.
|
||||
None => return Ok("0".to_owned()),
|
||||
// If the key value could not be found in the context, render 0.
|
||||
Some(Err(_)) => return Ok("0".to_owned()),
|
||||
Some(Ok(Some(ce_size))) => {
|
||||
return ce_size.get_context_element_reference().render(&Vec::new())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user