@@ -53,15 +53,12 @@ impl std::str::FromStr for Fragment {
53
53
let mut when = None ;
54
54
55
55
for part in split_on_unescaped_ampersand ( fragment) {
56
+ // If there isn't an equals in this part we skip it as it doesn't contain any data.
56
57
if let Some ( ( key, value) ) = split_at_first_unescaped_equals ( part) {
57
58
match key {
58
59
"selection" => match value. parse ( ) {
59
60
Ok ( path) => {
60
- if selection. is_some ( ) {
61
- re_log:: warn_once!(
62
- "Multiple paths set in uri #fragment {fragment:?}. Ignoring all but last."
63
- ) ;
64
- }
61
+ // If there were selection fragments before this we override them.
65
62
selection = Some ( path) ;
66
63
}
67
64
Err ( err) => {
@@ -73,11 +70,7 @@ impl std::str::FromStr for Fragment {
73
70
let timeline = TimelineName :: from ( timeline) ;
74
71
match time. parse :: < TimeCell > ( ) {
75
72
Ok ( time_cell) => {
76
- if when. is_some ( ) {
77
- re_log:: warn_once!(
78
- "Multiple times set in uri #fragment {fragment:?}. Ignoring all but last."
79
- ) ;
80
- }
73
+ // If there were when fragments before this we ignore them.
81
74
when = Some ( ( timeline, time_cell) ) ;
82
75
}
83
76
Err ( err) => {
@@ -92,8 +85,6 @@ impl std::str::FromStr for Fragment {
92
85
) ) ;
93
86
}
94
87
}
95
- } else {
96
- re_log:: warn_once!( "Contained a part {part:?} without any equal sign in it" ) ;
97
88
}
98
89
}
99
90
@@ -102,15 +93,11 @@ impl std::str::FromStr for Fragment {
102
93
}
103
94
104
95
impl Fragment {
105
- /// Parse fragment, excluding hash
96
+ /// Parse fragment, excluding hash.
97
+ ///
98
+ /// Returns `Fragment::default()` if parsing fails.
106
99
pub fn parse_forgiving ( fragment : & str ) -> Self {
107
- match fragment. parse ( ) {
108
- Ok ( fragment) => fragment,
109
- Err ( err) => {
110
- re_log:: warn_once!( "Failed to parse #fragment {fragment:?}: {err}" ) ;
111
- Self :: default ( )
112
- }
113
- }
100
+ fragment. parse ( ) . unwrap_or_default ( )
114
101
}
115
102
116
103
/// True if this fragment doesn't contain any information.
0 commit comments