Skip to content

Commit 3014ff3

Browse files
committed
deref Label to &str directly
1 parent 4d0226b commit 3014ff3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

parser/src/command/relabel.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ impl Label {
5151
}
5252

5353
impl std::ops::Deref for Label {
54-
type Target = String;
55-
fn deref(&self) -> &String {
56-
&self.0
54+
type Target = str;
55+
fn deref(&self) -> &str {
56+
self.0.as_str()
5757
}
5858
}
5959

src/handlers/relabel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub(super) async fn handle_command(
3232

3333
// Check label authorization for the current user
3434
for delta in &input.0 {
35-
let name = delta.label().as_str();
35+
let name = delta.label() as &str;
3636
let err = match check_filter(name, config, is_member(event.user(), &ctx.team).await) {
3737
Ok(CheckFilterResult::Allow) => None,
3838
Ok(CheckFilterResult::Deny) => {

0 commit comments

Comments
 (0)