summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--content/code/entities-as-dependencies.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/content/code/entities-as-dependencies.md b/content/code/entities-as-dependencies.md
index 95bec71..874080b 100644
--- a/content/code/entities-as-dependencies.md
+++ b/content/code/entities-as-dependencies.md
@@ -13,7 +13,7 @@ Recently I've found myself trying to address a collection of needs related to da
The external world references entities by key, not by value, for fairly boring practical reasons. Data access code frequently needs to deal with records that contain those keys, but also deal with underlying data stores that will enforce constraints on the values those keys can have.
```rust
-pub fn create_message(&mut self, username: String, body: String) -> Result<Message>
+pub fn create(&mut self, username: String, body: String) -> Result<Message>
```
The example above is the signature (in Rust) for a hypothetical database accessor function that writes a new row to a table containing two columns. If the `user` column must reference a row in the `user` table by ID, then this function has a constraint: it must be called with a "valid" `user`, or it will return an error.