Skip to content

Commit

Permalink
Use scope as a documentation alias for nest_at and nest (LukeMa…
Browse files Browse the repository at this point in the history
…thWalker#227)

It should help `axum` users while they experiment with Pavex.
  • Loading branch information
LukeMathWalker authored Mar 30, 2024
1 parent a8bf063 commit 52d89f8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions libs/pavex/src/blueprint/blueprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,7 @@ impl Blueprint {
}
}

#[track_caller]
/// Nest a [`Blueprint`] under the current [`Blueprint`] (the parent), adding a common prefix to all the new routes.
/// Nest a [`Blueprint`] under the current [`Blueprint`] (the parent), adding a common prefix to all the new routes.
///
/// # Routes
///
Expand Down Expand Up @@ -629,6 +628,8 @@ impl Blueprint {
/// must be registered **exactly once** for each type.
/// If multiple nested blueprints need access to the singleton, the constructor must be
/// registered against a common parent blueprint—the root blueprint, if necessary.
#[track_caller]
#[doc(alias("scope"))]
pub fn nest_at(&mut self, prefix: &str, blueprint: Blueprint) {
self.push_component(NestedBlueprint {
blueprint: blueprint.schema,
Expand All @@ -637,10 +638,11 @@ impl Blueprint {
});
}

#[track_caller]
/// Nest a [`Blueprint`] under the current [`Blueprint`] (the parent), without adding a common prefix to all the new routes.
/// Nest a [`Blueprint`] under the current [`Blueprint`] (the parent), without adding a common prefix to all the new routes.
///
/// Check out [`Blueprint::nest_at`] for more details.
#[track_caller]
#[doc(alias("scope"))]
pub fn nest(&mut self, blueprint: Blueprint) {
self.push_component(NestedBlueprint {
blueprint: blueprint.schema,
Expand Down

0 comments on commit 52d89f8

Please sign in to comment.