Skip to content

Commit c580825

Browse files
committed
Docs & clippy improvements
1 parent 1ee308f commit c580825

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

lib/src/agents.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
//! Logic for Agents - which are like Users
1+
//! Logic for Agents
2+
//! Agents are actors (such as users) that can edit content.
3+
//! https://docs.atomicdata.dev/commits/concepts.html
24
35
use crate::{Resource, Storelike, datetime_helpers, errors::AtomicResult, urls};
46

lib/src/config.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
//! Configuration logic which can be used in both CLI and Server contexts
2+
//! For serializaing, storing, and parsing the `~/.config/atomic/config.toml` file
3+
24
use crate::errors::AtomicResult;
35
use serde::{Deserialize, Serialize};
4-
use std::path::PathBuf;
6+
use std::path::{Path, PathBuf};
57

68
/// A set of options that are shared between CLI and Server contexts
79
#[derive(Debug, Serialize, Deserialize, Clone)]
@@ -29,7 +31,7 @@ pub fn default_config_file_path() -> AtomicResult<PathBuf> {
2931
}
3032

3133
/// Reads config file from a specified path
32-
pub fn read_config(path: &PathBuf) -> AtomicResult<Config> {
34+
pub fn read_config(path: &Path) -> AtomicResult<Config> {
3335
let config_string = std::fs::read_to_string(path)
3436
.map_err(|e| format!("Error reading config from {:?}. {}", path, e))?;
3537
let config: Config = toml::from_str(&config_string)
@@ -39,7 +41,7 @@ pub fn read_config(path: &PathBuf) -> AtomicResult<Config> {
3941

4042
/// Writes config file from a specified path
4143
/// Overwrites any existing config
42-
pub fn write_config(path: &PathBuf, config: Config) -> AtomicResult<String> {
44+
pub fn write_config(path: &Path, config: Config) -> AtomicResult<String> {
4345
let out =
4446
toml::to_string_pretty(&config).map_err(|e| format!("Error serializing config. {}", e))?;
4547
std::fs::write(path, out.clone())

lib/src/validate.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//! Validate the Store and create a ValidationReport.
2+
//! Might be deprecated soon, as Validation hasn't been necessary since parsing has built-in data validation.
3+
14
/// Checks Atomic Data in the store for validity.
25
/// Returns an Error if it is not valid.
36
///

server/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ async fn main() -> AtomicResult<()> {
9696
// continue, start server
9797
}
9898
Some(unkown) => {
99-
panic!(format!("Unkown command: {}", unkown));
99+
panic!("Unkown command: {}", unkown);
100100
}
101101
None => {
102102
// Start server if no command is found

0 commit comments

Comments
 (0)