forked from b4skyx/hello-world.rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LICENSE.rs
31 lines (25 loc) · 1.01 KB
/
LICENSE.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use legal::oss::{ComplianceFuture, Licenser, Project, OssLicense};
#[cfg(test)]
mod tests {
const ORIGINAL_LICENSE: &str = "Copying and distribution of this file, with or without modification, are permitted in any medium provided you do not contact the author about the file or any problems you are having with the file.";
#[test]
fn compare_with_parsed() {
let parsed = OssLicense::parse(ORIGINAL_LICENSE);
assert_eq!(
parsed,
DamaiLicense::new(parsed.base_project(), parsed.licenser())
);
}
}
#[license]
pub struct DamaiLicense {
licenser: Licenser,
}
impl OssLicense for DamaiLicense {
fn new(_base_project: Project, licenser: Licenser) -> Self {
DamaiLicense { licenser }
}
fn complies(&self, project: Project) -> ComplianceFuture {
self.licenser.ask_complies(project) // this is really subjective 🚀️🚀️🚀
}
}