File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,12 @@ use std::fmt::{self, Debug};
2
2
use std:: ops:: Deref ;
3
3
use std:: ptr;
4
4
5
+ #[ allow( deprecated) ]
6
+ use hdf5_sys:: h5o:: H5Oset_comment ;
5
7
use hdf5_sys:: {
6
8
h5f:: H5Fget_name ,
7
9
h5i:: { H5Iget_file_id , H5Iget_name } ,
8
- h5o:: { H5Oget_comment , H5Oset_comment } ,
10
+ h5o:: H5Oget_comment ,
9
11
} ;
10
12
11
13
use crate :: internal_prelude:: * ;
@@ -74,15 +76,19 @@ impl Location {
74
76
}
75
77
76
78
/// Set or the commment attached to the named object.
79
+ #[ deprecated( note = "Attributes are preferred to comments" ) ]
77
80
pub fn set_comment ( & self , comment : & str ) -> Result < ( ) > {
78
81
// TODO: &mut self?
79
82
let comment = to_cstring ( comment) ?;
83
+ #[ allow( deprecated) ]
80
84
h5call ! ( H5Oset_comment ( self . id( ) , comment. as_ptr( ) ) ) . and ( Ok ( ( ) ) )
81
85
}
82
86
83
87
/// Clear the commment attached to the named object.
88
+ #[ deprecated( note = "Attributes are preferred to comments" ) ]
84
89
pub fn clear_comment ( & self ) -> Result < ( ) > {
85
90
// TODO: &mut self?
91
+ #[ allow( deprecated) ]
86
92
h5call ! ( H5Oset_comment ( self . id( ) , ptr:: null_mut( ) ) ) . and ( Ok ( ( ) ) )
87
93
}
88
94
}
@@ -114,6 +120,7 @@ pub mod tests {
114
120
115
121
#[ test]
116
122
pub fn test_comment ( ) {
123
+ #[ allow( deprecated) ]
117
124
with_tmp_file ( |file| {
118
125
assert ! ( file. comment( ) . is_none( ) ) ;
119
126
assert ! ( file. set_comment( "foo" ) . is_ok( ) ) ;
You can’t perform that action at this time.
0 commit comments