Skip to content

Commit d5f0d4a

Browse files
committed
Rename has_compile_version to check_version
1 parent 3cc9a51 commit d5f0d4a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/sys/fanotify.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ pub struct FanotifyEvent {
170170
/// Version number for the structure. It must be compared to
171171
/// `FANOTIFY_METADATA_VERSION` to verify compile version and runtime
172172
/// version does match. It can be done with the
173-
/// `FanotifyEvent::has_compile_version` method.
173+
/// `FanotifyEvent::check_version` method.
174174
pub version: u8,
175175
/// Mask flags of the events.
176176
pub mask: MaskFlags,
@@ -186,7 +186,7 @@ pub struct FanotifyEvent {
186186
impl FanotifyEvent {
187187
/// Checks that compile fanotify API version is equal to the version of the
188188
/// event.
189-
pub fn has_compile_version(&self) -> bool {
189+
pub fn check_version(&self) -> bool {
190190
self.version == FANOTIFY_METADATA_VERSION
191191
}
192192
}

test/sys/test_fanotify.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn test_fanotify_notifications() {
4040
let [event] = &group.read_events().unwrap()[..] else {
4141
panic!("should have read exactly one event");
4242
};
43-
assert!(event.has_compile_version());
43+
assert!(event.check_version());
4444
assert_eq!(event.mask, MaskFlags::FAN_OPEN | MaskFlags::FAN_CLOSE_WRITE);
4545
let fd = event.fd.as_ref().unwrap();
4646
let path = read_link(format!("/proc/self/fd/{}", fd.as_raw_fd())).unwrap();
@@ -55,7 +55,7 @@ fn test_fanotify_notifications() {
5555
let [event] = &group.read_events().unwrap()[..] else {
5656
panic!("should have read exactly one event");
5757
};
58-
assert!(event.has_compile_version());
58+
assert!(event.check_version());
5959
assert_eq!(
6060
event.mask,
6161
MaskFlags::FAN_OPEN
@@ -76,7 +76,7 @@ fn test_fanotify_notifications() {
7676
let [event] = &group.read_events().unwrap()[..] else {
7777
panic!("should have read exactly one event");
7878
};
79-
assert!(event.has_compile_version());
79+
assert!(event.check_version());
8080
assert_eq!(
8181
event.mask,
8282
MaskFlags::FAN_OPEN | MaskFlags::FAN_CLOSE_NOWRITE
@@ -118,7 +118,7 @@ fn test_fanotify_responses() {
118118
let [event] = &group.read_events().unwrap()[..] else {
119119
panic!("should have read exactly one event");
120120
};
121-
assert!(event.has_compile_version());
121+
assert!(event.check_version());
122122
assert_eq!(event.mask, MaskFlags::FAN_OPEN_PERM);
123123
let fd = event.fd.as_ref().unwrap();
124124
let path = read_link(format!("/proc/self/fd/{}", fd.as_raw_fd())).unwrap();
@@ -134,7 +134,7 @@ fn test_fanotify_responses() {
134134
let [event] = &group.read_events().unwrap()[..] else {
135135
panic!("should have read exactly one event");
136136
};
137-
assert!(event.has_compile_version());
137+
assert!(event.check_version());
138138
assert_eq!(event.mask, MaskFlags::FAN_OPEN_PERM);
139139
let fd = event.fd.as_ref().unwrap();
140140
let path = read_link(format!("/proc/self/fd/{}", fd.as_raw_fd())).unwrap();

0 commit comments

Comments
 (0)