Page MenuHomeDevCentral

D4154.id10887.diff
No OneTemporary

D4154.id10887.diff

diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@
| Rocket 0.4 | limiting-factor v0.8.0 | nightly-2024-12-15 |
| Rocket 0.5 | - | *not yet supported.* |
-(1) Build of Rocket 0.3 seems to be tricky and require custom dependencies:
+(1) Build of Rocket 0.3 seems to be tricky and requires custom dependencies:
rocket v0.3.16 or v0.3.17 -> cookie v0.9.1 -> ring v0.11.0, a yanked crate
## Compile
diff --git a/axum/src/api/mod.rs b/axum/src/api/mod.rs
--- a/axum/src/api/mod.rs
+++ b/axum/src/api/mod.rs
@@ -7,7 +7,7 @@
//! # Utilities for API.
//!
-//! This module provides useful code to create easily APIs.
+//! This module provides useful code to easily create APIs.
/* -------------------------------------------------------------
Public submodules offered by this module
diff --git a/axum/src/api/replies.rs b/axum/src/api/replies.rs
--- a/axum/src/api/replies.rs
+++ b/axum/src/api/replies.rs
@@ -21,7 +21,7 @@
pub type ApiJsonResponse<T> = Result<Json<T>, (StatusCode, Json<String>)>;
-/// This trait allows to consume an object into an HTTP response.
+/// This trait allows consuming an object into an HTTP response.
pub trait ApiResponse<T> {
/// Consumes the value and creates a JSON or a Status result response.
fn into_json_response(self) -> ApiJsonResponse<T>;
diff --git a/core/src/api/mod.rs b/core/src/api/mod.rs
--- a/core/src/api/mod.rs
+++ b/core/src/api/mod.rs
@@ -7,7 +7,7 @@
//! # Utilities for API.
//!
-//! This module provides useful code to create easily APIs.
+//! This module provides useful code to easily create APIs.
/* -------------------------------------------------------------
Public submodules offered by this module
diff --git a/rocket-legacy/README.md b/rocket-legacy/README.md
--- a/rocket-legacy/README.md
+++ b/rocket-legacy/README.md
@@ -5,7 +5,7 @@
Limiting Factor has first been designed for Rocket 0.3.
That version didn't include any database support,
-so we wanted to include it as into a helper library.
+so we wanted to include it as in a helper library.
Afterwards, we've found convenient to add for API:
- save boilerplate code to initialize the framework
@@ -14,8 +14,8 @@
### Build
-The last version known to be able to build Rocket 0.4 has been identified
-by dichotomic search to be rustc 1.85.0-nightly (0aeaa5eb2 2024-12-14).
+Dichotomic search has identified the last version known to be able
+to build Rocket 0.4 to be rustc 1.85.0-nightly (0aeaa5eb2 2024-12-14).
You can install and use it with:
diff --git a/rocket-legacy/src/api/mod.rs b/rocket-legacy/src/api/mod.rs
--- a/rocket-legacy/src/api/mod.rs
+++ b/rocket-legacy/src/api/mod.rs
@@ -1,6 +1,6 @@
//! # Utilities for API.
//!
-//! This module provides useful code to create easily APIs.
+//! This module provides useful code to easily create APIs.
/* -------------------------------------------------------------
Public submodules offered by this module
diff --git a/rocket-legacy/src/api/replies.rs b/rocket-legacy/src/api/replies.rs
--- a/rocket-legacy/src/api/replies.rs
+++ b/rocket-legacy/src/api/replies.rs
@@ -27,7 +27,7 @@
:: Implementation for Serialize (Serde)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-/// This trait allows to consume an object into an HTTP response.
+/// This trait allows consuming an object into an HTTP response.
pub trait ApiResponse<T> {
/// Consumes the value and creates a JSON or a Status result response.
fn into_json_response(self) -> ApiJsonResponse<T>;
@@ -38,7 +38,7 @@
/// Prepares an API response from a query result.
///
/// The result is the data structure prepared by the Diesel ORM after a SELECT query
- /// with one result, for example using `first` method. You can also you use it to
+ /// with one result, for example, using `first` method. You can also you use it to
/// parse the returning result (... RETURNING *), which is a default for Diesel after
/// an INSERT query.
///
@@ -91,13 +91,13 @@
/// If there is any other database issue, it returns a 500.
fn into_json_response(self) -> ApiJsonResponse<T> {
self
- // CASE I - The query returns one value, we return a JSON representation fo the item
+ // CASE I - The query returns one value, we return a JSON representation for the item
.map(|item| Json(item))
.map_err(|error| match error {
// Case II - The query returns no result, we return a 404 Not found response
ResultError::NotFound => Status::NotFound,
- // Case III - We need to handle a database error, which could be a 400/409/500
+ // Case III - We need to handle a database error, which could be a 400/409/500
ResultError::DatabaseError(kind, details) => {
build_database_error_response(kind, details)
}
@@ -138,9 +138,9 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#[cfg(feature = "pgsql")]
-/// This trait allows to consume an object into an HTTP response.
+/// This trait allows consuming an object into an HTTP response.
///
-/// This response is a odd case for DELETE queries, which return
+/// This response is an odd case for DELETE queries, which return
/// a scalar with the rows deleted count value, or an error.
pub trait ApiDeleteResponse<T> {
/// Consumes the value and creates a JSON or a Status result response.
@@ -164,9 +164,9 @@
:: Implementation for diesel::result::Error
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-/// This trait allows to consume an object into an HTTP failure response.
+/// This trait allows consuming an object into an HTTP failure response.
pub trait FailureResponse {
- /// Consumes the variable and creates a Failure response .
+ /// Consumes the variable and creates a Failure response.
fn into_failure_response(self) -> Status;
}
@@ -201,13 +201,13 @@
#[cfg(feature = "pgsql")]
fn build_database_error_response(error_kind: DatabaseErrorKind, info: Box<dyn DatabaseErrorInformation>) -> Status {
match error_kind {
- // Case IIIa - The query tries to do an INSERT violating an unique constraint
+ // Case IIIa - The query tries to do an INSERT violating a unique constraint
// e.g. two INSERT with the same unique value
// We return a 409 Conflict
DatabaseErrorKind::UniqueViolation => Status::Conflict,
// Case IIIb - The query violated a foreign key constraint
- // e.g. an INSERT referring to a non existing user 1004
+ // e.g. an INSERT referring to a non-existing user 1004
// when there is no id 1004 in users table
// We return a 400 Bad request
DatabaseErrorKind::ForeignKeyViolation => Status::BadRequest,
diff --git a/rocket-legacy/src/config.rs b/rocket-legacy/src/config.rs
--- a/rocket-legacy/src/config.rs
+++ b/rocket-legacy/src/config.rs
@@ -1,6 +1,6 @@
//! # Service configuration.
//!
-//! This module allows to configure the service.
+//! This module allows configuring the service.
//!
//! It provides a Config trait to build custom configuration implementation.
//!
@@ -19,7 +19,7 @@
Config trait
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-/// This trait allows to provide a configuration for the resources needed by the API.
+/// This trait allows providing a configuration for the resources needed by the API.
pub trait Config {
fn get_database_url(&self) -> &str;
fn get_entry_point(&self) -> &str;
@@ -32,7 +32,7 @@
EnvironmentConfigurable
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-/// This trait allows to configure the object from the environment
+/// This trait allows configuring the object from the environment
pub trait EnvironmentConfigurable {
fn parse_environment() -> ErrorResult<Self> where Self: Sized;
}
@@ -44,7 +44,7 @@
:: sui generis implementation
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-/// This is a default implementation of the `Config` trait, which extracts the following variables
+/// This is a default implementation of the `Config` trait, which extracts the following variables
/// from an .env file or environment:
///
/// - `API_ENTRY_POINT` (facultative, by default `/`): the mounting point of the API methods
diff --git a/rocket-legacy/src/database.rs b/rocket-legacy/src/database.rs
--- a/rocket-legacy/src/database.rs
+++ b/rocket-legacy/src/database.rs
@@ -83,9 +83,9 @@
.build(manager)
}
-/// Allows to test if it's possible to establish a connection to the database.
+/// Allows testing if it's possible to establish a connection to the database.
///
-/// The goal is to test early any issue with the connection, and loudly warn or fail
+/// The goal is to test early any issue with the connection and loudly warn or fail
/// if the database can't be reached.
///
/// # Examples
diff --git a/rocket-legacy/src/kernel.rs b/rocket-legacy/src/kernel.rs
--- a/rocket-legacy/src/kernel.rs
+++ b/rocket-legacy/src/kernel.rs
@@ -97,7 +97,7 @@
Allow to define config and routes. Launch a server.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-/// The minimal service allows to spawn a server without any extra feature.
+/// The minimal service allows spawning a server without any extra feature.
pub struct MinimalService {
pub config: MinimalConfig,
pub routes: Vec<Route>,
@@ -129,11 +129,11 @@
:: sui generis implementation
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-/// The application structure allows to encapsulate the service into a CLI application.
+/// The application structure allows encapsulating the service into a CLI application.
///
/// The application takes care to run the service and quits with a correct exit code.
///
-/// It also takes care of initialisation logic like parse the environment to extract
+/// It also takes care of initialisation logic like parsing the environment to extract
/// the configuration.
pub struct Application<U>
where U: Config
diff --git a/rocket-legacy/src/lib.rs b/rocket-legacy/src/lib.rs
--- a/rocket-legacy/src/lib.rs
+++ b/rocket-legacy/src/lib.rs
@@ -29,7 +29,7 @@
//! }
//! ```
//!
-//! Replacing `DefaultApplication` by `MinimalApplication` allows to use a lighter version
+//! Replacing `DefaultApplication` by `MinimalApplication` allows using a lighter version
//! of the library without Diesel dependencies or database use.
#[cfg(feature = "pgsql")]

File Metadata

Mime Type
text/plain
Expires
Tue, Aug 11, 13:51 (14 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3984275
Default Alt Text
D4154.id10887.diff (10 KB)

Event Timeline