Generate a unique provider name by appending `-1`, `-2`, etc. if needed.
(base: &str, existing: &[String])
| 2798 | |
| 2799 | /// Generate a unique provider name by appending `-1`, `-2`, etc. if needed. |
| 2800 | fn unique_provider_name(base: &str, existing: &[String]) -> String { |
| 2801 | if !existing.iter().any(|n| n == base) { |
| 2802 | return base.to_string(); |
| 2803 | } |
| 2804 | for i in 1..100 { |
| 2805 | let candidate = format!("{base}-{i}"); |
| 2806 | if !existing.iter().any(|n| n == &candidate) { |
| 2807 | return candidate; |
| 2808 | } |
| 2809 | } |
| 2810 | base.to_string() |
| 2811 | } |
| 2812 | |
| 2813 | /// Compute a new scroll position after applying `delta`, clamped so the last |
| 2814 | /// viewport of content remains visible. |
no outgoing calls
no test coverage detected