Page MenuHomePhabricator

D4656.id15069.diff
No OneTemporary

D4656.id15069.diff

diff --git a/services/identity/src/database.rs b/services/identity/src/database.rs
--- a/services/identity/src/database.rs
+++ b/services/identity/src/database.rs
@@ -400,6 +400,25 @@
}
}
+fn parse_string_attribute(
+ attribute_name: &'static str,
+ attribute_value: Option<AttributeValue>,
+) -> Result<String, DBItemError> {
+ match attribute_value {
+ Some(AttributeValue::S(user_id)) => Ok(user_id),
+ Some(_) => Err(DBItemError::new(
+ attribute_name,
+ attribute_value,
+ DBItemAttributeError::IncorrectType,
+ )),
+ None => Err(DBItemError::new(
+ attribute_name,
+ attribute_value,
+ DBItemAttributeError::Missing,
+ )),
+ }
+}
+
#[cfg(test)]
mod tests {
use super::*;

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 1, 1:40 AM (22 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2603197
Default Alt Text
D4656.id15069.diff (738 B)

Event Timeline