summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcheck6
-rw-r--r--obnam.md23
-rw-r--r--obnam.subplot22
-rw-r--r--src/chunk.rs2
-rw-r--r--src/chunkmeta.rs2
-rw-r--r--src/fsentry.rs2
-rw-r--r--src/policy.rs5
-rw-r--r--src/server.rs2
8 files changed, 31 insertions, 33 deletions
diff --git a/check b/check
index 905bc5b..059886d 100755
--- a/check
+++ b/check
@@ -50,11 +50,11 @@ $hideok cargo build --all-targets
got_cargo_cmd fmt && $hideok cargo fmt -- --check
$hideok cargo test
-subplot docgen obnam.md -o obnam.html
-subplot docgen obnam.md -o obnam.pdf
+subplot docgen obnam.subplot -o obnam.html
+subplot docgen obnam.subplot -o obnam.pdf
target="$(cargo metadata --format-version=1 | python3 -c 'import sys, json; o = json.load(sys.stdin); print(o["target_directory"])')"
-subplot codegen obnam.md -o test.py
+subplot codegen obnam.subplot -o test.py
rm -f test.log
if [ "$(id -un)" = root ]; then
echo Not running tests as root.
diff --git a/obnam.md b/obnam.md
index e1f3055..0c36a8b 100644
--- a/obnam.md
+++ b/obnam.md
@@ -1,26 +1,3 @@
----
-title: "Obnam2—a backup system"
-author: Lars Wirzenius
-documentclass: report
-bindings:
- - subplot/server.yaml
- - subplot/client.yaml
- - subplot/data.yaml
- - lib/files.yaml
- - lib/runcmd.yaml
-impls:
- python:
- - subplot/server.py
- - subplot/client.py
- - subplot/data.py
- - lib/daemon.py
- - lib/files.py
- - lib/runcmd.py
-classes:
- - json
- - sql
-...
-
# Abstract
Obnam is a backup system, consisting of a not very smart server for
diff --git a/obnam.subplot b/obnam.subplot
new file mode 100644
index 0000000..80deeca
--- /dev/null
+++ b/obnam.subplot
@@ -0,0 +1,22 @@
+title: "Obnam2—a backup system"
+author: Lars Wirzenius
+documentclass: report
+markdowns:
+ - obnam.md
+bindings:
+ - subplot/server.yaml
+ - subplot/client.yaml
+ - subplot/data.yaml
+ - lib/files.yaml
+ - lib/runcmd.yaml
+impls:
+ python:
+ - subplot/server.py
+ - subplot/client.py
+ - subplot/data.py
+ - lib/daemon.py
+ - lib/files.py
+ - lib/runcmd.py
+classes:
+ - json
+ - sql
diff --git a/src/chunk.rs b/src/chunk.rs
index 4f604b9..a6abad3 100644
--- a/src/chunk.rs
+++ b/src/chunk.rs
@@ -13,7 +13,7 @@ use std::default::Default;
/// together. The identifier is used to find the chunk, and it's
/// assigned by the server when the chunk is uploaded, so it's not
/// stored in the chunk itself.
-#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
+#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
pub struct DataChunk {
data: Vec<u8>,
meta: ChunkMeta,
diff --git a/src/chunkmeta.rs b/src/chunkmeta.rs
index fe7ef4c..e2fa9b3 100644
--- a/src/chunkmeta.rs
+++ b/src/chunkmeta.rs
@@ -28,7 +28,7 @@ use std::str::FromStr;
///
/// [ISO 8601]: https://en.wikipedia.org/wiki/ISO_8601
/// [SHA256]: https://en.wikipedia.org/wiki/SHA-2
-#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
+#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
pub struct ChunkMeta {
label: String,
}
diff --git a/src/fsentry.rs b/src/fsentry.rs
index 276e3f9..f31d6b5 100644
--- a/src/fsentry.rs
+++ b/src/fsentry.rs
@@ -268,7 +268,7 @@ impl EntryBuilder {
}
/// Different types of file system entries.
-#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Serialize, Deserialize)]
pub enum FilesystemKind {
/// Regular file, including a hard link to one.
Regular,
diff --git a/src/policy.rs b/src/policy.rs
index bb98a48..b3ba24c 100644
--- a/src/policy.rs
+++ b/src/policy.rs
@@ -32,7 +32,7 @@ impl BackupPolicy {
/// Does a given file need to be backed up?
pub fn needs_backup(&self, old: &LocalGeneration, new_entry: &FilesystemEntry) -> Reason {
let new_name = new_entry.pathbuf();
- let reason = match old.get_file(&new_name) {
+ match old.get_file(&new_name) {
Ok(None) => {
if self.new {
Reason::IsNew
@@ -58,8 +58,7 @@ impl BackupPolicy {
);
Reason::GenerationLookupError
}
- };
- reason
+ }
}
}
diff --git a/src/server.rs b/src/server.rs
index 6b688d6..ffd4009 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -115,7 +115,7 @@ impl Fetched {
}
/// Result of a search.
-#[derive(Debug, Default, PartialEq, Deserialize, Serialize)]
+#[derive(Debug, Default, Eq, PartialEq, Deserialize, Serialize)]
pub struct SearchHits {
map: HashMap<String, ChunkMeta>,
}