Skip to content

Commit d7232c2

Browse files
committed
Fix inline URLs in documentation comments
1 parent 86143b0 commit d7232c2

File tree

12 files changed

+55
-55
lines changed

12 files changed

+55
-55
lines changed

constraints/src/algorithms/fitness_distance.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ fn is_nearly_equal_to(actual: f64, exact: f64) -> bool {
7070

7171
fn relative_fitness_distance(actual: f64, ideal: f64) -> f64 {
7272
// As specified in step 7 of the `fitness distance` algorithm:
73-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
73+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
7474
//
7575
// > For all positive numeric constraints […],
7676
// > the fitness distance is the result of the formula

constraints/src/algorithms/fitness_distance/empty_constraint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ impl<'a, T> FitnessDistance<Option<&'a T>> for EmptyConstraint {
77

88
fn fitness_distance(&self, _setting: Option<&'a T>) -> Result<f64, Self::Error> {
99
// As specified in step 1 of the `SelectSettings` algorithm:
10-
// https://www.w3.org/TR/mediacapture-streams/#dfn-selectsettings
10+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-selectsettings>
1111
//
1212
// > If an empty list has been given as the value for a constraint,
1313
// > it MUST be interpreted as if the constraint were not specified

constraints/src/algorithms/fitness_distance/setting.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ mod tests {
124124
#[test]
125125
fn empty_constraint() {
126126
// As per step 1 of the `SelectSettings` algorithm from the W3C spec:
127-
// https://www.w3.org/TR/mediacapture-streams/#dfn-selectsettings
127+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-selectsettings>
128128
//
129129
// > Each constraint specifies one or more values (or a range of values) for its property.
130130
// > A property MAY appear more than once in the list of 'advanced' ConstraintSets.
@@ -157,7 +157,7 @@ mod tests {
157157
#[test]
158158
fn bool_setting() {
159159
// As per step 8 of the `fitness distance` function from the W3C spec:
160-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
160+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
161161
//
162162
// > For all string, enum and boolean constraints
163163
// > (e.g. deviceId, groupId, facingMode, resizeMode, echoCancellation),
@@ -192,7 +192,7 @@ mod tests {
192192
#[test]
193193
fn non_bool_settings() {
194194
// As per step 4 of the `fitness distance` function from the W3C spec:
195-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
195+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
196196
//
197197
// > If constraintValue is a boolean, but the constrainable property is not,
198198
// > then the fitness distance is based on whether the settings dictionary's
@@ -238,7 +238,7 @@ mod tests {
238238
#[test]
239239
fn missing_settings() {
240240
// As per step 5 of the `fitness distance` function from the W3C spec:
241-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
241+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
242242
//
243243
// > If the settings dictionary's constraintName member does not exist,
244244
// > the fitness distance is 1.
@@ -270,7 +270,7 @@ mod tests {
270270
#[test]
271271
fn compatible_settings() {
272272
// As per step 7 of the `fitness distance` function from the W3C spec:
273-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
273+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
274274
//
275275
// > For all positive numeric constraints
276276
// > (such as height, width, frameRate, aspectRatio, sampleRate and sampleSize),
@@ -314,7 +314,7 @@ mod tests {
314314
#[test]
315315
fn incompatible_settings() {
316316
// As per step 3 of the `fitness distance` function from the W3C spec:
317-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
317+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
318318
//
319319
// > If the constraint does not apply for this type of object, the fitness distance is 0
320320
// > (that is, the constraint does not influence the fitness distance).
@@ -364,7 +364,7 @@ mod tests {
364364
#[test]
365365
fn missing_settings() {
366366
// As per step 5 of the `fitness distance` function from the W3C spec:
367-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
367+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
368368
//
369369
// > If the settings dictionary's constraintName member does not exist,
370370
// > the fitness distance is 1.
@@ -384,7 +384,7 @@ mod tests {
384384
#[test]
385385
fn compatible_settings() {
386386
// As per step 8 of the `fitness distance` function from the W3C spec:
387-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
387+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
388388
//
389389
// > For all string, enum and boolean constraints
390390
// > (e.g. deviceId, groupId, facingMode, resizeMode, echoCancellation),
@@ -413,7 +413,7 @@ mod tests {
413413
#[test]
414414
fn incompatible_settings() {
415415
// As per step 3 of the `fitness distance` function from the W3C spec:
416-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
416+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
417417
//
418418
// > If the constraint does not apply for this type of object, the fitness distance is 0
419419
// > (that is, the constraint does not influence the fitness distance).
@@ -452,7 +452,7 @@ mod tests {
452452
#[test]
453453
fn missing_settings() {
454454
// As per step 5 of the `fitness distance` function from the W3C spec:
455-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
455+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
456456
//
457457
// > If the settings dictionary's constraintName member does not exist,
458458
// > the fitness distance is 1.
@@ -473,7 +473,7 @@ mod tests {
473473
#[test]
474474
fn compatible_settings() {
475475
// As per step 8 of the `fitness distance` function from the W3C spec:
476-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
476+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
477477
//
478478
// > For all string, enum and boolean constraints
479479
// > (e.g. deviceId, groupId, facingMode, resizeMode, echoCancellation),
@@ -508,7 +508,7 @@ mod tests {
508508
#[test]
509509
fn incompatible_settings() {
510510
// As per step 3 of the `fitness distance` function from the W3C spec:
511-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
511+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
512512
//
513513
// > If the constraint does not apply for this type of object, the fitness distance is 0
514514
// > (that is, the constraint does not influence the fitness distance).

constraints/src/algorithms/fitness_distance/value_constraint.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ macro_rules! impl_non_numeric_value_constraint {
1717
fn fitness_distance(&self, setting: Option<&'a $s>) -> Result<f64, Self::Error> {
1818
if let Some(exact) = self.exact.as_ref() {
1919
// As specified in step 2 of the `fitness distance` algorithm:
20-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
20+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
2121
//
2222
// > If the constraint is required (constraintValue either contains
2323
// > one or more members named […] 'exact' […]), and the settings
@@ -46,7 +46,7 @@ macro_rules! impl_non_numeric_value_constraint {
4646
match setting {
4747
Some(actual) if actual == ideal => {
4848
// As specified in step 8 of the `fitness distance` algorithm:
49-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
49+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
5050
//
5151
// > For all string, enum and boolean constraints […],
5252
// > the fitness distance is the result of the formula:
@@ -58,7 +58,7 @@ macro_rules! impl_non_numeric_value_constraint {
5858
}
5959
_ => {
6060
// As specified in step 5 of the `fitness distance` algorithm:
61-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
61+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
6262
//
6363
// > If the settings dictionary's `constraintName` member
6464
// > does not exist, the fitness distance is 1.
@@ -67,7 +67,7 @@ macro_rules! impl_non_numeric_value_constraint {
6767
}
6868
} else {
6969
// As specified in step 6 of the `fitness distance` algorithm:
70-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
70+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
7171
//
7272
// > If no ideal value is specified (constraintValue either
7373
// > contains no member named 'ideal', or, if bare values are to be
@@ -92,7 +92,7 @@ macro_rules! impl_numeric_value_constraint {
9292
fn fitness_distance(&self, setting: Option<&'a $s>) -> Result<f64, Self::Error> {
9393
if let Some(exact) = self.exact {
9494
// As specified in step 2 of the `fitness distance` algorithm:
95-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
95+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
9696
//
9797
// > If the constraint is required (constraintValue either contains
9898
// > one or more members named […] 'exact' […]), and the settings
@@ -124,7 +124,7 @@ macro_rules! impl_numeric_value_constraint {
124124
let actual: f64 = actual as f64;
125125
let ideal: f64 = ideal as f64;
126126
// As specified in step 7 of the `fitness distance` algorithm:
127-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
127+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
128128
//
129129
// > For all positive numeric constraints […],
130130
// > the fitness distance is the result of the formula
@@ -136,7 +136,7 @@ macro_rules! impl_numeric_value_constraint {
136136
}
137137
None => {
138138
// As specified in step 5 of the `fitness distance` algorithm:
139-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
139+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
140140
//
141141
// > If the settings dictionary's `constraintName` member
142142
// > does not exist, the fitness distance is 1.
@@ -145,7 +145,7 @@ macro_rules! impl_numeric_value_constraint {
145145
}
146146
} else {
147147
// As specified in step 6 of the `fitness distance` algorithm:
148-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
148+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
149149
//
150150
// > If no ideal value is specified (constraintValue either
151151
// > contains no member named 'ideal', or, if bare values are to be
@@ -185,7 +185,7 @@ macro_rules! impl_exists_value_constraint {
185185
// For all other configurations we just interpret it as an incompatible constraint.
186186
match self.exact {
187187
// As specified in step 4 of the `fitness distance` algorithm:
188-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
188+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
189189
//
190190
// > If constraintValue is a boolean, but the constrainable property is not,
191191
// > then the fitness distance is based on whether the settings dictionary's
@@ -202,7 +202,7 @@ macro_rules! impl_exists_value_constraint {
202202
}
203203
}
204204
// As specified in step 3 of the `fitness distance` algorithm:
205-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
205+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
206206
//
207207
// > If the constraint does not apply for this type of object,
208208
// > the fitness distance is 0 (that is, the constraint does not

constraints/src/algorithms/fitness_distance/value_constraint/tests/bool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ mod required {
155155

156156
// Required boolean constraints have specialized logic as per
157157
// rule 4 of the fitness distance algorithm specification:
158-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
158+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
159159

160160
mod specialization {
161161
use super::*;

constraints/src/algorithms/fitness_distance/value_range_constraint.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ macro_rules! impl_value_range_constraint {
1212
fn fitness_distance(&self, setting: Option<&'a $s>) -> Result<f64, Self::Error> {
1313
if let Some(exact) = self.exact {
1414
// As specified in step 2 of the `fitness distance` algorithm:
15-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
15+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
1616
//
1717
// > If the constraint is required (constraintValue either contains
1818
// > one or more members named […] 'exact' […]), and the settings
@@ -40,7 +40,7 @@ macro_rules! impl_value_range_constraint {
4040

4141
if let Some(min) = self.min {
4242
// As specified in step 2 of the `fitness distance` algorithm:
43-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
43+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
4444
//
4545
// > If the constraint is required (constraintValue either contains
4646
// > one or more members named […] 'min' […]), and the settings
@@ -71,7 +71,7 @@ macro_rules! impl_value_range_constraint {
7171

7272
if let Some(max) = self.max {
7373
// As specified in step 2 of the `fitness distance` algorithm:
74-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
74+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
7575
//
7676
// > If the constraint is required (constraintValue either contains
7777
// > one or more members named […] 'max' […]), and the settings
@@ -106,7 +106,7 @@ macro_rules! impl_value_range_constraint {
106106
let actual: f64 = actual as f64;
107107
let ideal: f64 = ideal as f64;
108108
// As specified in step 7 of the `fitness distance` algorithm:
109-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
109+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
110110
//
111111
// > For all positive numeric constraints […],
112112
// > the fitness distance is the result of the formula
@@ -118,7 +118,7 @@ macro_rules! impl_value_range_constraint {
118118
}
119119
None => {
120120
// As specified in step 5 of the `fitness distance` algorithm:
121-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
121+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
122122
//
123123
// > If the settings dictionary's `constraintName` member
124124
// > does not exist, the fitness distance is 1.
@@ -127,7 +127,7 @@ macro_rules! impl_value_range_constraint {
127127
}
128128
} else {
129129
// As specified in step 6 of the `fitness distance` algorithm:
130-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
130+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
131131
//
132132
// > If no ideal value is specified (constraintValue either
133133
// > contains no member named 'ideal', or, if bare values are to be
@@ -156,7 +156,7 @@ macro_rules! impl_ignored_value_range_constraint {
156156

157157
fn fitness_distance(&self, _setting: Option<&'a $s>) -> Result<f64, Self::Error> {
158158
// As specified in step 3 of the `fitness distance` algorithm:
159-
// https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance
159+
// <https://www.w3.org/TR/mediacapture-streams/#dfn-fitness-distance>
160160
//
161161
// > If the constraint does not apply for this type of object,
162162
// > the fitness distance is 0 (that is, the constraint does not

0 commit comments

Comments
 (0)