microsoft/qdk

Public

mirrored from https://github.com/microsoft/qdkAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v1.28.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

source/compiler/qsc_data_structures/src/display.rs

20lines · modeblame

444dea81César Zaragoza Cortés2 years ago1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4use std::fmt::{self, Display, Formatter};
5
6/// Displays values separated by the provided string.
7pub fn join(
8f: &mut Formatter,
9mut vals: impl Iterator<Item = impl Display>,
10sep: &str,
11) -> fmt::Result {
12if let Some(v) = vals.next() {
13v.fmt(f)?;
14}
15for v in vals {
16write!(f, "{sep}")?;
17v.fmt(f)?;
18}
19Ok(())
20}