Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
weiznich committed Jan 11, 2023
1 parent 6921fe2 commit 076ea8a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
11 changes: 8 additions & 3 deletions diesel/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,13 +506,18 @@ impl<DB: Backend + 'static> dyn BoxableConnection<DB> {
}
}

// These traits are not part of the public API
// because we want to replace them by with an associated type
// in the child trait later if GAT's are finally stable
// These traits are considered private for different reasons:
//
// `ConnectionSealed` to control who can implement `Connection`,
// so that we can later change the `Connection` trait
//
// `MultiConnectionHelper` is a workaround needed for the
// `MultiConnection` derive. We might stabilize this trait with
// the corresponding derive
//
// `ConnectionHelperType` as a workaround for the `LoadRowIter`
// type def. That trait should not be used by any user outside of diesel,
// it purely exists for backward compatibility reasons.
pub(crate) mod private {

/// This trait restricts who can implement `Connection`
Expand Down
1 change: 1 addition & 0 deletions diesel/src/query_dsl/load_dsl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub(crate) use self::private::CompatibleType;
///
/// [`RunQueryDsl`]: crate::RunQueryDsl
pub trait LoadQuery<'query, Conn, U, B = DefaultLoadingMode>: RunQueryDsl<Conn> {
/// Return type of `LoadQuery::internal_load`
type RowIter<'conn>: Iterator<Item = QueryResult<U>>
where
Conn: 'conn;
Expand Down
8 changes: 5 additions & 3 deletions diesel/src/row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub trait Row<'a, DB: Backend>:
{
/// Field type returned by a `Row` implementation
///
/// * Crates using existing backend should not concern themself with the
/// * Crates using existing backends should not concern themself with the
/// concrete type of this associated type.
///
/// * Crates implementing custom backends should provide their own type
Expand Down Expand Up @@ -148,8 +148,10 @@ where
}

// These traits are not part of the public API
// because we want to replace them by with an associated type
// in the child trait later if GAT's are finally stable
// because:
// * we want to control who can implment `Row` (for `RowSealed`)
// * `PartialRow` is an implementation detail
// * `RowLifetimeHelper` is an internal backward compatibility helper
pub(crate) mod private {
use super::*;

Expand Down

0 comments on commit 076ea8a

Please sign in to comment.