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,11 +2,13 @@ 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
h5a:: H5Aopen ,
7
9
h5f:: H5Fget_name ,
8
10
h5i:: { H5Iget_file_id , H5Iget_name } ,
9
- h5o:: { H5Oget_comment , H5Oset_comment } ,
11
+ h5o:: H5Oget_comment ,
10
12
} ;
11
13
12
14
use crate :: internal_prelude:: * ;
@@ -77,15 +79,19 @@ impl Location {
77
79
}
78
80
79
81
/// Set or the commment attached to the named object.
82
+ #[ deprecated( note = "Attributes are preferred to comments" ) ]
80
83
pub fn set_comment ( & self , comment : & str ) -> Result < ( ) > {
81
84
// TODO: &mut self?
82
85
let comment = to_cstring ( comment) ?;
86
+ #[ allow( deprecated) ]
83
87
h5call ! ( H5Oset_comment ( self . id( ) , comment. as_ptr( ) ) ) . and ( Ok ( ( ) ) )
84
88
}
85
89
86
90
/// Clear the commment attached to the named object.
91
+ #[ deprecated( note = "Attributes are preferred to comments" ) ]
87
92
pub fn clear_comment ( & self ) -> Result < ( ) > {
88
93
// TODO: &mut self?
94
+ #[ allow( deprecated) ]
89
95
h5call ! ( H5Oset_comment ( self . id( ) , ptr:: null_mut( ) ) ) . and ( Ok ( ( ) ) )
90
96
}
91
97
@@ -134,6 +140,7 @@ pub mod tests {
134
140
135
141
#[ test]
136
142
pub fn test_comment ( ) {
143
+ #[ allow( deprecated) ]
137
144
with_tmp_file ( |file| {
138
145
assert ! ( file. comment( ) . is_none( ) ) ;
139
146
assert ! ( file. set_comment( "foo" ) . is_ok( ) ) ;
You can’t perform that action at this time.
0 commit comments