8000 Add some minimal docs for `save_changes` · ITCSsDeveloper/diesel@fc07bb4 · GitHub
Skip to content

Commit fc07bb4

Browse files
committed
Add some minimal docs for save_changes
This documentation could be improved a lot, but we should at least say *something* about what this method does.
1 parent 38038f6 commit fc07bb4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

diesel/src/query_dsl/save_changes_dsl.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ impl<T, U> InternalSaveChangesDsl<MysqlConnection, U> for T where
5454
}
5555

5656
pub trait SaveChangesDsl<Conn> {
57+
/// Sugar for types which implement both `AsChangeset` and `Identifiable`
58+
///
59+
/// `foo.save_changes(&conn)` is equivalent to
60+
/// `update(foo::table().find(foo.id())).set(&foo).get_result(&conn)`
5761
fn save_changes<T>(self, connection: &Conn) -> QueryResult<T> where
5862
Self: InternalSaveChangesDsl<Conn, T>,
5963
{

0 commit comments

Comments
 (0)