Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit48c08f0

Browse files
author
Ruben Schmidmeister
committed
Enforce rust 2018 idioms
1 parent61a75ca commit48c08f0

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

‎src/formatter/mod.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fn repeat_char(c: char, n: usize) -> String {
4747
/// assert_eq!(dlf.format(&dl), "192 | Example line of text");
4848
/// ```
4949
pubstructDisplayListFormatter{
50-
stylesheet:Box<Stylesheet>,
50+
stylesheet:Box<dynStylesheet>,
5151
}
5252

5353
implDisplayListFormatter{
@@ -101,7 +101,7 @@ impl DisplayListFormatter {
101101
}
102102
}
103103

104-
fnget_annotation_style(&self,annotation_type:&DisplayAnnotationType) ->Box<Style>{
104+
fnget_annotation_style(&self,annotation_type:&DisplayAnnotationType) ->Box<dynStyle>{
105105
self.stylesheet.get_style(match annotation_type{
106106
DisplayAnnotationType::Error =>StyleClass::Error,
107107
DisplayAnnotationType::Warning =>StyleClass::Warning,

‎src/formatter/style.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ pub trait Style {
8787
fnpaint(&self,text:&str) ->String;
8888
/// The method used by the DisplayListFormatter to display the message
8989
/// in bold font.
90-
fnbold(&self) ->Box<Style>;
90+
fnbold(&self) ->Box<dynStyle>;
9191
}
9292

9393
/// Trait to annotate structs that can provide `Style` implementations for
9494
/// every `StyleClass` variant.
9595
pubtraitStylesheet{
9696
/// Returns a `Style` implementer based on the requested `StyleClass` variant.
97-
fnget_style(&self,class:StyleClass) ->Box<Style>;
97+
fnget_style(&self,class:StyleClass) ->Box<dynStyle>;
9898
}

‎src/lib.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![deny(rust_2018_idioms)]
2+
13
//! A library for formatting of text or programming code snippets.
24
//!
35
//! It's primary purpose is to build an ASCII-graphical representation of the snippet

‎src/stylesheets/no_color.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ impl Style for NoOpStyle {
77
text.to_string()
88
}
99

10-
fnbold(&self) ->Box<Style>{
10+
fnbold(&self) ->Box<dynStyle>{
1111
Box::new(NoOpStyle{})
1212
}
1313
}
1414

1515
pubstructNoColorStylesheet{}
1616

1717
implStylesheetforNoColorStylesheet{
18-
fnget_style(&self,_class:StyleClass) ->Box<Style>{
18+
fnget_style(&self,_class:StyleClass) ->Box<dynStyle>{
1919
Box::new(NoOpStyle{})
2020
}
2121
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp