Skip to content

Commit 94c80ad

Browse files
committed
id.rs: Make terser with some use statements
1 parent e6a158c commit 94c80ad

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

src/id.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
//! Code for handling IDs
22
use anyhow::{Context, Result};
33
use indexmap::IndexSet;
4+
use std::borrow::Borrow;
45
use std::collections::HashSet;
6+
use std::fmt::Display;
7+
use std::hash::Hash;
58

69
/// A trait alias for ID types
7-
pub trait IDLike:
8-
Eq + std::hash::Hash + std::borrow::Borrow<str> + Clone + std::fmt::Display + From<String>
9-
{
10-
}
11-
impl<T> IDLike for T where
12-
T: Eq + std::hash::Hash + std::borrow::Borrow<str> + Clone + std::fmt::Display + From<String>
13-
{
14-
}
10+
pub trait IDLike: Eq + Hash + Borrow<str> + Clone + Display + From<String> {}
11+
impl<T> IDLike for T where T: Eq + Hash + Borrow<str> + Clone + Display + From<String> {}
1512

1613
macro_rules! define_id_type {
1714
($name:ident) => {

0 commit comments

Comments
 (0)