|
1 | 1 | // Copyright (c) Microsoft Corporation. |
2 | 2 | // Licensed under the MIT License. |
3 | 3 |
|
| 4 | +// TODO: Remove when updating to rustc 1.94; false positive from thiserror + rust-i18n t!() macro |
| 5 | +#![allow(unused_assignments)] |
| 6 | + |
4 | 7 | use std::fmt::{Display, Formatter}; |
5 | 8 | use std::hash::Hash; |
6 | 9 | use std::ops::Deref; |
@@ -223,7 +226,7 @@ pub enum FullyQualifiedTypeNameError { |
223 | 226 | /// |
224 | 227 | /// If the fully qualified type name contains any empty namespace segments, validation raises |
225 | 228 | /// this error in the `errors` field of the main [`InvalidTypeName`] error. |
226 | | - /// |
| 229 | + /// |
227 | 230 | /// [`InvalidTypeName`]: Self::InvalidTypeName |
228 | 231 | #[error("{t}", t = t!( |
229 | 232 | "types.fully_qualified_type_name.emptyNamespaceSegment", |
@@ -384,7 +387,7 @@ impl FullyQualifiedTypeName { |
384 | 387 | /// } |
385 | 388 | /// ); |
386 | 389 | /// ``` |
387 | | - /// |
| 390 | + /// |
388 | 391 | /// - An empty namespace segment is not valid. |
389 | 392 | /// |
390 | 393 | /// ```rust |
@@ -437,21 +440,21 @@ impl FullyQualifiedTypeName { |
437 | 440 |
|
438 | 441 | /// Private helper to parse the input into segments and collect validation errors for owner |
439 | 442 | /// and namespace segments. |
440 | | - /// |
| 443 | + /// |
441 | 444 | /// This is used by the public `parse()` method to handle the common parsing and validation |
442 | 445 | /// logic that is shared by [`FullyQualifiedTypeName`] and [`WildcardTypeName`] since they |
443 | 446 | /// share the same overall structure. |
444 | | - /// |
| 447 | + /// |
445 | 448 | /// # Arguments |
446 | | - /// |
| 449 | + /// |
447 | 450 | /// - `text`: The input string to parse into type name segments. |
448 | 451 | /// - `validating_segment_regex`: The regex to use for validating each segment of the type name. |
449 | 452 | /// - `errors`: A mutable reference to a vector for collecting any validation errors encountered |
450 | 453 | /// while parsing the segments. This allows the method to accumulate multiple errors for |
451 | 454 | /// different segments of the type name. |
452 | | - /// |
| 455 | + /// |
453 | 456 | /// # Returns |
454 | | - /// |
| 457 | + /// |
455 | 458 | /// The method returns the parsed segments (`owner`, `namespaces`, and `name`) as a tuple. Any |
456 | 459 | /// validation errors encountered during parsing are added to the provided `errors` vector for |
457 | 460 | /// the caller to handle. |
@@ -535,7 +538,7 @@ impl FullyQualifiedTypeName { |
535 | 538 | /// number of `namespace` segments, which must be separated from the previous segment by a |
536 | 539 | /// single period (`.`). Finally, the string must include a forward slash (`/`) followed by one |
537 | 540 | /// or more unicode alphanumeric characters and underscores to define the `name` segment. |
538 | | - /// |
| 541 | + /// |
539 | 542 | /// [`VALIDATING_SEGMENT_PATTERN`]: Self::VALIDATING_SEGMENT_PATTERN |
540 | 543 | pub const VALIDATING_PATTERN: &str = r"^\w+(\.\w+)*\/\w+$"; |
541 | 544 |
|
|
0 commit comments