@@ -6,8 +6,6 @@ use log::{Level, logger, Record};
6
6
7
7
use crate :: QString ;
8
8
9
- use self :: QtMsgType :: * ;
10
-
11
9
cpp ! { {
12
10
#include <qmetaobject_rust. hpp>
13
11
} }
@@ -88,11 +86,11 @@ impl From<QtMsgType> for Level {
88
86
/// [`Qt::QtMsgType`]: https://doc.qt.io/qt-5/qtglobal.html#QtMsgType-enum
89
87
fn from ( lvl : QtMsgType ) -> Self {
90
88
match lvl {
91
- QtDebugMsg => Level :: Debug ,
92
- QtInfoMsg => Level :: Info ,
93
- QtWarningMsg => Level :: Warn ,
94
- QtCriticalMsg => Level :: Error ,
95
- QtFatalMsg => Level :: Error ,
89
+ QtMsgType :: QtDebugMsg => Level :: Debug ,
90
+ QtMsgType :: QtInfoMsg => Level :: Info ,
91
+ QtMsgType :: QtWarningMsg => Level :: Warn ,
92
+ QtMsgType :: QtCriticalMsg => Level :: Error ,
93
+ QtMsgType :: QtFatalMsg => Level :: Error ,
96
94
// XXX: What are the external guarantees about possible values of QtMsgType?
97
95
// XXX: Are they promised to be limited to the valid enum variants?
98
96
}
@@ -113,11 +111,11 @@ impl From<Level> for QtMsgType {
113
111
/// [`Qt::QtMsgType`]: https://doc.qt.io/qt-5/qtglobal.html#QtMsgType-enum
114
112
fn from ( lvl : Level ) -> Self {
115
113
match lvl {
116
- Level :: Error => QtCriticalMsg ,
117
- Level :: Warn => QtWarningMsg ,
118
- Level :: Info => QtInfoMsg ,
119
- Level :: Debug => QtDebugMsg ,
120
- Level :: Trace => QtDebugMsg ,
114
+ Level :: Error => QtMsgType :: QtCriticalMsg ,
115
+ Level :: Warn => QtMsgType :: QtWarningMsg ,
116
+ Level :: Info => QtMsgType :: QtInfoMsg ,
117
+ Level :: Debug => QtMsgType :: QtDebugMsg ,
118
+ Level :: Trace => QtMsgType :: QtDebugMsg ,
121
119
}
122
120
}
123
121
}
@@ -201,7 +199,7 @@ mod tests {
201
199
202
200
#[ test]
203
201
fn test_convert ( ) {
204
- assert_eq ! ( Level :: from( QtInfoMsg ) , Level :: Info ) ;
205
- assert_eq ! ( QtCriticalMsg , QtMsgType :: from( Level :: Error ) )
202
+ assert_eq ! ( Level :: from( QtMsgType :: QtInfoMsg ) , Level :: Info ) ;
203
+ assert_eq ! ( QtMsgType :: QtCriticalMsg , QtMsgType :: from( Level :: Error ) )
206
204
}
207
205
}
0 commit comments