Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 0.2.0

## Changed
- Several `T: ToString` bounds were changed to `T: Into<String>`.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ariadne"
version = "0.1.5"
version = "0.2.0"
description = "A fancy diagnostics & reporting crate"
authors = ["Joshua Barretto <joshua.s.barretto@gmail.com>"]
license = "MIT"
Expand Down
24 changes: 12 additions & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ impl<S> Label<S> {
}

/// Give this label a message.
pub fn with_message<M: ToString>(mut self, msg: M) -> Self {
self.msg = Some(msg.to_string());
pub fn with_message<M: Into<String>>(mut self, msg: M) -> Self {
self.msg = Some(msg.into());
self
}

Expand Down Expand Up @@ -215,34 +215,34 @@ impl<S: Span> ReportBuilder<S> {
}

/// Set the message of this report.
pub fn set_message<M: ToString>(&mut self, msg: M) {
self.msg = Some(msg.to_string());
pub fn set_message<M: Into<String>>(&mut self, msg: M) {
self.msg = Some(msg.into());
}

/// Add a message to this report.
pub fn with_message<M: ToString>(mut self, msg: M) -> Self {
self.msg = Some(msg.to_string());
pub fn with_message<M: Into<String>>(mut self, msg: M) -> Self {
self.msg = Some(msg.into());
self
}

/// Set the note of this report.
pub fn set_note<N: ToString>(&mut self, note: N) {
self.note = Some(note.to_string());
pub fn set_note<N: Into<String>>(&mut self, note: N) {
self.note = Some(note.into());
}

/// Set the note of this report.
pub fn with_note<N: ToString>(mut self, note: N) -> Self {
pub fn with_note<N: Into<String>>(mut self, note: N) -> Self {
self.set_note(note);
self
}

/// Set the help message of this report.
pub fn set_help<N: ToString>(&mut self, note: N) {
self.help = Some(note.to_string());
pub fn set_help<N: Into<String>>(&mut self, note: N) {
self.help = Some(note.into());
}

/// Set the help message of this report.
pub fn with_help<N: ToString>(mut self, note: N) -> Self {
pub fn with_help<N: Into<String>>(mut self, note: N) -> Self {
self.set_help(note);
self
}
Expand Down